Skip to content

Commit

Permalink
Merge pull request #254 from jwplayer/bugfix/cast-misc
Browse files Browse the repository at this point in the history
Two Flash casting bugfixes [Delivers #86664424]
  • Loading branch information
jw-kaurand committed Feb 4, 2015
2 parents 889fc2a + 9b63f31 commit ad96bdf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ package com.longtailvideo.jwplayer.view.components {

public function ControlbarComponent(player:IPlayer) {
super(player, "controlbar");

animations = new Animations(this);
alpha = 0;
_instreamMode = false;
Expand Down Expand Up @@ -382,7 +383,6 @@ package com.longtailvideo.jwplayer.view.components {
return layout;
}


private static function removeButtonFromLayout(button:String, layout:String):String {
return layout.replace(button, "");
}
Expand Down Expand Up @@ -415,7 +415,10 @@ package com.longtailvideo.jwplayer.view.components {
setPositionAndDuration(evt.position, evt.duration);
if (isLive && evt.type == MediaEvent.JWPLAYER_MEDIA_TIME) {
if (!_instreamMode) {
setText(player.playlist.currentItem.title || "Live broadcast");
// In between items, the cast plugin sets duration to 0, this does not mean the video
// is a live broadcast
var backup:String = (_casting ? "" : "Live broadcast");
setText(player.playlist.currentItem.title || backup);
}
} else {
if (_timeSlider) {
Expand All @@ -429,7 +432,7 @@ package com.longtailvideo.jwplayer.view.components {
if (evt.bufferPercent > 0) {
var offsetPercent:Number = (evt.offset / _lastDur) * 100;
_timeSlider.setBuffer(evt.bufferPercent / (1-offsetPercent/100), offsetPercent);
}
}

_timeSlider.setDuration(_lastDur);
_timeSlider.live = isLive;
Expand Down
7 changes: 5 additions & 2 deletions src/js/html5/jwplayer.html5.instream.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@
// Keep track of the original player state
_oldpos = _video.currentTime;

if (_controller.checkBeforePlay() || _oldpos === 0) {
if (_model.getVideo().checkComplete()) {
// AKA postroll
_oldstate = _states.IDLE;
} else if (_controller.checkBeforePlay() || _oldpos === 0) {
// make sure video restarts after preroll
_oldpos = 0;
_oldstate = _states.PLAYING;
} else if (_api.jwGetState() === _states.IDLE || _model.getVideo().checkComplete()) {
} else if (_api.jwGetState() === _states.IDLE) {
_oldstate = _states.IDLE;
} else {
_oldstate = _states.PLAYING;
Expand Down

0 comments on commit ad96bdf

Please sign in to comment.