pub struct MediaContent {
pub url: String,
pub type_: Option<String>,
pub medium: Option<String>,
pub file_size: Option<u64>,
pub bitrate: Option<u32>,
pub framerate: Option<f32>,
pub width: Option<u32>,
pub height: Option<u32>,
pub duration: Option<u32>,
pub expression: Option<String>,
pub is_default: Option<bool>,
}Expand description
Media RSS content element with full attribute support
Represents a media object embedded in the feed with detailed metadata. Commonly used in video/audio feeds and podcasts.
§Security Warning
The url field comes from untrusted feed input and has NOT been validated for SSRF.
Applications MUST validate URLs before fetching to prevent SSRF attacks.
§Examples
use feedparser_rs::namespace::media_rss::MediaContent;
let content = MediaContent {
url: "https://example.com/video.mp4".to_string(),
type_: Some("video/mp4".to_string()),
medium: Some("video".to_string()),
width: Some(1920),
height: Some(1080),
..Default::default()
};
assert_eq!(content.url, "https://example.com/video.mp4");Fields§
§url: StringURL of the media object (url attribute)
§Security Warning
This URL comes from untrusted feed input and has NOT been validated for SSRF. Applications MUST validate URLs before fetching to prevent SSRF attacks.
type_: Option<String>MIME type (type attribute): “video/mp4”, “audio/mpeg”, etc.
medium: Option<String>Medium type (medium attribute): “image”, “video”, “audio”, “document”, “executable”
file_size: Option<u64>File size in bytes (fileSize attribute)
bitrate: Option<u32>Bitrate in kilobits per second (bitrate attribute)
framerate: Option<f32>Frame rate in frames per second (framerate attribute)
width: Option<u32>Width in pixels (width attribute)
height: Option<u32>Height in pixels (height attribute)
duration: Option<u32>Duration in seconds (duration attribute)
expression: Option<String>Expression (expression attribute): “full”, “sample”, “nonstop”
- “full”: complete media object
- “sample”: preview/sample of media
- “nonstop”: continuous/streaming media
is_default: Option<bool>Whether this is the default media object (isDefault attribute)
Trait Implementations§
Source§impl Clone for MediaContent
impl Clone for MediaContent
Source§fn clone(&self) -> MediaContent
fn clone(&self) -> MediaContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more