Skip to content

Commit 7f3fecd

Browse files
committed
Add support for data-allow-fullscreen
1 parent a235004 commit 7f3fecd

8 files changed

Lines changed: 34 additions & 12 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ The following attributes make all this possible:
261261

262262

263263
The following attributes are supported on the `<video>` element only:
264-
264+
265+
- **data-allow-fullscreen** - optional; if set to "false" the player will not include a fullscreen button
265266
- **data-youtube-id** - optional; 11-character YouTube ID, to play the YouTube video using *Able Player*.
266267
- **data-youtube-desc-id** - optional; 11-character YouTube ID of the described version of a video. See the section below on *YouTube Support* for additional information.
267268
- **height** - height of the video in pixels. If not provided will

build/ableplayer.dist.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@
178178
}
179179
}
180180

181+
if ($(media).data('allow-fullscreen') !== undefined && $(media).data('allow-fullscreen') === false) {
182+
this.allowFullScreen = false;
183+
}
184+
else {
185+
this.allowFullScreen = true;
186+
}
187+
181188
if ($(media).data('seek-interval') !== undefined && $(media).data('seek-interval') !== "") {
182189
var seekInterval = $(media).data('seek-interval');
183190
if (/^[1-9][0-9]*$/.test(seekInterval)) { // must be a whole number greater than 0
@@ -3411,7 +3418,7 @@
34113418
// controlLayout['br'].push('help');
34123419

34133420
// TODO: JW currently has a bug with fullscreen, anything that can be done about this?
3414-
if (this.mediaType === 'video' && this.player !== 'jw') {
3421+
if (this.mediaType === 'video' && this.allowFullScreen && this.player !== 'jw') {
34153422
controlLayout['br'].push('fullscreen');
34163423
}
34173424

build/ableplayer.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@
178178
}
179179
}
180180

181+
if ($(media).data('allow-fullscreen') !== undefined && $(media).data('allow-fullscreen') === false) {
182+
this.allowFullScreen = false;
183+
}
184+
else {
185+
this.allowFullScreen = true;
186+
}
187+
181188
if ($(media).data('seek-interval') !== undefined && $(media).data('seek-interval') !== "") {
182189
var seekInterval = $(media).data('seek-interval');
183190
if (/^[1-9][0-9]*$/.test(seekInterval)) { // must be a whole number greater than 0
@@ -3411,7 +3418,7 @@
34113418
// controlLayout['br'].push('help');
34123419

34133420
// TODO: JW currently has a bug with fullscreen, anything that can be done about this?
3414-
if (this.mediaType === 'video' && this.player !== 'jw') {
3421+
if (this.mediaType === 'video' && this.allowFullScreen && this.player !== 'jw') {
34153422
controlLayout['br'].push('fullscreen');
34163423
}
34173424

build/ableplayer.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/ableplayer.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ableplayer",
3-
"version": "2.3.30",
3+
"version": "2.3.31",
44
"description": "fully accessible HTML5 media player",
55
"homepage": "http://ableplayer.github.io/ableplayer",
66
"bugs": "https://github.com/ableplayer/ableplayer/issues",

scripts/ableplayer-base.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@
178178
}
179179
}
180180

181+
if ($(media).data('allow-fullscreen') !== undefined && $(media).data('allow-fullscreen') === false) {
182+
this.allowFullScreen = false;
183+
}
184+
else {
185+
this.allowFullScreen = true;
186+
}
187+
181188
if ($(media).data('seek-interval') !== undefined && $(media).data('seek-interval') !== "") {
182189
var seekInterval = $(media).data('seek-interval');
183190
if (/^[1-9][0-9]*$/.test(seekInterval)) { // must be a whole number greater than 0

scripts/buildplayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@
836836
// controlLayout['br'].push('help');
837837

838838
// TODO: JW currently has a bug with fullscreen, anything that can be done about this?
839-
if (this.mediaType === 'video' && this.player !== 'jw') {
839+
if (this.mediaType === 'video' && this.allowFullScreen && this.player !== 'jw') {
840840
controlLayout['br'].push('fullscreen');
841841
}
842842

0 commit comments

Comments
 (0)