Implementing Custom Controls for Android
Learn how to configure the player with custom controls for Android playback.
Ooyala's Android SDK provides tools for overriding the default fullscreen and inline controls. The following steps explain how to run custom controls over the OoyalaPlayer.
The Ooyala Mobile SDK folder includes a directory named Default Controls. Copy
the following files from this folder to the project source folder:
Rename the following control files to create your code base for custom
fullscreen and inline controls.
- OptimizedOoyalaPlayerLayoutController.java (e.g. MyLayoutController.java)
- DefaultOoyalaPlayerInlineControls.java MyInlineControls.java)
Edit the base code to create your custom inline and fullscreen controls.
For more information about implementing custom controls see the Ooyala Mobile SDK for iOS API documentation. You can see an example of custom controls with our sample app repository:
Instantiate an OoyalaPlayerLayout in the project activity code
and add the new custom control files. This step is shown in the following
OoyalaPlayerLayout playerLayout = (OoyalaPlayerLayout) findViewById(R.id.ooyalaPlayer); MyLayoutController playerLayoutController = new MyLayoutController( playerLayout, PCODE, new PlayerDomain(DOMAIN)); player = playerLayoutController.getPlayer(); MyInlineControls ic = new MyInlineControls(player, playerLayout); playerLayoutController.setInlineControls(ic);
Your custom controls will now be used in the Ooyala Player. You can confirm this by adding/removing views from your custom controls or by adding logging.