Skip to content

Commit

Permalink
hide most controls in live example
Browse files Browse the repository at this point in the history
  • Loading branch information
thijstriemstra committed Oct 13, 2015
1 parent 4ce54d8 commit 1feb813
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
7 changes: 7 additions & 0 deletions examples/live.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
controls: true,
width: 600,
height: 300,
controlBar: {
currentTimeDisplay: false,
timeDivider: false,
durationDisplay: false,
remainingTimeDisplay: false,
volumeMenuButton: false
},
plugins: {
wavesurfer: {
src: "live",
Expand Down
20 changes: 15 additions & 5 deletions videojs.wavesurfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,22 @@
this.player().controlBar.durationDisplay];
for (var element in uiElements)
{
uiElements[element].el().style.display = 'block';
uiElements[element].show();
// ignore when elements have been disabled by user
if (uiElements[element] !== undefined)
{
uiElements[element].el().style.display = 'block';
uiElements[element].show();
}
}
if (this.player().controlBar.remainingTimeDisplay !== undefined)
{
this.player().controlBar.remainingTimeDisplay.hide();
}
if (this.player().controlBar.timeDivider !== undefined)
{
this.player().controlBar.timeDivider.el().style.textAlign = 'center';
this.player().controlBar.timeDivider.el().style.width = '2em';
}
this.player().controlBar.remainingTimeDisplay.hide();
this.player().controlBar.timeDivider.el().style.textAlign = 'center';
this.player().controlBar.timeDivider.el().style.width = '2em';

// disable play button until waveform is ready
// (except when in live mode)
Expand Down

0 comments on commit 1feb813

Please sign in to comment.