added playbackMethod to videoitem

This commit is contained in:
Simon
2026-06-25 05:33:11 +00:00
parent 6d5771a038
commit e4a84f34ee

View File

@@ -115,6 +115,8 @@ pub struct VideoItem {
pub preview: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub aspectRatio: Option<f32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub playbackMethod: Option<String>,
}
impl VideoItem {
pub fn new(
@@ -145,6 +147,7 @@ impl VideoItem {
embed: None, // Placeholder for embed information
preview: None,
aspectRatio: None,
playbackMethod: None,
}
}
pub fn from(s: String) -> Result<Self, serde_json::Error> {
@@ -194,6 +197,11 @@ impl VideoItem {
self
}
pub fn playback_method(mut self, playback_method: String) -> Self {
self.playbackMethod = Some(playback_method);
self
}
/// Re-applies the request host to every host-relative proxy URL on this item
/// (its `url`, `preview`, and each format's `url`). Cached items may have been
/// built without a host; see [`crate::providers::ensure_proxy_url_host`].