Skip to main content

PlayItemRequest

Struct PlayItemRequest 

Source
pub struct PlayItemRequest {
Show 13 fields pub id: String, pub title: String, pub stream_url: String, pub video_codec: String, pub needs_transcoding: bool, pub transport: Option<Transport>, pub artist: Option<String>, pub primary_image_tag: Option<String>, pub server_id: Option<String>, pub duration_seconds: Option<f64>, pub item_type: Option<String>, pub series_id: Option<String>, pub subtitles: Vec<SubtitleTrack>,
}
Expand description

Request to play a single video item

Simplified to video playback only. Audio playback uses player_play_tracks to avoid Tauri Android serialization issues with complex objects.

Fields§

§id: String§title: String§stream_url: String§video_codec: String

Video codec (e.g., “h264”, “hevc”) for video media

§needs_transcoding: bool

Whether the video requires server-side transcoding

§transport: Option<Transport>

How this item’s stream is fetched, as the backend decided it.

Carried on the queue item so a later seek/reload does not have to guess. None for items queued by a path that never negotiated (audio tracks, direct URLs) and for anything queued before this field existed, where the caller falls back to needs_transcoding — every transcode this app requests is HLS (DR-140), so that fallback is exact rather than a guess.

TRACES: UR-003, UR-004, UR-079 | DR-225, DR-230

§artist: Option<String>

Optional now-playing metadata. Used by the background-audio handoff so the lockscreen/miniplayer show the item (title/subtitle/artwork). Defaulted so existing video-only callers need not send them.

§primary_image_tag: Option<String>§server_id: Option<String>§duration_seconds: Option<f64>

Total media duration (seconds). Threaded through the background-audio handoff so the lockscreen MediaSession advertises a real duration — a zero-duration session renders no scrubber, even with ACTION_SEEK_TO set.

§item_type: Option<String>

Item type (e.g. “Episode”, “Movie”, “Audio”). Carried through the background-audio handoff so an episode played as audio-only is still recognised as an episode by autoplay (UR-040) and advances to the next one.

§series_id: Option<String>

Series ID for TV episodes. Needed alongside item_type so the backend can look up the next episode when a background-audio track ends.

§subtitles: Vec<SubtitleTrack>

Subtitle tracks to sideload, with URLs the frontend has already resolved.

Only the native backends use these: on Android they become the MediaItem.SubtitleConfigurations ExoPlayer renders. The HTML5 path builds its own <track> children instead and ignores this list.

Order is the contract. player_set_subtitle_track(n) reaches JellyTauPlayer.setSubtitleTrack(n), which indexes into ExoPlayer’s text track groups — i.e. the position of the sideloaded configuration, not the Jellyfin stream index (which is kept on each entry for the UI’s benefit). So n must be a position in this very array, and the array must not be reordered or filtered between building it and sending it. nativeSubtitleArrayIndex() on the frontend computes n from the same list that is sent here, for exactly this reason.

Defaulted so the background-audio handoff and the autoplay/next-episode callers, which have no subtitles to offer, need not send the field.

TRACES: UR-020 | IR-016, JA-008 | UT-145

Trait Implementations§

Source§

impl Debug for PlayItemRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PlayItemRequest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl NamedType for PlayItemRequest

Source§

fn sid() -> SpectaID

Source§

fn named_data_type( type_map: &mut TypeCollection, generics: &[DataType], ) -> NamedDataType

this is equivalent to [Type::inline] but returns a [NamedDataType] instead.
Source§

fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType

this is equivalent to [Type::definition] but returns a [NamedDataType] instead.
Source§

impl Type for PlayItemRequest

Source§

fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType

Returns the definition of a type using the provided generics. Read more
Source§

fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference

Generates a datatype corresponding to a reference to this type, as determined by its category. Getting a reference to a type implies that it should belong in the type map (since it has to be referenced from somewhere), so the output of definition will be put into the type map.
Source§

impl Flatten for PlayItemRequest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<'de, D, R> CommandArg<'de, R> for D
where D: Deserialize<'de>, R: Runtime,

§

fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>

Derives an instance of Self from the [CommandItem]. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FunctionArg for T
where T: Type,

§

fn to_datatype(type_map: &mut TypeCollection) -> Option<DataType>

Gets the type of an argument as a [DataType]. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ScopeObject for T
where T: Send + Sync + Debug + DeserializeOwned + 'static,

§

type Error = Error

The error type.
§

fn deserialize<R>( _app: &AppHandle<R>, raw: Value, ) -> Result<T, <T as ScopeObject>::Error>
where R: Runtime,

Deserialize the raw scope value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,