Secure XDR Player V3 Sample
Secure XDR code sample can help you get started in creating a multi-feature playback experience with Ooyala Cross-Device Resume, Google IMA ads integration, and Ooyala Player Token authentication.
- Server-side logic implemented in PHP. We use CodeIgniter as our PHP framework and a controller. In this sample, the controller takes care of routing, handling requests, and sending parameters to each client-side view.
- Client-side views (web pages) that implement Player features including a simple player embed, Cross-Device Resume, Google IMA, Message Bus-based event handling, Ooyala Token Authentication, and all of these features used in combination. The views are additive: they progress from the simplest interaction to the final view, which contains all of the code for the features used in combination.
Where to Find the Code
All of the sample code is located in the application directory. To get to this code in our GitHub repository, use the URL: https://github.com/ooyala/code-samples/blob/master/application.
To work with this sample, you only need to focus on the code in these directories: assets, config, controllers, libraries, third_party, and views.
The following diagram shows the organization of the Secure XDR and Google IMA directories. You will see other directories. These are for another sample, so you can skip over them.
Installing the Sample Code
To install the Sample Code, you need to:
- Have your Customer Success Manager enable Ooyala Player Token, Google IMA, and Cross-Device Resume features, if you do not already have them.
- Have a web server running that can interpret PHP, like Apache or Nginx.
- Go to our GitHub repository. The URL is: https://github.com/ooyala/code-samples.
- Clone the GitHub code-samples repository in your server.
- Provide your local path in your browser URL. The path for the example would be "your_base_path/code-samples/index.php". So, if you are running this from your localhost, you will have a URL like "localhost/code-samples/index.php".
- To get more than the default welcome page, you need to modify the values in application/config/ooyala_config.php. There you will be asked for you API key, secret, embed code and some other stuff. For more information about this you can check our API keys and Partner Code documentation.
Use the Ooyala PHP Server SDK included with the sample in GitHub. If needed, you can also download the Ooyala PHP Server SDK from the Ooyala Support > Developers >Resources web page.