Skip to content
Permalink
Browse files

Implement latency getter in default provider, mixin JW8-9325 (#3432)

  • Loading branch information...
johnBartos committed Jun 11, 2019
1 parent 29a43fa commit 66b74d670bee001410e66ba6e3aaba4b3e272af4
Showing with 9 additions and 0 deletions.
  1. +3 −0 src/js/providers/default.js
  2. +6 −0 src/js/providers/video-listener-mixin.js
@@ -78,6 +78,9 @@ const DefaultProvider = {
getBandwidthEstimate() {
return null;
},
getLiveLatency() {
return null;
},

// TODO: Deprecate provider.setControls(bool) with Flash. It's used to toggle the cursor when the swf is in focus.
setControls: noop,
@@ -54,6 +54,7 @@ const VideoListenerMixin = {
this.trigger(PROVIDER_FIRST_FRAME);
}


const timeEventObject = {
position,
duration,
@@ -70,6 +71,11 @@ const VideoListenerMixin = {
}
}

const latency = this.getLiveLatency();
if (latency !== null) {
timeEventObject.latency = latency;
}

// only emit time events when playing or seeking
if (this.state === STATE_PLAYING || this.seeking) {
this.trigger(MEDIA_TIME, timeEventObject);

0 comments on commit 66b74d6

Please sign in to comment.
You can’t perform that action at this time.