feat: Added iced_video_player
Some checks failed
build / checks-matrix (push) Has been cancelled
build / codecov (push) Has been cancelled
docs / docs (push) Has been cancelled
build / checks-build (push) Has been cancelled

This commit is contained in:
uttarayan21
2025-11-20 21:59:47 +05:30
parent f41625e0ed
commit b1cfc19b96
24 changed files with 8109 additions and 15 deletions

View File

@@ -218,6 +218,42 @@ impl JellyfinClient {
.await?;
Ok(bytes)
}
pub async fn playback_info(&self, item: uuid::Uuid) -> Result<jellyfin::PlaybackInfoDto> {
let uri = format!("Items/{}/PlaybackInfo", item);
let text = &self
.request_builder(Method::GET, uri)
.send()
.await?
.error_for_status()?
.text()
.await?;
let out: jellyfin::PlaybackInfoDto = serde_json::from_str(&text)?;
Ok(out)
}
pub async fn user_data(&self, item: uuid::Uuid) -> Result<jellyfin::UserItemDataDto> {
let uri = format!("UserItems/{}/UserData", item);
let text = &self
.request_builder(Method::GET, uri)
.send()
.await?
.error_for_status()?
.text()
.await?;
let out: jellyfin::UserItemDataDto = serde_json::from_str(&text)?;
Ok(out)
}
pub fn stream_url(&self, item: uuid::Uuid) -> Result<url::Url> {
let stream_url = format!(
"{}/Videos/{}/stream?static=true",
self.config.server_url.as_str(),
item,
// item,
);
Ok(url::Url::parse(&stream_url).expect("Failed to parse stream URL"))
}
}
// pub trait Item {