Skip to content

Commit

Permalink
fix(FEC-8684): IE11 live dash playback is stuck (#66)
Browse files Browse the repository at this point in the history
* fixing live on ie11

cannot assign videoElement.currentTime before loadedMetadata is fired

* flow fix

* fix unit tests according to the code fix

calling the loadPromise before checking the data
  • Loading branch information
odedhutzler authored Nov 19, 2018
1 parent 29309d7 commit c543921
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/dash-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,10 @@ export default class DashAdapter extends BaseMediaSourceAdapter {
* @public
*/
seekToLiveEdge(): void {
if (this._shaka) {
this._videoElement.currentTime = this._shaka.seekRange().end;
if (this._shaka && this._loadPromise) {
this._loadPromise.then(() => {
this._videoElement.currentTime = this._shaka.seekRange().end;
});
}
}

Expand Down
10 changes: 6 additions & 4 deletions test/src/dash-adapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -953,10 +953,12 @@ describe('DashAdapter: seekToLiveEdge', () => {
video.currentTime = dashInstance._shaka.seekRange().start;
const initialTimeShift = dashInstance._shaka.seekRange().end - video.currentTime;
dashInstance.seekToLiveEdge();
const timeShift = dashInstance._shaka.seekRange().end - video.currentTime;
timeShift.should.be.lessThan(3);
timeShift.should.be.lessThan(initialTimeShift);
done();
dashInstance._loadPromise.then(() => {
const timeShift = dashInstance._shaka.seekRange().end - video.currentTime;
timeShift.should.be.lessThan(3);
timeShift.should.be.lessThan(initialTimeShift);
done();
});
} catch (e) {
done(e);
}
Expand Down

0 comments on commit c543921

Please sign in to comment.