Skip to content

Commit

Permalink
Merge pull request #999 from kaltura/playFromDvriOS
Browse files Browse the repository at this point in the history
Play from dvri os
  • Loading branch information
ElizaSapir committed Sep 29, 2014
2 parents 24b050e + 25c86ae commit a42dced
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
7 changes: 6 additions & 1 deletion modules/EmbedPlayer/resources/mw.EmbedPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2829,7 +2829,12 @@
},

isDVR: function() {
return this.kalturaPlayerMetaData[ 'dvrStatus' ];
if ( this.kalturaPlayerMetaData && this.kalturaPlayerMetaData[ 'dvrStatus' ] ) {
return this.kalturaPlayerMetaData[ 'dvrStatus' ];
}

return false;

},

disableComponentsHover: function(){
Expand Down
19 changes: 13 additions & 6 deletions modules/KalturaSupport/components/live/liveCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
setTimeout( function() {
if ( !_this.onAirStatus ) {
//if we already played once it means stream data was loaded. We can continue playing in "VOD" mode
if ( !_this.isNativeHLS() && !embedPlayer.firstPlay && _this.isDVR() ) {
if ( !embedPlayer.firstPlay && _this.isDVR() ) {
embedPlayer.triggerHelper( 'liveEventEnded' );
} else {
//remember last state
Expand Down Expand Up @@ -159,14 +159,21 @@
//once moving back to live, set live state again
embedPlayer.bindHelper( 'movingBackToLive', function() {
embedPlayer.setLive( true );
if ( _this.isNativeHLS() ) {
embedPlayer.setDuration( _this.dvrWindow );
}
} );
}
embedPlayer.setDuration( embedPlayer.getPlayerElement().duration );
//'ended' will be sent for js layer, update the player position for next replay
embedPlayer.bindHelper( 'ended', function() {
embedPlayer.getPlayerElement().seek( 0 );
} );

if ( !_this.isNativeHLS() ) {
embedPlayer.setDuration( embedPlayer.getPlayerElement().duration );
embedPlayer.bindHelper( 'ended', function() {
embedPlayer.getPlayerElement().seek( 0 );
});
}
}


});
},

Expand Down

0 comments on commit a42dced

Please sign in to comment.