-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…loses #1205
- Loading branch information
Showing
9 changed files
with
188 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
(function(){ | ||
var apiMap, specApi, browserApi, i; | ||
|
||
/** | ||
* Store the browser-specifc methods for the fullscreen API | ||
* @type {Object|undefined} | ||
* @private | ||
*/ | ||
vjs.browser.fullscreenAPI; | ||
|
||
// browser API methods | ||
// map approach from Screenful.js - https://github.com/sindresorhus/screenfull.js | ||
apiMap = [ | ||
// Spec: https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html | ||
[ | ||
'requestFullscreen', | ||
'exitFullscreen', | ||
'fullscreenElement', | ||
'fullscreenEnabled', | ||
'fullscreenchange', | ||
'fullscreenerror' | ||
], | ||
// WebKit | ||
[ | ||
'webkitRequestFullscreen', | ||
'webkitExitFullscreen', | ||
'webkitFullscreenElement', | ||
'webkitFullscreenEnabled', | ||
'webkitfullscreenchange', | ||
'webkitfullscreenerror' | ||
], | ||
// Old WebKit (Safari 5.1) | ||
[ | ||
'webkitRequestFullScreen', | ||
'webkitCancelFullScreen', | ||
'webkitCurrentFullScreenElement', | ||
'webkitCancelFullScreen', | ||
'webkitfullscreenchange', | ||
'webkitfullscreenerror' | ||
], | ||
// Mozilla | ||
[ | ||
'mozRequestFullScreen', | ||
'mozCancelFullScreen', | ||
'mozFullScreenElement', | ||
'mozFullScreenEnabled', | ||
'mozfullscreenchange', | ||
'mozfullscreenerror' | ||
], | ||
// Microsoft | ||
[ | ||
'msRequestFullscreen', | ||
'msExitFullscreen', | ||
'msFullscreenElement', | ||
'msFullscreenEnabled', | ||
'MSFullscreenChange', | ||
'MSFullscreenError' | ||
] | ||
]; | ||
|
||
specApi = apiMap[0]; | ||
|
||
// determine the supported set of functions | ||
for (i=0; i<apiMap.length; i++) { | ||
// check for exitFullscreen function | ||
if (apiMap[i][1] in document) { | ||
browserApi = apiMap[i]; | ||
break; | ||
} | ||
} | ||
|
||
// map the browser API names to the spec API names | ||
// or leave vjs.browser.fullscreenAPI undefined | ||
if (browserApi) { | ||
vjs.browser.fullscreenAPI = {}; | ||
|
||
for (i=0; i<browserApi.length; i++) { | ||
vjs.browser.fullscreenAPI[specApi[i]] = browserApi[i]; | ||
} | ||
} | ||
|
||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.