forked from lopezs/ableplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrowser.js
More file actions
82 lines (72 loc) · 2.11 KB
/
browser.js
File metadata and controls
82 lines (72 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
(function ($) {
AblePlayer.prototype.browserSupportsVolume = function() {
// ideally we could test for volume support
// However, that doesn't seem to be reliable
// http://stackoverflow.com/questions/12301435/html5-video-tag-volume-support
var userAgent, noVolume;
userAgent = navigator.userAgent.toLowerCase();
noVolume = /ipad|iphone|ipod|android|blackberry|windows ce|windows phone|webos|playbook/.exec(userAgent);
if (noVolume) {
if (noVolume[0] === 'android' && /firefox/.test(userAgent)) {
// Firefox on android DOES support changing the volume:
return true;
}
else {
return false;
}
}
else {
// as far as we know, this userAgent supports volume control
return true;
}
};
AblePlayer.prototype.isUserAgent = function(which) {
var userAgent;
userAgent = navigator.userAgent.toLowerCase();
if (this.debug) {
console.log('User agent: ' + userAgent);
}
if (userAgent.indexOf(which) !== -1) {
return true;
}
else {
return false;
}
};
AblePlayer.prototype.isIOS = function(version) {
// return true if this is IOS
// if version is provided check for a particular version
var userAgent, iOS;
userAgent = navigator.userAgent.toLowerCase();
iOS = /ipad|iphone|ipod/.exec(userAgent);
if (iOS) {
if (typeof version !== 'undefined') {
if (userAgent.indexOf('os ' + version) !== -1) {
// this is the target version of iOS
return true;
}
else {
return false;
}
}
else {
// no version was specified
return true;
}
}
else {
// this is not IOS
return false;
}
};
AblePlayer.prototype.nativeFullscreenSupported = function () {
if (this.player === 'jw') {
// JW player flash has problems with native fullscreen.
return false;
}
return document.fullscreenEnabled ||
document.webkitFullscreenEnabled ||
document.mozFullScreenEnabled ||
document.msFullscreenEnabled;
};
})(jQuery);