I am writing a new app to deliver content to Samsung TV's I am using the app framework and the avplay player.
The content we are using is H.264 wrapped in Mpeg-Dash
I have followed the documentation provided below
I have a playerWrapper class provided below
var playerWrapper = {
player: null,
licenseServerURL : null,
token : null,
contentURL : null,
duration: 0,
};
var playCallBack = {
oncurrentplaytime : function(time) {
playerWrapper.setCurTime(time);
alert(window.debugStatement + 'current time: ' + time);
},
onresolutionchanged: function(width, height) { alert(window.debugStatement + 'resolution changed to width:' + width + ' height:' + height);},
onstreamcompleted: function() { alert(window.debugStatement + 'stream completed');},
onerror: function(error) {
console.log(JSON.stringify(error));
alert(window.debugStatement + 'player error: ' + error);
}
};
var bufferingCallBack = {
onbufferingstart: function() {
alert(window.debugStatement + 'buffering started');
playerWrapper.setDuration();
},
onbufferingprogress: function(percent) { alert(window.debugStatement + 'buffering percent: ' + percent); },
onbufferingcomplete: function() { alert(window.debugStatement + 'buffering complete');}
};
playerWrapper.setContentURL = function(url){
playerWrapper.contentURL = url + '|COMPONENT=HAS';
// playerWrapper.contentURL = url + '|COMPONENT=WMDRM';
};
playerWrapper.setLicenserURL = function(url){
playerWrapper.licenseServerURL = url;
playerWrapper.player.setPlayerProperty(4, playerWrapper.licenseServerURL, playerWrapper.licenseServerURL.length);
};
playerWrapper.setToken = function(token){
playerWrapper.token = token;
playerWrapper.player.setPlayerProperty(3, playerWrapper.token, playerWrapper.token.length);
};
playerWrapper.setCurTime = function(time){
alert(window.debugStatement + 'current time: ' +time);
};
playerWrapper.setWindow = function() {
playerWrapper.player.setDisplayRect({
top: 58,
left: 458,
width: 472,
height: 270
});
},
playerWrapper.configurePlayer = function(player){
alert(window.debugStatement + 'Setting AVPlayer ');
playerWrapper.player = player;
playerWrapper.player.init({
containerID: 'player_container',
bufferingCallback: bufferingCallBack,
playCallback: playCallBack,
displayRect: {
top: 0,
left: 0,
width: 1920,
height: 1080
},
autoRatio: true,
});
};
playerWrapper.getPlayerError = function(error){
alert(window.debugStatement + 'AVPlayer FETCH ERROR');
};
playerWrapper.setDuration = function() {
currentDuration = Player.AVPlayer.getDuration();
alert(window.debugStatement + 'current duration: ' + currentDuration);
playerWrapper.duration = convertTime(currentDuration);
};
playerWrapper.play = function(){
try{
playerWrapper.player.open(
playerWrapper.contentURL,
{
drm : {
type : "Playready",
company : 'Microsoft Corporation',
deviceID : '1'
}
});
playerWrapper.player.play(playerWrapper.playSuccess, playerWrapper.playError);
}catch(error){
alert(window.debugStatement + 'play error: ' + error);
}
};
playerWrapper.playSuccess = function(){
alert(window.debugStatement + 'success');
};
playerWrapper.playError = function(error){
alert(window.debugStatement + 'play error: ' + error);
},
playerWrapper.init = function(){
try{
webapis.avplay.getAVPlay(playerWrapper.configurePlayer, playerWrapper.getPlayerError);
if(typeof playerWrapper.player === 'undefined') throw 'player fetch failure';
return playerWrapper;
}catch(error){
alert(window.debugStatement + 'AVPlayer Initialisation ERROR: ' + error);
}
};
This class is initialised from the main app.js file which simply follows this workflow
- Call playerWrapper init
- sets the license url
- sets the content url
- sets the token
- calls play
It appears that when either using the PlayReady plugin or the SetPlayerProperty method as described in the docs the TV does not call out to the license server.
looking at the player specification I can see that Mpeg-Dash & H.264 are both supported.
My questions are
- what can I do to get around this issue?
- has anyone seen the documentation for this error as if I can get that at least I will have a starting point?