Struct twitter_card::Player
source · pub struct Player { /* private fields */ }
Expand description
Create a player card.
Player cards allow rich media to be embedded on Twitter. This includes, but is not limited to, audio clips and videos.
Implementations§
source§impl Player
impl Player
sourcepub fn site(self, site: &str) -> Self
pub fn site(self, site: &str) -> Self
@username of website. Either twitter:site or twitter:site:id is required.
sourcepub fn site_id(self, content: &str) -> Self
pub fn site_id(self, content: &str) -> Self
Same as twitter:site, but the user’s Twitter ID. Either twitter:site or twitter:site:id is required.
sourcepub fn creator_id(self, content: &str) -> Self
pub fn creator_id(self, content: &str) -> Self
Twitter user ID of content creator.
sourcepub fn image(self, content: &str) -> Self
pub fn image(self, content: &str) -> Self
URL of image to use in the card. Images must be less than 5MB in size. JPG, PNG, WEBP and GIF formats are supported. Only the first frame of an animated GIF will be used. SVG is not supported.
sourcepub fn image_alt(self, content: &str) -> Self
pub fn image_alt(self, content: &str) -> Self
A text description of the image conveying the essential nature of an image to users who are visually impaired. Maximum 420 characters.
Panics.
Panics if the description is more than 420 characters.
sourcepub fn player_width(self, content: &str) -> Self
pub fn player_width(self, content: &str) -> Self
Width of iframe in pixels.
sourcepub fn player_height(self, content: &str) -> Self
pub fn player_height(self, content: &str) -> Self
Height of iframe in pixels.
sourcepub fn player_stream(self, content: &str) -> Self
pub fn player_stream(self, content: &str) -> Self
URL to raw video or audio stream.