Cross Device Resume View

You can use the following code sample to work with Cross Device Resume.

The code sample includes multiple client web pages or views illustrating each feature and a seventh code sample that shows all the features working in combination. To implement each client page, you will need all the standard elements that you normally use such as your API Key, pcode, and so forth.

Where to Find the Code

To explore this code sample view in GitHub, go to: https://github.com/ooyala/code-samples/blob/master/application/views/Secure_XDR_GoogleIMA/cross_resume.php.

.

Cross Device Resume (XDR) Client Code

The cross_resume.php file code implements a client-side version of Ooyala Cross Device Resume (XDR) as a sample. We have implemented a simple version of XDR so you can see how it works. Cross-Device Resume, of course, is designed to work with our mobile SDKs and from the desktop or mobile device to an appropriate TV type. For more information about XDR, see “ "Player for Cross Device Resume."
Note: Before you work with any feature, including Ooyala Cross Device Resume (XDR), you need to make sure the feature is enabled. Contact your Customer Success Manager to set this up. If you do not have XDR enabled, you can make a request but the server will give you an empty response. You may not be able to quickly debug the empty response as there is no specific message indicating that you have not enabled the feature.  Make sure you have the feature enabled before you start.

How the XDR Sample Works

In implementing XDR for this sample, we limited the code to perform XDR from desktop to desktop for simplicity.  XDR supports start and resume across mobile devices, desktops,  and XTV enabled TVs. For more information about XDR, see “ Player for Cross Device Resume.

In this XDR client sample, we pass the playhead time from the PHP server to var playheadTime. We create the player with OO.Player.create () function and set the embedToken parameter and pass the playheadTime to the initialTime parameter.

Was this article helpful?