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
use crate::{define_obj_type, ns};
#[doc(alias = "AVPlayerItemStatus")]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(isize)]
pub enum Status {
Unknown = 0,
ReadyToPlay = 1,
Failed = 2,
}
define_obj_type!(
#[doc(alias = "AVPlayerItem")]
pub Item(ns::Id)
);
impl ns::NotificationName {
/// A notification the system posts when a player item’s time changes discontinuously.
///
/// The notification’s object is the player item.
///
/// The system may post this notification on a thread other than the one you use to register the observer.
#[doc(alias = "AVPlayerItemTimeJumpedNotification")]
#[inline]
pub fn av_player_item_time_jumped() -> &'static Self {
unsafe { AVPlayerItemTimeJumpedNotification }
}
/// A notification the system posts when a player item plays to its end time.
///
/// The notification’s object is the item that finished playing.
///
/// The system may post this notification on a thread other than the one you use to register the observer.
#[doc(alias = "AVPlayerItemDidPlayToEndTimeNotification")]
#[inline]
pub fn av_player_item_did_play_to_end_time() -> &'static Self {
unsafe { AVPlayerItemDidPlayToEndTimeNotification }
}
/// A notification that the system posts when a player item fails to play to its end time.
///
/// The notification’s object is the player item that finished playing.
///
/// The system may post this notification on a thread other than the one you use to register the observer.
#[doc(alias = "AVPlayerItemFailedToPlayToEndTimeNotification")]
#[inline]
pub fn av_player_item_failed_play_to_end_time() -> &'static Self {
unsafe { AVPlayerItemFailedToPlayToEndTimeNotification }
}
/// A notification the system posts when a player item media doesn’t arrive in time to continue playback.
///
/// The notification’s object is the player item whose playback is unable to continue due to network delays.
/// Streaming-media playback continues after the player item retrieves a sufficient amount of data.
/// File-based playback doesn’t continue.
///
/// # Important
/// The system may post this notification on a thread other than the one you use to register the observer.
#[doc(alias = "AVPlayerItemPlaybackStalledNotification")]
#[inline]
pub fn av_player_item_playback_stalled() -> &'static Self {
unsafe { AVPlayerItemPlaybackStalledNotification }
}
/// A notification the system posts when a player item adds a new entry to its access log.
///
/// The notification’s object is the player item.
///
/// # Important
/// The system may post this notification on a thread other than the one you use to register the observer.
#[doc(alias = "AVPlayerItemNewAccessLogEntryNotification")]
#[inline]
pub fn av_player_item_new_access_log_entry() -> &'static Self {
unsafe { AVPlayerItemNewAccessLogEntryNotification }
}
/// A notification the system posts when a player item adds a new entry to its error log.
///
/// The notification’s object is the player item
///
/// The system may post this notification on a thread other than the one you use to register the observer.
#[doc(alias = "AVPlayerItemNewErrorLogEntryNotification")]
#[inline]
pub fn av_player_item_error_access_log_entry() -> &'static Self {
unsafe { AVPlayerItemNewErrorLogEntryNotification }
}
/// A notification the player item posts when its offset from the live time changes.
///
/// Register to observe notifications of this type to observe changes to the value of the recommended_time_offset_from_live property
#[doc(alias = "AVPlayerItemRecommendedTimeOffsetFromLiveDidChangeNotification")]
#[inline]
pub fn av_player_item_recommended_time_offset_from_live_did_change() -> &'static Self {
unsafe { AVPlayerItemRecommendedTimeOffsetFromLiveDidChangeNotification }
}
/// A notification the player item posts when its media selection changes.
#[doc(alias = "AVPlayerItemMediaSelectionDidChangeNotification")]
#[inline]
pub fn av_player_item_media_selection_did_change() -> &'static Self {
unsafe { AVPlayerItemMediaSelectionDidChangeNotification }
}
}
#[link(name = "AVFoundation", kind = "framework")]
unsafe extern "C" {
static AVPlayerItemTimeJumpedNotification: &'static ns::NotificationName;
static AVPlayerItemDidPlayToEndTimeNotification: &'static ns::NotificationName;
static AVPlayerItemFailedToPlayToEndTimeNotification: &'static ns::NotificationName;
static AVPlayerItemPlaybackStalledNotification: &'static ns::NotificationName;
static AVPlayerItemNewAccessLogEntryNotification: &'static ns::NotificationName;
static AVPlayerItemNewErrorLogEntryNotification: &'static ns::NotificationName;
static AVPlayerItemRecommendedTimeOffsetFromLiveDidChangeNotification:
&'static ns::NotificationName;
static AVPlayerItemMediaSelectionDidChangeNotification: &'static ns::NotificationName;
}