Skip to content

Commit

Permalink
disable native controls for better firefox mobile compatibility (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
thijstriemstra committed Jan 18, 2016
1 parent effebe8 commit 55d9a3e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 2 deletions.
6 changes: 6 additions & 0 deletions examples/animated-gif.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
#myVideo {
background-color: #6EF55F;
}
/* make sure the custom controls are always visible because
the plugin hides and replace the video.js native mobile
controls */
.vjs-using-native-controls .vjs-control-bar {
display: flex !important;
}
</style>
</head>
<body>
Expand Down
6 changes: 6 additions & 0 deletions examples/audio-video.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
#myVideo {
background-color: #E8E884;
}
/* make sure the custom controls are always visible because
the plugin hides and replace the video.js native mobile
controls */
.vjs-using-native-controls .vjs-control-bar {
display: flex !important;
}
</style>
</head>
<body>
Expand Down
6 changes: 6 additions & 0 deletions examples/image-only.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
#myImage {
background-color: #6B2DA8;
}
/* make sure the custom controls are always visible because
the plugin hides and replace the video.js native mobile
controls */
.vjs-using-native-controls .vjs-control-bar {
display: flex !important;
}
</style>
</head>
<body>
Expand Down
10 changes: 8 additions & 2 deletions examples/video-only.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@
<style>
/* place fullscreen control on right side of the player */
.video-js .vjs-control.vjs-fullscreen-control {
position: absolute;
right: 0;
position: absolute;
right: 0;
}
/* change player background color */
#myVideo {
background-color: #47AFD1;
}
/* make sure the custom controls are always visible because
the plugin hides and replace the video.js native mobile
controls */
.vjs-using-native-controls .vjs-control-bar {
display: flex !important;
}
</style>
</head>
<body>
Expand Down
11 changes: 11 additions & 0 deletions src/js/videojs.record.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,17 @@
// XXX: below are customizations copied from videojs.wavesurfer that
// tweak the video.js UI...
this.player().bigPlayButton.hide();

// the native controls don't work for this UI so disable
// them no matter what
if (this.player().usingNativeControls_ === true)
{
if (this.player().tech_.el_ !== undefined)
{
this.player().tech_.el_.controls = false;
}
}

if (this.player().options_.controls)
{
// progress control isn't used by this plugin
Expand Down

0 comments on commit 55d9a3e

Please sign in to comment.