Guides & Tutorials
The Guides & Tutorials section offers step-by-step instructions and practical examples for using the iOS SDK.
The UI layer of a NativeWaves experience on Android and iOS is a web-based layer that changes dynamically, based on the configuration done in the NativeWaves Console and the type of event you are watching.
By default, the URL for the web layer is set by the app. You can set your own URL when initializing a new ExperienceViewController.
The communication with the web layer is done using a NwExp interface which calls and receives certain events. The interface is being described in the API Reference.
This section will give an quick overview on how to control playback and handle entity (camera) changes.
The playback data can be accessed via the NwPlaybackDelegate. This example shows how to access the position of the playback by listening to the callback function.
In addition to just the position, this callback also contains information about duration, if the playback has ended, if the playback has video content available, if the playback is playing at the live-edge and if the playback is playing at the synced position.
The NwCore also provides a simple option to change the currently playing entity (camera).
If you want to retrieve available entities first to provide the user a selection option, you can get them like this:
To get the current selected entity, this can be done like this:
To get started with the second-screen sync, the recommended option is to use the directSync mode and try it with some VOD content.
To enable the direct sync to e.g. sync against a VOD event, you need to set the AudioSyncMode to AudioSyncMode.LIBRARY:
Additionally, you need to set a directSyncId, so the correct sync query is used:
The directSyncId is created when sync information is extracted for VOD events. A common setup is to send the directSyncId as part of event information like the programId.
The next step is to initialize the sync and passing your optional delegate if you want to rececive sync callbacks:
After everything is initialized and ready to go, simply start the sync by calling:
You can get the sync result by listening to the synchronizationOffsetFound callback, which contains the new offset identified by the sync:
If you want to implement an individual player logic, you can replace our preshipped player with your own. To do so, you first need to add the customPlayerDelegate to the ExperiencePlaybackService:
You need to implement the NwCustomPlayerDelegate protocol to inject your player whenever it's requested by the ExperiencePlaybackService.
The custom player needs to implement the NwPlayer protocol in order to be compatible with our core engine.
If you want to use a particular CDN, the manifest needs to be configured properly right ahead. That being given, you need to set a expConfigBaseUrl which will be used to fetch the actual CDN config:
If you need to implement DRM handling, there are two ways to exchange credentials. Both ways presume that you implement the NwCustomPlayerDelegate and handle the async exchange function:
NwDrmCredentials
Option 1: With our preshipped player, you still need to implement the customPlayerFor method, but just return nil for the custom player.
Option 2: With your custom player used, everything stays the same as described in Custom player integration.