Merge pull request #1075 from mimse/feature/handle_live_stream
Hide currentTime and progress
This commit is contained in:
commit
e2010bcd1a
10
src/js/controls.js
vendored
10
src/js/controls.js
vendored
@ -633,6 +633,16 @@ const controls = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If duration is the 2**32 (shaka), Infinity (HLS), DASH-IF (Number.MAX_SAFE_INTEGER || Number.MAX_VALUE) indicating live we hide the currentTime and progressbar.
|
||||||
|
// https://github.com/video-dev/hls.js/blob/5820d29d3c4c8a46e8b75f1e3afa3e68c1a9a2db/src/controller/buffer-controller.js#L415
|
||||||
|
// https://github.com/google/shaka-player/blob/4d889054631f4e1cf0fbd80ddd2b71887c02e232/lib/media/streaming_engine.js#L1062
|
||||||
|
// https://github.com/Dash-Industry-Forum/dash.js/blob/69859f51b969645b234666800d4cb596d89c602d/src/dash/models/DashManifestModel.js#L338
|
||||||
|
if (this.duration >= 2**32) {
|
||||||
|
toggleHidden(this.elements.display.currentTime, true);
|
||||||
|
toggleHidden(this.elements.progress, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Update ARIA values
|
// Update ARIA values
|
||||||
if (is.element(this.elements.inputs.seek)) {
|
if (is.element(this.elements.inputs.seek)) {
|
||||||
this.elements.inputs.seek.setAttribute('aria-valuemax', this.duration);
|
this.elements.inputs.seek.setAttribute('aria-valuemax', this.duration);
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
|
||||||
// Spacing
|
// Spacing
|
||||||
> .plyr__control,
|
> .plyr__control,
|
||||||
@ -22,7 +23,7 @@
|
|||||||
|
|
||||||
&:first-child,
|
&:first-child,
|
||||||
&:first-child + [data-plyr='pause'] {
|
&:first-child + [data-plyr='pause'] {
|
||||||
margin-left: 0;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user