A MediaPlayer object encapsulates the behavior and functionality of a media player.
Instantiate a MediaPlayer
using the following:
var player = new AdobePSDK.MediaPlayer();
Create a MediaPlayerView
instance:
var view = new AdobePSDK.MediaPlayerView(container);
where container
is the target div
element that contains your HTMLMediaElement
.
For example, on an HTML page:
<div id="videoDiv">
<codeph>
<div id="video-controls">
... custom video controls
</div>
</codeph>
</div>
Call:
var view = new
<codeph>
AdobePSDK.MediaPlayerView
</codeph>(
document.getElementById("videoDiv"));
Attach your MediaPlayerView
instance to your MediaPlayer
instance:
player.view = view;
Attach the custom controls div
element to your MediaPlayer instance.
For example, in HTML:
<div id="videoDiv">
<div id="video-controls">
..... custom video controls
</div>
</div>
Call:
if (typeof player.getView() !== 'undefined') {
var view = player.view;
view.attachVideoControls(document.getElementById("video-controls"));
}
The MediaPlayer
instance is now available and properly configured to display video content on the device screen.