TimelineSynchroniser
@interface TimelineSynchroniser : NSObject
A timeline synchroniser class. This will try to synchronise a programme timeline via timeline progress updates reported via the DVB-CSS TS protocol. The programme timeline is represented as a CorrelatedClock with parent clock as the WallClock. An example of this timeline is a PTS ticks timeline that a CSS-TV playing a broadcast MPEG2 Transport Stream can report progress on.
A Control Timestamp represents a new correlation for the programme timeline: {WallClock time, Content time, speed}.
Please note that TimelineSynchroniser is not a singleton. It is perfectly possible to have multiple TimelineSynchroniser instances, each synchronising a different programme (e.g. programmes with ads, interstitials)
-
A DVB-CSS TV’s estimated timeline. A CorrelatedClock object is provided by another party representing a timeline. This is the timeline that will be synchronised with a TV’s timeline using DVB-CSS TS protocol.
Declaration
Objective-C
@property (nonatomic, weak, readonly) CorrelatedClock *cssTVTimeline
-
A string specifying the type of timeline to be selected e.g.
urn:dvb:css:timeline:pts
Declaration
Objective-C
@property (readonly, nonatomic) NSString *timelineSelector;
Swift
var timelineSelector: String! { get }
-
Id of the content currently played on the DVB-CSS TV
Declaration
Objective-C
@property (readonly, nonatomic) NSString *contentId;
Swift
var contentId: String! { get }
-
Is the cssTVTimeline currently synchronised?
Declaration
Objective-C
@property (readonly, nonatomic) BOOL isSynced;
Swift
var isSynced: Bool { get }
-
The DVB-CSS TV Tineline Synchronisation protocol’s endpoint.
Declaration
Objective-C
@property (readonly, nonatomic) NSString *tsEndpointURL;
Swift
var tsEndpointURL: String! { get }
-
An offset in milliseconds to be added to the received correlation’s wallclock timestamp. It can be positive or negative.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) NSTimeInterval offset;
Swift
var offset: TimeInterval { get set }
-
Send notifications?
Declaration
Objective-C
@property (readonly, nonatomic) BOOL notifyObservers;
Swift
var notifyObservers: Bool { get }
-
Timeline synchroniser delegate
Declaration
Objective-C
@property (assign, readwrite, nonatomic) id<TimelineSynchroniserDelegate> delegate;
Swift
var delegate: TimelineSynchroniserDelegate! { get set }
-
TimelineSynchroniser factory method
Declaration
Objective-C
+ (instancetype)TimelineSynchroniserWithTimeline:(id)timeline TimelineSelector:(NSString *)timelineSel Content:(NSString *)content_id URL:(NSString *)ts_endpoint;
Swift
convenience init!(timeline: Any!, timelineSelector timelineSel: String!, content content_id: String!, url ts_endpoint: String!)
Parameters
timeline
the CorrelatedClock object that will be synchronised to the timeline position and speed reported by the TV
timelineSel
the timeline type to be selected
content_id
the content
ts_endpoint
string for DVB-CSS TS server endpoint URL
Return Value
a TimelineSynchroniser instance
-
TimelineSynchroniser factory method
Declaration
Objective-C
+ (instancetype)TimelineSynchroniserWithTimeline:(id)timeline TimelineSelector:(NSString *)timelineSel Content:(NSString *)content_id URL:(NSString *)ts_endpoint Offset:(NSTimeInterval)offset;
Swift
convenience init!(timeline: Any!, timelineSelector timelineSel: String!, content content_id: String!, url ts_endpoint: String!, offset: TimeInterval)
Parameters
timeline
the CorrelatedClock object that will be synchronised to the timeline position and speed reported by the TV
timelineSel
the timeline type to be selected
content_id
the content
ts_endpoint
string for DVB-CSS TS server endpoint URL
offset
an offset to be added to the
Return Value
a TimelineSynchroniser instance
-
Start the timeline sync
Declaration
Objective-C
- (void)start;
Swift
func start()
-
Stop the timeline sync, close open connections and clean up
Declaration
Objective-C
- (void)stop;
Swift
func stop()
-
add an observer for clock state changes. Uses Notification design pattern in Cocoa.
Declaration
Objective-C
- (void)addObserver:(id)notificationObserver selection:(SEL)notificationSelector name:(NSString *)notificationName object:(id)objectOfInterest;
Swift
func addObserver(_ notificationObserver: Any!, selection notificationSelector: Selector!, name notificationName: String!, object objectOfInterest: Any!)
-
remove clock observer
Declaration
Objective-C
- (void)removeObserver:(id)notificationObserver;
Swift
func removeObserver(_ notificationObserver: Any!)
-
notify observers of clock state changes
Declaration
Objective-C
- (void)notifyObservers:(NSString *)notificationName object:(id)notificationSender userInfo:(NSDictionary *)userInfo;
Swift
func notifyObservers(_ notificationName: String!, object notificationSender: Any!, userInfo: [AnyHashable : Any]! = [:])