1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/// `SubtitleTrack` represents a subtitle track in a video.
///
/// # Fields
///
/// * `id: u32`: The ID of the subtitle track.
/// * `language: Option<String>`: The language of the subtitle track.
/// `AudioTrack` represents an audio track in a video.
///
/// # Fields
///
/// * `id: u32`: The ID of the audio track.
/// * `language: Option<String>`: The language of the audio track.
/// `PlayingState` represents the current playing state of a video.
///
/// # Variants
///
/// * `Playing`: The video is currently playing.
/// * `Paused`: The video is currently paused.
/// * `Stopped`: The video is currently stopped. Currently unused.
/// `VideoInfo` contains detailed information about a video.
///
/// # Fields
///
/// * `title: String`: The title of the video.
/// * `current_subtitle_track: Option<usize>`: The currently selected subtitle track, represented by its index in the `subtitle_tracks` vector. If `None`, no subtitle track is currently selected.
/// * `current_audio_track: usize`: The currently selected audio track, represented by its index in the `audio_tracks` vector.
/// * `volume: f32`: The current volume level of the video playback. The volume level is a value between 0.0 and 1.0, with 0.0 being silent and 1.0 being the maximum volume.
/// * `subtitle_tracks: Vec<SubtitleTrack>`: A vector of the available subtitle tracks.
/// * `audio_tracks: Vec<AudioTrack>`: A vector of the available audio tracks.
/// * `playing_state: PlayingState`: The current playback state of the video (e.g., playing, paused).
/// * `duration: f64`: The total duration of the video in seconds.
/// * `current_position: f64`: The current playback position in the video in seconds. This value should be between 0 and `duration`.
///
/// # Example
///
/// ```
/// use dextreamer::{PlayingState, VideoInfo};
///
/// let info = VideoInfo {
/// title: "Example Video".into(),
/// current_subtitle_track: Some(0),
/// current_audio_track: Some(0),
/// volume: 1.0,
/// subtitle_tracks: vec![],
/// audio_tracks: vec![],
/// playing_state: PlayingState::Paused,
/// duration: 600.0,
/// current_position: 0.0,
/// };
/// ```