12

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

Samsung PlayReady docs

I have a playerWrapper class provided below

JSFiddle

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

  1. Call playerWrapper init
  2. sets the license url
  3. sets the content url
  4. sets the token
  5. 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.

Player Specifications

My questions are

  1. what can I do to get around this issue?
  2. has anyone seen the documentation for this error as if I can get that at least I will have a starting point?
Deviland
  • 3,324
  • 7
  • 32
  • 53
  • just as a point of clarification if I try this code with license server and token with some unencrypted content it works fine. – Deviland Jun 16 '15 at 14:31
  • Specifically which Samsung TVs as they don't all support DASH? – Andrew Jun 26 '15 at 06:28
  • Also do you have a sample of the DASH file? As the error reads like a video format error. – Andrew Jun 26 '15 at 06:34
  • The content was a problem initially but I am unable to get proven to work dash content through Samsungs' PlayReady plugin. In the emulator (which I know does not support PlayReady) does nothing as expected but the TV does even less when the app is synced onto it. – Deviland Jun 26 '15 at 09:51
  • Can you get the content to work in an alternate DASH/PlayReady player? Also do you know what settings are on the content when encrypted? If you send me a sample URL I will check it out for you – Andrew Jun 28 '15 at 22:32
  • Hi @Andrew the content works in another separate PlayReady/Dash player we have. the problem is that the TV does not seem to call the licenseserver when using the PlayReady plugin or setPlayerProperty – Deviland Jun 29 '15 at 09:20
  • Is this solved? I have a similar issue although I don't use AVPlay, but the other native player... http://stackoverflow.com/questions/40174746/samsung-smart-tv-streaming-mpeg-dash-with-playread – Dalibor Oct 21 '16 at 11:34

0 Answers0