HTML5 Player V3 Starting Sample
This sample produces web pages with several Ooyala features.
The HTML5 starting sample includes an embedded video, SEO features that pull the title and description from Backlot, an SEO feature that pulls metadata about the video from Backlot, related videos from Discovery, trending videos from Discovery and code that enables the page to be embedded in a Twitter feed.
The following shows a sample web page produced from the HTML5 starting sample:
The HTML5 starting sample is a multi-feature code sample that you can inspect and use as a template for building your own web pages:
- Server-side logic implemented in PHP. We use CodeIgniter as our PHP framework and a controller. In this sample, the controller takes care of making requests to get metadata, get Discovery recommendations, and return the results to the client-side view.
- Client-side views (web pages) that implement HTML5 features for a web and mobile view.
Where to Find the Code
All of the sample code is located in the application directory. To get 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 HTML5 Web Example 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 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.