WebViewSyncController

@interface WebViewSyncController : NSObject <InvocationProcessor>

A class to send timestamps reporting progress of a TV programme to a web view.

  • A media timeline to synchronise to.

    Declaration

    Objective-C

    @property (nonatomic, weak) CorrelatedClock *syncTimeline
  • The timeline of the TV programme (t=0 at start of programme). Set using correlation timestamp supplied at initialisation time.

    Declaration

    Objective-C

    @property (readonly, nonatomic) int *programmeTimeline;

    Swift

    var programmeTimeline: UnsafeMutablePointer
  • An UIWebView this controller will send timestamps to.

    Declaration

    Objective-C

    @property (readwrite, nonatomic) UIWebView *webView;
  • URL

    URL for webpage to load in webview

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSURL *URL;

    Swift

    var url: URL! { get set }
  • Synchronisation interval

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSTimeInterval syncInterval;

    Swift

    var syncInterval: TimeInterval { get set }
  • This sync controller’s state

    Declaration

    Objective-C

    @property (readonly, nonatomic) WebSyncControllerState state;

    Swift

    var state: WebSyncControllerState { get }
  • A delegate to report resynchronisation status.

    Declaration

    Objective-C

    @property (readwrite, nonatomic) id<SyncControllerDelegate> delegate;

    Swift

    weak var delegate: SyncControllerDelegate! { get set }
  • An HbbTV app2app URL string to pass to web view (discovered via DIAL)

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *app2AppURL;

    Swift

    var app2AppURL: String! { get set }
  • A copy of the current TV contentId

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *contentId;

    Swift

    var contentId: String! { get set }
  • Undocumented

    Declaration

    Objective-C

    @interface WebViewSyncController : NSObject <InvocationProcessor>
  • Initialises an WebViewSyncController with a webview and a timeline to synchronise to.

    Declaration

    Objective-C

    - (instancetype)initWithWebView:(UIWebView *)webview
                                URL:(NSURL *)url
                           Timeline:(id)sync_timeline
               CorrelationTimestamp:(id)correlation;

    Swift

    init!(webView webview: Any!, url: URL!, timeline sync_timeline: Any!, correlationTimestamp correlation: Any!)

    Parameters

    webview

    a UIWebView instance

    timeline

    a CorrelatedClock instance modelling a particular timeline

    Return Value

    initialised WebViewSyncController instance

  • Initialises an WebViewSyncController with a webview and a timeline to synchronise to.

    Declaration

    Objective-C

    - (instancetype)initWithWebView:(UIWebView *)webview
                                URL:(NSURL *)url
                           Timeline:(id)sync_timeline
               CorrelationTimestamp:(id)correlation
                     ReSyncInterval:(NSTimeInterval)interval_secs;

    Swift

    init!(webView webview: Any!, url: URL!, timeline sync_timeline: Any!, correlationTimestamp correlation: Any!, reSyncInterval interval_secs: TimeInterval)

    Parameters

    webview

    an UIWebView instance

    timeline

    a CorrelatedClock instance modelling a particular timeline

    interval_secs

    resynchronisation interval in seconds (as a double value)

    Return Value

    initialised WebViewSyncController instance

  • Initialises an WebViewSyncController with a webview and a timeline to synchronise to.

    Declaration

    Objective-C

    - (instancetype)initWithWebView:(UIWebView *)webview
                                URL:(NSURL *)url
                           Timeline:(id)sync_timeline
               CorrelationTimestamp:(id)correlation
                     ReSyncInterval:(NSTimeInterval)interval_secs
                           Delegate:(id<SyncControllerDelegate>)delegate;

    Swift

    init!(webView webview: Any!, url: URL!, timeline sync_timeline: Any!, correlationTimestamp correlation: Any!, reSyncInterval interval_secs: TimeInterval, delegate: SyncControllerDelegate!)

    Parameters

    webview

    an UIWebView instance

    timeline

    a CorrelatedClock instance modelling a particular timeline

    interval_secs

    resynchronisation interval in seconds (as a double value)

    delegate

    a delegate object (conforming to WebViewSyncControllerDelegate protocol) to receive callbacks

    Return Value

    initialised WebViewSyncController instance

    • Creates an instance of WebViewSyncController initialised with a web view and
    • a synchronisation timelime (the timeline to synchronise to). *
    • - parameter: webview a UIWebView object
    • - parameter: sync_timeline a CorrelatedClock object representing a synchronisation timeline
    • - parameter: correlation a pair of timestamps mapping the synchronisation timeline to the audio object timeline *
    • - returns: initialised WebViewSyncController instance

    Declaration

    Objective-C

    + (instancetype)syncControllerWithUIWebView:(UIWebView *)webview
                                            URL:(NSURL *)url
                                   SyncTimeline:(id)sync_timeline
                           CorrelationTimestamp:(id)correlation;

    Swift

    convenience init!(uiWebView webview: Any!, url: URL!, syncTimeline sync_timeline: Any!, correlationTimestamp correlation: Any!)

    Parameters

    webview

    a UIWebView object

    sync_timeline

    a CorrelatedClock object representing a synchronisation timeline

    correlation

    a pair of timestamps mapping the synchronisation timeline to the audio object timeline

    Return Value

    initialised WebViewSyncController instance

    • Creates an instance of WebViewSyncController initialised with a web view and
    • a synchronisation timelime (the timeline to synchronise to) and a delegate to
    • receive callbacks. *
    • - parameter: webview a UIWebView object
    • - parameter: sync_timeline a CorrelatedClock object representing a synchronisation timeline
    • - parameter: correlation a pair of timestamps mapping the synchronisation timeline to the audio object timeline
    • - parameter: delegate an object conforming to the WebViewSyncControllerDelegate protocol *
    • - returns: initialised WebViewSyncController instance

    Declaration

    Objective-C

    + (instancetype)syncControllerWithUIWebView:(UIWebView *)webview
                                            URL:(NSURL *)url
                                   SyncTimeline:(id)sync_timeline
                           CorrelationTimestamp:(id)correlation
                                    AndDelegate:
                                        (id<SyncControllerDelegate>)delegate;

    Swift

    convenience init!(uiWebView webview: Any!, url: URL!, syncTimeline sync_timeline: Any!, correlationTimestamp correlation: Any!, andDelegate delegate: SyncControllerDelegate!)

    Parameters

    webview

    a UIWebView object

    sync_timeline

    a CorrelatedClock object representing a synchronisation timeline

    correlation

    a pair of timestamps mapping the synchronisation timeline to the audio object timeline

    delegate

    an object conforming to the WebViewSyncControllerDelegate protocol

    Return Value

    initialised WebViewSyncController instance

    • Creates an instance of WebViewSyncController initialised with a web view and
    • a synchronisation timelime (the timeline to synchronise to). Resynchronisation of the
    • player occurs every ‘resync_interval’ seconds. *
    • - parameter: webview a UIWebView object
    • - parameter: sync_timeline a CorrelatedClock object representing a synchronisation timeline
    • - parameter: correlation a pair of timestamps mapping the synchronisation timeline to the audio object timeline
    • - parameter: resync_interval resynchronisation interval in seconds *
    • - returns: initialised WebViewSyncController instance

    Declaration

    Objective-C

    + (instancetype)syncControllerWithUIWebView:(UIWebView *)webview
                                            URL:(NSURL *)url
                                   SyncTimeline:(id)sync_timeline
                           CorrelationTimestamp:(id)correlation
                                AndSyncInterval:(NSTimeInterval)resync_interval;

    Swift

    convenience init!(uiWebView webview: Any!, url: URL!, syncTimeline sync_timeline: Any!, correlationTimestamp correlation: Any!, andSyncInterval resync_interval: TimeInterval)

    Parameters

    webview

    a UIWebView object

    sync_timeline

    a CorrelatedClock object representing a synchronisation timeline

    correlation

    a pair of timestamps mapping the synchronisation timeline to the audio object timeline

    resync_interval

    resynchronisation interval in seconds

    Return Value

    initialised WebViewSyncController instance

    • Creates an instance of WebViewSyncController initialised with a web view and
    • a synchronisation timelime (the timeline to synchronise to). Resynchronisation of the
    • player occurs every ‘resync_interval’ seconds. *
    • - parameter: webview a UIWebView object
    • - parameter: sync_timeline a CorrelatedClock object representing a synchronisation timeline
    • - parameter: correlation a pair of timestamps mapping the synchronisation timeline to the audio object timeline
    • - parameter: resync_interval resynchronisation interval in seconds
    • - parameter: delegate an object conforming to the WebViewSyncControllerDelegate protocol *
    • - returns: initialised WebViewSyncController instance

    Declaration

    Objective-C

    + (instancetype)syncControllerWithUIWebView:(UIWebView *)webview
                                            URL:(NSURL *)url
                                   SyncTimeline:(id)sync_timeline
                           CorrelationTimestamp:(id)correlation
                                   SyncInterval:(NSTimeInterval)resync_interval
                                    AndDelegate:
                                        (id<SyncControllerDelegate>)delegate;

    Swift

    convenience init!(uiWebView webview: Any!, url: URL!, syncTimeline sync_timeline: Any!, correlationTimestamp correlation: Any!, syncInterval resync_interval: TimeInterval, andDelegate delegate: SyncControllerDelegate!)

    Parameters

    webview

    a UIWebView object

    sync_timeline

    a CorrelatedClock object representing a synchronisation timeline

    correlation

    a pair of timestamps mapping the synchronisation timeline to the audio object timeline

    resync_interval

    resynchronisation interval in seconds

    delegate

    an object conforming to the WebViewSyncControllerDelegate protocol

    Return Value

    initialised WebViewSyncController instance

  • Start the synchronisation process.

    Declaration

    Objective-C

    - (void)start;

    Swift

    func start()
  • Stop the synchronisation process.

    Declaration

    Objective-C

    - (void)stop;

    Swift

    func stop()