Android SDK (Core)
Guides & Tutorials
6 min
the guides & tutorials section offers step by step instructions and practical examples for using the android sdk playback & entity management this section will give an quick overview on how to control playback and handle entity (camera) changes the playback data can be accessed via nwcore this example shows how to access the currenttime value of the playback by listening to the callback function in triggering an entity (camera) change the nwcore also provides a simple option to change the currently playing entity (camera) // set video entity expplayback switchactivevideotrackbyentityid(entityid string?) if you want to retrieve available entities first to provide the user a selection option, you can get them like this // get available video entities coresdk getvideoentities() > \[nwentity]? to get the current selected entity, this can be done like this // get current selected video entityid coresdk activevideoentityid > stateflow\<string> getting started with second screen sync 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 coresdk audiosyncmode = audiosyncmode library additionally, you need to set a directsyncid , so the correct sync query is used var directsyncid string = \<directsyncid> coresdk directsyncid = directsyncid 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 listener for callbacks coresdk initializesync(synclistener synclistener) after everything is initialized and ready to go, simply start the sync by calling // start a sync coresdk startsync() you can get the sync result by listening to the onsyncoffsetfound callback , which contains the new offset identified by the sync // called when an offset was found fun onsyncoffsetfound(newoffset double)