Line data Source code
1 : import 'package:flutter_chrome_cast/common/live_seekable_range.dart';
2 : import 'package:flutter_chrome_cast/enums/repeat_mode.dart';
3 : import 'package:flutter_chrome_cast/entities/media_information.dart';
4 : import 'package:flutter_chrome_cast/enums/idle_reason.dart';
5 : import 'package:flutter_chrome_cast/enums/player_state.dart';
6 : import 'break_status.dart';
7 :
8 : /// Represents the status of a media session, including player state, volume, repeat mode, and more.
9 : class GoggleCastMediaStatus {
10 : /// Unique ID for the playback of this specific session.
11 : final int mediaSessionID;
12 :
13 : /// Describes the state of the player as one of the following: [CastMediaPlayerState].
14 : final CastMediaPlayerState playerState;
15 :
16 : /// If the playerState is IDLE and the reason it became IDLE is known, this property is provided.
17 : final GoogleCastMediaIdleReason? idleReason;
18 :
19 : /// Indicates whether the media time is progressing, and at what rate.
20 : /// 1.0 is regular time, 0.5 is slow motion.
21 : final num playbackRate;
22 :
23 : /// The media information for the current session.
24 : final GoogleCastMediaInformation? mediaInformation;
25 :
26 : /// The current position of the media player since the beginning of the content, in seconds.
27 : /// For live streams, this is the time from the beginning of the event.
28 : final num volume;
29 :
30 : /// The stream muted state.
31 : final bool isMuted;
32 :
33 : /// The repeat mode for playing the queue.
34 : final GoogleCastMediaRepeatMode repeatMode;
35 :
36 : /// Item ID of the item that was active in the queue (it may not be playing)
37 : /// at the time the media status change happened.
38 : final int? currentItemId;
39 :
40 : /// List of IDs corresponding to the active Tracks.
41 : final List<int>? activeTrackIds;
42 :
43 : /// Status of a break when a break is playing
44 : /// on the receiver. This field will be
45 : /// defined when the receiver is playing
46 : /// a break, empty when a break is not playing,
47 : /// but is present in the content, and
48 : /// undefined if the content contains
49 : /// no breaks.
50 : final GoogleCastBrakeStatus? adBreakStatus;
51 :
52 : /// Seekable range of a live or event stream. I
53 : /// t uses relative media time in seconds.
54 : /// It will be undefined for VOD streams.
55 : final GoogleCastMediaLiveSeekableRange? liveSeekableRange;
56 :
57 : /// Item ID of the item that is currently loading
58 : /// on the receiver. Null if no item is currently
59 : /// loading.
60 :
61 : /// Queue data
62 : // final GoogleCastMediaQueueData? queueData;
63 2 : GoggleCastMediaStatus({
64 : required this.mediaSessionID,
65 : required this.playerState,
66 : this.idleReason,
67 : required this.playbackRate,
68 : this.mediaInformation,
69 : required this.volume,
70 : required this.isMuted,
71 : required this.repeatMode,
72 : this.currentItemId,
73 : this.activeTrackIds,
74 : this.adBreakStatus,
75 : this.liveSeekableRange,
76 : // this.queueData,
77 : });
78 : }
|