Version Description
- Updated the player to version 7.0.2.
Download this release
Release Info
Developer | naa986 |
Plugin | Easy Video Player |
Version | 1.1.5 |
Comparing to | |
See all releases |
Code changes from version 1.1.4 to 1.1.5
- easy-video-player.php +27 -19
- lib/embed.min.js +0 -1
- lib/flowplayer.js +9391 -2049
- lib/flowplayer.min.js +6 -3
- lib/flowplayer.swf +0 -0
- lib/flowplayerhls.swf +0 -0
- lib/skin/all-skins.css +0 -700
- lib/skin/functional.css +0 -232
- lib/skin/icons/flowplayer.eot +0 -0
- lib/skin/icons/flowplayer.svg +98 -0
- lib/skin/icons/flowplayer.ttf +0 -0
- lib/skin/icons/flowplayer.woff +0 -0
- lib/skin/icons/flowplayer.woff2 +0 -0
- lib/skin/img/black.png +0 -0
- lib/skin/img/black@x2.png +0 -0
- lib/skin/img/black_rtl.png +0 -0
- lib/skin/img/black_rtl@x2.png +0 -0
- lib/skin/img/flowplayer.png +0 -0
- lib/skin/img/flowplayer@2x.png +0 -0
- lib/skin/img/play_black.png +0 -0
- lib/skin/img/play_black@x2.png +0 -0
- lib/skin/img/play_black_rtl.png +0 -0
- lib/skin/img/play_black_rtl@x2.png +0 -0
- lib/skin/img/play_white.png +0 -0
- lib/skin/img/play_white@x2.png +0 -0
- lib/skin/img/play_white_rtl.png +0 -0
- lib/skin/img/play_white_rtl@x2.png +0 -0
- lib/skin/img/playful_black.png +0 -0
- lib/skin/img/playful_black@x2.png +0 -0
- lib/skin/img/playful_black_rtl.png +0 -0
- lib/skin/img/playful_black_rtl@x2.png +0 -0
- lib/skin/img/playful_white.png +0 -0
- lib/skin/img/playful_white@x2.png +0 -0
- lib/skin/img/playful_white_rtl.png +0 -0
- lib/skin/img/playful_white_rtl@x2.png +0 -0
- lib/skin/img/white.png +0 -0
- lib/skin/img/white@x2.png +0 -0
- lib/skin/img/white_rtl.png +0 -0
- lib/skin/img/white_rtl@x2.png +0 -0
- lib/skin/minimalist.css +0 -232
- lib/skin/playful.css +0 -236
- lib/skin/skin.css +1010 -0
- readme.txt +8 -3
easy-video-player.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Easy Video Player
|
4 |
-
Version: 1.1.
|
5 |
Plugin URI: http://noorsplugin.com/wordpress-video-plugin/
|
6 |
Author: naa986
|
7 |
Author URI: http://noorsplugin.com/
|
@@ -17,7 +17,7 @@ if (!class_exists('EASY_VIDEO_PLAYER')) {
|
|
17 |
|
18 |
class EASY_VIDEO_PLAYER {
|
19 |
|
20 |
-
var $plugin_version = '1.1.
|
21 |
|
22 |
function __construct() {
|
23 |
define('EASY_VIDEO_PLAYER_VERSION', $this->plugin_version);
|
@@ -26,7 +26,7 @@ if (!class_exists('EASY_VIDEO_PLAYER')) {
|
|
26 |
|
27 |
function plugin_includes() {
|
28 |
if (is_admin()) {
|
29 |
-
add_filter('plugin_action_links', array(
|
30 |
}
|
31 |
add_action('plugins_loaded', array($this, 'plugins_loaded_handler'));
|
32 |
add_action('wp_enqueue_scripts', 'easy_video_player_enqueue_scripts');
|
@@ -109,7 +109,7 @@ function easy_video_player_enqueue_scripts() {
|
|
109 |
}
|
110 |
wp_register_script('flowplayer-js', $plugin_url . '/lib/flowplayer.min.js');
|
111 |
wp_enqueue_script('flowplayer-js');
|
112 |
-
wp_register_style('flowplayer-css', $plugin_url . '/lib/skin/
|
113 |
wp_enqueue_style('flowplayer-css');
|
114 |
}
|
115 |
}
|
@@ -128,19 +128,19 @@ function easy_video_player_header() {
|
|
128 |
|
129 |
function evp_embed_video_handler($atts) {
|
130 |
extract(shortcode_atts(array(
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
//check if mediaelement template is specified
|
145 |
if($template=='mediaelement'){
|
146 |
$attr = array();
|
@@ -189,6 +189,7 @@ function evp_embed_video_handler($atts) {
|
|
189 |
else{
|
190 |
$muted = "";
|
191 |
}
|
|
|
192 |
$player = "fp" . uniqid();
|
193 |
$color = '';
|
194 |
if (!empty($poster)) {
|
@@ -200,10 +201,11 @@ function evp_embed_video_handler($atts) {
|
|
200 |
if (!empty($width)) {
|
201 |
$size_attr = "max-width: {$width}px;max-height: auto;";
|
202 |
}
|
|
|
203 |
$class_array = array('flowplayer', 'minimalist');
|
204 |
if(!empty($class)){
|
205 |
$shortcode_class_array = array_map('trim', explode(' ', $class));
|
206 |
-
$shortcode_class_array = array_filter( $shortcode_class_array, 'strlen' );
|
207 |
$shortcode_class_array = array_values($shortcode_class_array);
|
208 |
if(in_array("functional", $shortcode_class_array) || in_array("playful", $shortcode_class_array)){
|
209 |
$class_array = array_diff($class_array, array('minimalist'));
|
@@ -214,6 +216,12 @@ function evp_embed_video_handler($atts) {
|
|
214 |
}
|
215 |
|
216 |
$classes = implode(" ", $class_array);
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
$styles = <<<EOT
|
218 |
<style>
|
219 |
#$player {
|
@@ -224,7 +232,7 @@ function evp_embed_video_handler($atts) {
|
|
224 |
EOT;
|
225 |
|
226 |
$output = <<<EOT
|
227 |
-
<div id="$player" data-ratio="$ratio" class="{$
|
228 |
<video{$video_id}{$autoplay}{$loop}{$muted}>
|
229 |
<source type="video/mp4" src="$url"/>
|
230 |
</video>
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Easy Video Player
|
4 |
+
Version: 1.1.5
|
5 |
Plugin URI: http://noorsplugin.com/wordpress-video-plugin/
|
6 |
Author: naa986
|
7 |
Author URI: http://noorsplugin.com/
|
17 |
|
18 |
class EASY_VIDEO_PLAYER {
|
19 |
|
20 |
+
var $plugin_version = '1.1.5';
|
21 |
|
22 |
function __construct() {
|
23 |
define('EASY_VIDEO_PLAYER_VERSION', $this->plugin_version);
|
26 |
|
27 |
function plugin_includes() {
|
28 |
if (is_admin()) {
|
29 |
+
add_filter('plugin_action_links', array($this, 'easy_video_player_plugin_action_links'), 10, 2);
|
30 |
}
|
31 |
add_action('plugins_loaded', array($this, 'plugins_loaded_handler'));
|
32 |
add_action('wp_enqueue_scripts', 'easy_video_player_enqueue_scripts');
|
109 |
}
|
110 |
wp_register_script('flowplayer-js', $plugin_url . '/lib/flowplayer.min.js');
|
111 |
wp_enqueue_script('flowplayer-js');
|
112 |
+
wp_register_style('flowplayer-css', $plugin_url . '/lib/skin/skin.css');
|
113 |
wp_enqueue_style('flowplayer-css');
|
114 |
}
|
115 |
}
|
128 |
|
129 |
function evp_embed_video_handler($atts) {
|
130 |
extract(shortcode_atts(array(
|
131 |
+
'url' => '',
|
132 |
+
'width' => '',
|
133 |
+
'height' => '',
|
134 |
+
'ratio' => '0.417',
|
135 |
+
'autoplay' => 'false',
|
136 |
+
'poster' => '',
|
137 |
+
'loop' => '',
|
138 |
+
'muted' => '',
|
139 |
+
'preload' => 'metadata',
|
140 |
+
'video_id' => '',
|
141 |
+
'class' => '',
|
142 |
+
'template' => '',
|
143 |
+
), $atts));
|
144 |
//check if mediaelement template is specified
|
145 |
if($template=='mediaelement'){
|
146 |
$attr = array();
|
189 |
else{
|
190 |
$muted = "";
|
191 |
}
|
192 |
+
|
193 |
$player = "fp" . uniqid();
|
194 |
$color = '';
|
195 |
if (!empty($poster)) {
|
201 |
if (!empty($width)) {
|
202 |
$size_attr = "max-width: {$width}px;max-height: auto;";
|
203 |
}
|
204 |
+
/*
|
205 |
$class_array = array('flowplayer', 'minimalist');
|
206 |
if(!empty($class)){
|
207 |
$shortcode_class_array = array_map('trim', explode(' ', $class));
|
208 |
+
$shortcode_class_array = array_filter( $shortcode_class_array, 'strlen' ); //remove NULL, FALSE and Empty Strings (""), but leave values of 0 (zero)
|
209 |
$shortcode_class_array = array_values($shortcode_class_array);
|
210 |
if(in_array("functional", $shortcode_class_array) || in_array("playful", $shortcode_class_array)){
|
211 |
$class_array = array_diff($class_array, array('minimalist'));
|
216 |
}
|
217 |
|
218 |
$classes = implode(" ", $class_array);
|
219 |
+
*/
|
220 |
+
|
221 |
+
if(!empty($class)){
|
222 |
+
$class = " ".$class;
|
223 |
+
}
|
224 |
+
|
225 |
$styles = <<<EOT
|
226 |
<style>
|
227 |
#$player {
|
232 |
EOT;
|
233 |
|
234 |
$output = <<<EOT
|
235 |
+
<div id="$player" data-ratio="$ratio" class="flowplayer{$class}">
|
236 |
<video{$video_id}{$autoplay}{$loop}{$muted}>
|
237 |
<source type="video/mp4" src="$url"/>
|
238 |
</video>
|
lib/embed.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
!function(){function e(e,t,n){if(e)return n(e);if(window.fp5ecc[t])return window.fp5ecc[t].push(n);window.fp5ecc[t]=[n];var r=document.createElement("script");r.onload=r.onreadystatechange=function(){var e=r.readyState;if(void 0===e||/complete|loaded/.test(e))for(var n=window.fp5ecc[t],i=0;i<n.length;i++)n[i]()},r.async=!0,r.src=t,a.insertBefore(r,a.firstChild)}function t(e){if(!window.fp5ecssc[e]){window.fp5ecssc[e]=!0;var t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href=e,a.insertBefore(t,a.firstChild)}}for(var n,r=document.getElementsByTagName("script"),i=document.createElement("div"),o=0;o<r.length;o++)if(-1!==r[o].innerHTML.indexOf("<video")){n=r[o],n.parentNode.insertBefore(i,n),n.parentNode.removeChild(n);break}var a=document.getElementsByTagName("head")[0],c="//releases.flowplayer.org/5.5.0/commercial",f=n.getAttribute("data-library")||c+"/flowplayer.min.js",d=n.getAttribute("data-swf")||c+"/flowplayer.swf",s=n.getAttribute("data-skin")||c+"/skin/minimalist.css",l="//www.google-analytics.com/ga.js",u="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";window.fp5ecc=window.fp5ecc||{},window.fp5ecssc=window.fp5ecssc||{};var p="undefined"!=typeof jQuery?jQuery().jquery:"",w=p.split("."),m="undefined"!=typeof $&&jQuery!=$;e(Number(w[0])>=1&&Number(w[1])>=7,u,function(r){var o;!r&&m&&(o=jQuery.noConflict());var a=!r&&""!==p;e("undefined"!=typeof _gat,l,function(){e("undefined"!=typeof flowplayer,f,function(e){e||t(s),o=o||jQuery;var r=o(n),c=r.attr("src"),l=o(r.html().replace(/^[ \t\n\r]+/gm,"").replace(/[ \n\t\r]+$/gm,""));o(i).replaceWith(l),l.find(":not(video, source)").remove(),l.flowplayer({swf:d,e:1}),l.data("flowplayer").conf.embed={library:f,swf:d,script:c},a&&o.noConflict(!0)})})})}();
|
|
lib/flowplayer.js
CHANGED
@@ -1,2685 +1,10027 @@
|
|
1 |
/*!
|
2 |
|
3 |
-
Flowplayer
|
4 |
|
5 |
*/
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
var b = $.browser = {},
|
20 |
-
ua = navigator.userAgent.toLowerCase(),
|
21 |
-
match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
|
22 |
-
/(safari)[ \/]([\w.]+)/.exec(ua) ||
|
23 |
-
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
|
24 |
-
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
|
25 |
-
/(msie) ([\w.]+)/.exec(ua) ||
|
26 |
-
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || [];
|
27 |
-
|
28 |
-
if (match[1]) {
|
29 |
-
b[match[1]] = true;
|
30 |
-
b.version = match[2] || "0";
|
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 |
} else {
|
60 |
-
|
61 |
-
$(".flowplayer.is-error .fp-message").remove();
|
62 |
-
});
|
63 |
}
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
window.localStorage.flowplayerTestStorage = "test";
|
71 |
-
supportLocalStorage = true;
|
72 |
}
|
73 |
-
}
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
78 |
|
79 |
-
|
|
|
|
|
80 |
|
81 |
-
|
|
|
|
|
82 |
|
83 |
-
|
|
|
|
|
|
|
84 |
|
85 |
-
|
|
|
|
|
|
|
86 |
|
87 |
-
|
|
|
|
|
88 |
|
89 |
-
defaults: {
|
90 |
|
91 |
-
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
-
|
94 |
-
|
|
|
|
|
|
|
|
|
95 |
|
96 |
-
// first engine to try
|
97 |
-
engine: 'html5',
|
98 |
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
-
|
102 |
-
|
|
|
|
|
|
|
|
|
103 |
|
104 |
-
|
105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
-
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
|
|
111 |
|
112 |
-
|
|
|
|
|
113 |
|
114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
|
116 |
-
|
|
|
|
|
117 |
|
118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
-
|
|
|
|
|
123 |
|
124 |
-
|
125 |
-
|
|
|
|
|
126 |
|
127 |
-
|
128 |
-
|
|
|
|
|
|
|
129 |
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
|
|
|
|
136 |
|
137 |
-
// player exceptions
|
138 |
-
'Unsupported video',
|
139 |
-
'Skin not found',
|
140 |
-
'SWF file not found',
|
141 |
-
'Subtitles not found',
|
142 |
-
'Invalid RTMP URL',
|
143 |
-
'Unsupported video format. Try installing Adobe Flash.'
|
144 |
-
],
|
145 |
-
errorUrls: ['','','','','','','','','','',
|
146 |
-
'http://get.adobe.com/flashplayer/'
|
147 |
-
],
|
148 |
-
playlist: [],
|
149 |
-
|
150 |
-
hlsFix: isSafari && safariVersion < 8
|
151 |
|
152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
-
|
|
|
|
|
|
|
155 |
|
156 |
-
// keep track of players
|
157 |
-
var playerCount = 1;
|
158 |
-
|
159 |
-
// jQuery plugin
|
160 |
-
$.fn.flowplayer = function(opts, callback) {
|
161 |
-
|
162 |
-
if (typeof opts == 'string') opts = { swf: opts }
|
163 |
-
if ($.isFunction(opts)) { callback = opts; opts = {} }
|
164 |
-
|
165 |
-
return !opts && this.data("flowplayer") || this.each(function() {
|
166 |
-
|
167 |
-
// private variables
|
168 |
-
var root = $(this).addClass("is-loading"),
|
169 |
-
conf = $.extend({}, flowplayer.defaults, flowplayer.conf, opts, root.data()),
|
170 |
-
videoTag = $("video", root).addClass("fp-engine").removeAttr("controls"),
|
171 |
-
urlResolver = videoTag.length ? new URLResolver(videoTag) : null,
|
172 |
-
storage = {},
|
173 |
-
lastSeekPosition,
|
174 |
-
engine;
|
175 |
-
|
176 |
-
if (conf.playlist.length) { // Create initial video tag if called without
|
177 |
-
var preload = conf.preload || videoTag.attr('preload'), placeHolder;
|
178 |
-
if (videoTag.length) videoTag.replaceWith(placeHolder = $('<p />'));
|
179 |
-
videoTag = $('<video />').addClass('fp-engine');
|
180 |
-
placeHolder ? placeHolder.replaceWith(videoTag) : root.prepend(videoTag);
|
181 |
-
if (flowplayer.support.video) videoTag.attr('preload', preload);
|
182 |
-
if (typeof conf.playlist[0] === 'string') videoTag.attr('src', conf.playlist[0]);
|
183 |
-
else {
|
184 |
-
$.each(conf.playlist[0], function(i, plObj) {
|
185 |
-
for (var type in plObj) {
|
186 |
-
if (plObj.hasOwnProperty(type)) {
|
187 |
-
videoTag.append($('<source />').attr({type: 'video/' + type, src: plObj[type]}));
|
188 |
-
}
|
189 |
-
}
|
190 |
-
});
|
191 |
-
}
|
192 |
-
urlResolver = new URLResolver(videoTag);
|
193 |
|
194 |
-
|
|
|
|
|
195 |
|
196 |
-
|
197 |
-
|
198 |
-
|
|
|
|
|
199 |
|
200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
|
202 |
-
|
203 |
-
storage = supportLocalStorage ? window.localStorage : storage;
|
204 |
-
} catch(e) {}
|
205 |
|
206 |
-
|
207 |
-
|
|
|
208 |
|
209 |
-
|
|
|
|
|
210 |
|
211 |
-
|
212 |
-
|
|
|
213 |
|
214 |
-
|
215 |
-
|
216 |
-
currentSpeed: 1,
|
217 |
-
volumeLevel: typeof conf.volume === "undefined" ? storage.volume * 1 : conf.volume,
|
218 |
-
video: {},
|
219 |
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
ready: false,
|
228 |
-
splash: false,
|
229 |
-
rtl: isRTL,
|
230 |
|
231 |
-
|
232 |
-
|
|
|
|
|
233 |
|
234 |
-
|
235 |
|
236 |
-
|
237 |
-
|
238 |
-
|
|
|
239 |
|
240 |
-
|
241 |
-
|
242 |
-
|
|
|
243 |
|
244 |
-
|
245 |
-
|
|
|
246 |
|
247 |
-
|
248 |
-
if ($.isFunction(video)) callback = video;
|
249 |
-
if (callback) root.one("ready", callback);
|
250 |
-
} else {
|
251 |
-
api.loading = false;
|
252 |
-
}
|
253 |
-
}
|
254 |
|
255 |
-
return api;
|
256 |
-
},
|
257 |
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
},
|
265 |
|
266 |
-
resume: function() {
|
267 |
|
268 |
-
|
269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
|
271 |
-
|
272 |
-
if (api.finished) {
|
273 |
-
api.trigger("resume", [api]);
|
274 |
-
api.finished = false;
|
275 |
-
}
|
276 |
-
}
|
277 |
|
278 |
-
|
279 |
-
|
|
|
|
|
280 |
|
281 |
-
|
282 |
-
return api.ready ? api.paused ? api.resume() : api.pause() : api.load();
|
283 |
-
},
|
284 |
|
285 |
-
|
286 |
-
|
287 |
-
seek(true) -> 10% forward
|
288 |
-
seek(false) -> 10% backward
|
289 |
-
*/
|
290 |
-
seek: function(time, callback) {
|
291 |
-
if (api.ready && !api.live) {
|
292 |
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
if (
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
api.seeking = false;
|
305 |
-
root.toggleClass("is-seeking", api.seeking); // remove loading indicator
|
306 |
-
}
|
307 |
}
|
308 |
-
return
|
309 |
-
|
|
|
|
|
|
|
|
|
|
|
310 |
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
*/
|
318 |
-
seekTo: function(position, fn) {
|
319 |
-
var time = position === undefined ? lastSeekPosition : api.video.duration * 0.1 * position;
|
320 |
-
return api.seek(time, fn);
|
321 |
-
},
|
322 |
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
storage.volume = !isNaN(storage.volume) ? storage.volume : conf.volume; // make sure storage has volume
|
327 |
-
api.volume(flag ? 0 : storage.volume, true);
|
328 |
-
api.trigger("mute", flag);
|
329 |
-
return api;
|
330 |
-
},
|
331 |
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
if (!skipStore) storage.volume = level;
|
336 |
-
engine.volume(level);
|
337 |
-
}
|
338 |
|
339 |
-
|
340 |
-
|
|
|
341 |
|
342 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
|
344 |
-
|
|
|
|
|
345 |
|
346 |
-
|
347 |
-
if (typeof val == "boolean") {
|
348 |
-
val = conf.speeds[$.inArray(api.currentSpeed, conf.speeds) + (val ? 1 : -1)] || api.currentSpeed;
|
349 |
-
}
|
350 |
|
351 |
-
|
352 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
353 |
}
|
|
|
354 |
|
355 |
-
|
356 |
-
},
|
357 |
|
|
|
|
|
358 |
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
|
|
365 |
}
|
366 |
-
return api;
|
367 |
-
},
|
368 |
|
369 |
-
|
370 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
371 |
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
api.stop();
|
377 |
-
}
|
378 |
-
}
|
379 |
-
return api;
|
380 |
-
},
|
381 |
|
382 |
-
|
383 |
-
if (flag === undefined) flag = !api.disabled;
|
384 |
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
}
|
389 |
-
return api;
|
390 |
-
}
|
391 |
-
|
392 |
-
};
|
393 |
|
394 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
395 |
|
|
|
|
|
396 |
|
397 |
-
|
398 |
-
$.each(['bind', 'one', 'unbind'], function(i, key) {
|
399 |
-
api[key] = function(type, fn) {
|
400 |
-
root[key](type, fn);
|
401 |
-
return api;
|
402 |
-
};
|
403 |
-
});
|
404 |
|
405 |
-
|
406 |
-
root.trigger(event, [api, arg]);
|
407 |
-
return api;
|
408 |
-
};
|
409 |
|
|
|
410 |
|
411 |
-
|
412 |
-
if (!root.data('flowplayer')) { // Only bind once
|
413 |
-
root.bind("boot", function() {
|
414 |
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
|
|
|
|
|
|
419 |
});
|
420 |
|
421 |
-
//
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
if (conf.live || root.hasClass('is-live')) {
|
430 |
-
api.live = conf.live = true;
|
431 |
-
root.addClass('is-live');
|
432 |
-
}
|
433 |
|
434 |
-
//
|
435 |
-
|
436 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
});
|
438 |
|
439 |
-
// 1. use the configured engine
|
440 |
-
engine = flowplayer.engine[conf.engine];
|
441 |
-
if (engine) engine = engine(api, root);
|
442 |
-
|
443 |
-
if (engine.pick(urlResolver.initialSources)) {
|
444 |
-
api.engine = conf.engine;
|
445 |
-
|
446 |
-
// 2. failed -> try another
|
447 |
-
} else {
|
448 |
-
$.each(flowplayer.engine, function(name, impl) {
|
449 |
-
if (name != conf.engine) {
|
450 |
-
engine = this(api, root);
|
451 |
-
if (engine.pick(urlResolver.initialSources)) {
|
452 |
-
api.engine = name;
|
453 |
-
return false;
|
454 |
-
}
|
455 |
-
}
|
456 |
-
});
|
457 |
-
}
|
458 |
|
459 |
-
|
460 |
-
|
|
|
461 |
|
462 |
-
|
463 |
-
if (!api.engine) return api.trigger("error", { code: flowplayer.support.flashVideo ? 5 : 10 });
|
464 |
|
465 |
-
|
466 |
-
|
|
|
|
|
467 |
|
468 |
-
|
469 |
-
if (conf.disabled) api.disable();
|
470 |
|
471 |
-
|
472 |
-
|
473 |
|
474 |
-
|
475 |
-
|
|
|
|
|
476 |
|
|
|
477 |
|
478 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
479 |
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
var api = $(this).data("flowplayer");
|
484 |
-
if (api.conf.splash) api.unload();
|
485 |
-
});
|
486 |
-
}
|
487 |
|
488 |
-
|
489 |
-
root.addClass("is-loading");
|
490 |
-
api.loading = true;
|
491 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
492 |
|
493 |
-
|
494 |
-
|
495 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
496 |
|
497 |
-
|
498 |
-
root.removeClass("is-loading");
|
499 |
-
api.loading = false;
|
500 |
-
}
|
501 |
|
502 |
-
|
503 |
-
else notLoading();
|
504 |
|
505 |
-
|
506 |
-
if (api.muted) api.mute(true);
|
507 |
-
else api.volume(api.volumeLevel);
|
508 |
|
509 |
-
|
|
|
510 |
|
511 |
-
var hlsFix = api.conf.hlsFix && /mpegurl/i.exec(video.type);
|
512 |
-
root.toggleClass('hls-fix', !!hlsFix);
|
513 |
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
518 |
|
|
|
519 |
|
520 |
-
|
521 |
-
var is_ready = e.type == "ready";
|
522 |
-
root.toggleClass("is-splash", !is_ready).toggleClass("is-ready", is_ready);
|
523 |
-
api.ready = is_ready;
|
524 |
-
api.splash = !is_ready;
|
525 |
|
|
|
|
|
|
|
526 |
|
527 |
-
|
528 |
-
|
529 |
|
|
|
|
|
|
|
530 |
|
531 |
-
|
532 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
533 |
|
534 |
-
|
535 |
-
api.volumeLevel = Math.round(level * 100) / 100;
|
536 |
-
if (!api.muted) storage.volume = level;
|
537 |
-
else if (level) api.mute(false);
|
538 |
|
|
|
|
|
|
|
|
|
539 |
|
540 |
-
|
541 |
-
|
542 |
-
root.toggleClass("is-seeking", api.seeking);
|
543 |
|
544 |
-
|
|
|
545 |
|
546 |
-
|
547 |
-
|
|
|
|
|
|
|
|
|
|
|
548 |
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
if (video) {
|
553 |
-
api.paused = !video.duration || !conf.autoplay && (conf.preload != 'none');
|
554 |
-
}
|
555 |
-
}
|
556 |
|
557 |
-
|
558 |
-
api.playing = !api.paused;
|
559 |
|
560 |
-
|
561 |
-
root.toggleClass("is-paused", api.paused).toggleClass("is-playing", api.playing);
|
562 |
|
563 |
-
// sanity check
|
564 |
-
if (!api.load.ed) api.pause();
|
565 |
|
566 |
-
|
567 |
-
|
|
|
|
|
|
|
568 |
|
569 |
-
}).bind("error", function() {
|
570 |
-
videoTag.remove();
|
571 |
-
});
|
572 |
-
}
|
573 |
|
574 |
-
// boot
|
575 |
-
root.trigger("boot", [api, root]).data("flowplayer", api);
|
576 |
|
577 |
-
|
|
|
|
|
578 |
|
579 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
580 |
|
581 |
-
|
|
|
582 |
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
|
|
|
|
|
|
|
|
590 |
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
IS_IE = browser.msie || /Trident\/7/.test(UA),
|
596 |
-
IS_IPAD = /iPad|MeeGo/.test(UA) && !/CriOS/.test(UA),
|
597 |
-
IS_IPAD_CHROME = /iPad/.test(UA) && /CriOS/.test(UA),
|
598 |
-
IS_IPHONE = /iP(hone|od)/i.test(UA) && !/iPad/.test(UA),
|
599 |
-
IS_ANDROID = /Android/.test(UA) && !/Firefox/.test(UA),
|
600 |
-
IS_ANDROID_FIREFOX = /Android/.test(UA) && /Firefox/.test(UA),
|
601 |
-
IS_SILK = /Silk/.test(UA),
|
602 |
-
IS_WP = /IEMobile/.test(UA),
|
603 |
-
WP_VER = IS_WP ? parseFloat(/Windows\ Phone\ (\d+\.\d+)/.exec(UA)[1], 10) : 0,
|
604 |
-
IE_MOBILE_VER = IS_WP ? parseFloat(/IEMobile\/(\d+\.\d+)/.exec(UA)[1], 10) : 0,
|
605 |
-
IPAD_VER = IS_IPAD ? parseIpadVersion(UA) : 0,
|
606 |
-
ANDROID_VER = IS_ANDROID ? parseFloat(/Android\ (\d\.\d)/.exec(UA)[1], 10) : 0;
|
607 |
-
$.extend(s, {
|
608 |
-
subtitles: !!video.addTextTrack,
|
609 |
-
fullscreen: typeof document.webkitCancelFullScreen == 'function' && !/Mac OS X 10_5.+Version\/5\.0\.\d Safari/.test(UA) ||
|
610 |
-
document.mozFullScreenEnabled ||
|
611 |
-
typeof document.exitFullscreen == 'function' ||
|
612 |
-
typeof document.msExitFullscreen == 'function',
|
613 |
-
inlineBlock: !(IS_IE && browser.version < 8),
|
614 |
-
touch: ('ontouchstart' in window),
|
615 |
-
dataload: !IS_IPAD && !IS_IPHONE && !IS_WP,
|
616 |
-
zeropreload: !IS_IE && !IS_ANDROID, // IE supports only preload=metadata
|
617 |
-
volume: !IS_IPAD && !IS_ANDROID && !IS_IPHONE && !IS_SILK && !IS_IPAD_CHROME,
|
618 |
-
cachedVideoTag: !IS_IPAD && !IS_IPHONE && !IS_IPAD_CHROME && !IS_WP,
|
619 |
-
firstframe: !IS_IPHONE && !IS_IPAD && !IS_ANDROID && !IS_SILK && !IS_IPAD_CHROME && !IS_WP && !IS_ANDROID_FIREFOX,
|
620 |
-
inlineVideo: !IS_IPHONE && (!IS_WP || (WP_VER >= 8.1 && IE_MOBILE_VER >= 11)) && (!IS_ANDROID || ANDROID_VER >= 3),
|
621 |
-
hlsDuration: !IS_ANDROID && (!browser.safari || IS_IPAD || IS_IPHONE || IS_IPAD_CHROME),
|
622 |
-
seekable: !IS_IPAD && !IS_IPAD_CHROME
|
623 |
-
});
|
624 |
|
625 |
-
//
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
|
|
631 |
|
632 |
-
|
633 |
-
if (ver.length && !ver[0]) ver = ver.slice(1);
|
634 |
|
635 |
-
|
636 |
-
|
|
|
|
|
637 |
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
s.video && video.canPlayType('video/mp4');
|
642 |
-
} catch (e) {
|
643 |
-
s.video = false;
|
644 |
-
}
|
645 |
|
646 |
-
|
647 |
-
|
648 |
-
|
|
|
|
|
649 |
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
})
|
|
|
|
|
654 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
655 |
|
|
|
656 |
|
657 |
-
|
658 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
659 |
|
660 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
661 |
|
662 |
-
|
663 |
-
|
664 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
665 |
|
666 |
-
|
667 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
668 |
|
669 |
-
|
670 |
-
|
|
|
671 |
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
|
|
679 |
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
};
|
684 |
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
});
|
689 |
|
690 |
-
|
691 |
-
$.each(opts, function(key, value) {
|
692 |
-
tag += '<param name="' + key + '" value="'+ value +'"/>';
|
693 |
-
});
|
694 |
|
695 |
-
|
|
|
|
|
|
|
696 |
|
697 |
-
|
698 |
-
|
|
|
699 |
|
|
|
|
|
|
|
700 |
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
__flash_savedUnloadHandler = __flash_unloadHandler = function() {};
|
705 |
-
});
|
706 |
-
}
|
707 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
708 |
|
709 |
-
|
|
|
|
|
|
|
|
|
|
|
710 |
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
716 |
|
717 |
-
|
718 |
|
719 |
-
|
720 |
-
//
|
721 |
-
|
722 |
-
if (VENDOR == "webkit" || IS_SAFARI) {
|
723 |
-
var flashvars = $("object param[name='flashvars']", root),
|
724 |
-
flashprops = (flashvars.attr("value") || '').split("&");
|
725 |
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
flashprops[i] = "url=" + player.video.url;
|
730 |
-
flashvars.attr({value: flashprops.join("&")});
|
731 |
-
return false;
|
732 |
-
}
|
733 |
-
});
|
734 |
}
|
|
|
735 |
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
var fs = player.isFullscreen,
|
745 |
-
truefs = fs && FS_SUPPORT,
|
746 |
-
ie7 = !flowplayer.support.inlineBlock,
|
747 |
-
screenW = fs ? (truefs ? screen.width : win.width()) : origW,
|
748 |
-
screenH = fs ? (truefs ? screen.height : win.height()) : origH,
|
749 |
-
|
750 |
-
// default values for fullscreen-exit without flashfit
|
751 |
-
hmargin = 0,
|
752 |
-
vmargin = 0,
|
753 |
-
objwidth = ie7 ? origW : '',
|
754 |
-
objheight = ie7 ? origH : '',
|
755 |
-
|
756 |
-
aspectratio, dataratio;
|
757 |
-
|
758 |
-
if (player.conf.flashfit || e.type === "fullscreen") {
|
759 |
-
aspectratio = player.video.width / player.video.height,
|
760 |
-
dataratio = player.video.height / player.video.width,
|
761 |
-
objheight = Math.max(dataratio * screenW),
|
762 |
-
objwidth = Math.max(aspectratio * screenH);
|
763 |
-
objheight = objheight > screenH ? objwidth * dataratio : objheight;
|
764 |
-
objheight = Math.min(Math.round(objheight), screenH);
|
765 |
-
objwidth = objwidth > screenW ? objheight * aspectratio : objwidth;
|
766 |
-
objwidth = Math.min(Math.round(objwidth), screenW);
|
767 |
-
vmargin = Math.max(Math.round((screenH + vmargin - objheight) / 2), 0);
|
768 |
-
hmargin = Math.max(Math.round((screenW + hmargin - objwidth) / 2), 0);
|
769 |
}
|
|
|
770 |
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
});
|
777 |
-
}
|
778 |
-
};
|
779 |
|
|
|
|
|
780 |
|
781 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
782 |
|
783 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
784 |
|
785 |
-
|
786 |
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
|
791 |
-
|
792 |
-
|
793 |
-
|
|
|
794 |
}
|
795 |
-
|
796 |
-
},
|
797 |
|
798 |
-
|
|
|
|
|
|
|
799 |
|
800 |
-
|
801 |
-
return url.replace(/&/g, '%26').replace(/&/g, '%26').replace(/=/g, '%3D');
|
802 |
-
}
|
803 |
|
804 |
-
|
805 |
-
url = escapeURL(video.src);
|
806 |
-
is_absolute = /^https?:/.test(url);
|
807 |
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
};
|
816 |
-
if (flowplayer.support.video &&
|
817 |
-
html5Tag.prop('autoplay') &&
|
818 |
-
hasSupportedSource(video.sources)) html5Tag.one('timeupdate', removeTag);
|
819 |
-
else removeTag();
|
820 |
|
821 |
-
|
822 |
-
|
823 |
|
824 |
-
|
825 |
-
api.__play(url);
|
826 |
|
827 |
-
|
|
|
828 |
|
829 |
-
|
830 |
-
|
831 |
|
832 |
-
|
833 |
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
};
|
839 |
-
if (root.data("origin")) {
|
840 |
-
opts.origin = root.data("origin");
|
841 |
-
}
|
842 |
|
843 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
844 |
|
845 |
-
|
846 |
-
$.each(['key', 'autoplay', 'preload', 'rtmp', 'subscribe', 'live', 'loop', 'debug', 'splash', 'poster', 'rtmpt'], function(i, key) {
|
847 |
-
if (conf.hasOwnProperty(key)) opts[key] = conf[key];
|
848 |
-
});
|
849 |
-
// bufferTime might be 0
|
850 |
-
if (conf.bufferTime !== undefined) opts.bufferTime = conf.bufferTime;
|
851 |
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
|
|
856 |
|
857 |
-
|
858 |
-
|
|
|
|
|
|
|
|
|
859 |
|
860 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
861 |
|
862 |
-
|
863 |
|
864 |
-
|
865 |
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
if (
|
870 |
-
return
|
871 |
}
|
872 |
-
|
873 |
-
}, 5000);
|
874 |
|
875 |
-
// detect disabled flash
|
876 |
-
setTimeout(function() {
|
877 |
-
if (typeof api.PercentLoaded === 'undefined') {
|
878 |
-
root.trigger('flashdisabled', [player]);
|
879 |
-
}
|
880 |
-
}, 1000);
|
881 |
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
if (!status) return;
|
886 |
|
887 |
-
|
|
|
|
|
888 |
|
889 |
-
|
890 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
891 |
|
892 |
-
|
893 |
-
video.buffered = true;
|
894 |
-
player.trigger("buffered");
|
895 |
-
}
|
896 |
|
897 |
-
}, 250);
|
898 |
|
899 |
-
|
900 |
-
|
|
|
|
|
901 |
|
902 |
-
|
|
|
903 |
|
904 |
-
|
905 |
|
906 |
-
|
907 |
|
908 |
-
// RTMP sends a lot of finish events in vain
|
909 |
-
// case "finish": if (conf.rtmp) return;
|
910 |
-
case "ready": arg = $.extend(video, arg); break;
|
911 |
-
case "click": event.flash = true; break;
|
912 |
-
case "keydown": event.which = arg; break;
|
913 |
-
case "seek": video.time = arg; break;
|
914 |
-
}
|
915 |
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
}
|
920 |
|
921 |
-
|
922 |
|
923 |
-
|
924 |
|
925 |
-
|
|
|
|
|
|
|
|
|
926 |
|
927 |
-
|
928 |
-
|
|
|
|
|
|
|
929 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
930 |
|
931 |
-
|
932 |
-
api && api.__unload && api.__unload();
|
933 |
-
delete $[callbackId];
|
934 |
-
$("object", root).remove();
|
935 |
-
api = 0;
|
936 |
-
player.unbind('ready', readyCallback).unbind('ready fullscreen fullscreen-exit', fullscreenCallback);
|
937 |
-
clearInterval(api.pollInterval);
|
938 |
-
}
|
939 |
|
940 |
-
|
|
|
|
|
|
|
|
|
941 |
|
942 |
-
|
943 |
|
944 |
-
|
945 |
-
|
946 |
-
|
|
|
|
|
947 |
|
948 |
-
if (name == 'seek' && player.video.time && !player.paused) {
|
949 |
-
player.trigger("beforeseek");
|
950 |
-
}
|
951 |
|
952 |
-
|
953 |
-
api["__" + name]();
|
954 |
|
955 |
-
|
956 |
-
|
957 |
-
|
|
|
|
|
|
|
|
|
|
|
958 |
|
959 |
-
|
960 |
-
} catch (e) {
|
961 |
-
if (typeof api["__" + name] === 'undefined') { //flash lost it's methods
|
962 |
-
return root.trigger('flashdisabled', [player]);
|
963 |
-
}
|
964 |
-
throw e;
|
965 |
-
}
|
966 |
-
};
|
967 |
|
968 |
-
|
969 |
|
970 |
-
|
|
|
971 |
|
972 |
-
|
|
|
|
|
|
|
|
|
973 |
|
|
|
974 |
|
975 |
-
|
976 |
|
977 |
-
|
978 |
-
var
|
979 |
|
980 |
-
// fired
|
981 |
-
ended: 'finish',
|
982 |
-
pause: 'pause',
|
983 |
-
play: 'resume',
|
984 |
-
progress: 'buffer',
|
985 |
-
timeupdate: 'progress',
|
986 |
-
volumechange: 'volume',
|
987 |
-
ratechange: 'speed',
|
988 |
-
//seeking: 'beforeseek',
|
989 |
-
seeked: 'seek',
|
990 |
-
// abort: 'resume',
|
991 |
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
996 |
|
997 |
-
|
998 |
-
// load: 0,
|
999 |
-
// emptied: 0,
|
1000 |
-
// empty: 0,
|
1001 |
-
error: 'error',
|
1002 |
-
dataunavailable: 'error'
|
1003 |
|
1004 |
-
|
1005 |
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
}
|
1010 |
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
|
|
|
|
|
|
|
|
1014 |
|
1015 |
-
function
|
1016 |
-
|
1017 |
-
|
1018 |
-
return !!VIDEO.canPlayType(type).replace("no", '');
|
1019 |
-
}
|
1020 |
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
}
|
1027 |
|
1028 |
-
var videoTagCache;
|
1029 |
-
var createVideoTag = function(video) {
|
1030 |
-
if (videoTagCache) {
|
1031 |
-
return videoTagCache.attr({type: getType(video.type), src: video.src});
|
1032 |
}
|
1033 |
-
return (videoTagCache = $("<video/>", {
|
1034 |
-
src: video.src,
|
1035 |
-
type: getType(video.type),
|
1036 |
-
'class': 'fp-engine',
|
1037 |
-
'autoplay': 'autoplay',
|
1038 |
-
preload: 'none',
|
1039 |
-
'x-webkit-airplay': 'allow'
|
1040 |
-
}));
|
1041 |
-
}
|
1042 |
|
1043 |
-
|
1044 |
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
conf = player.conf,
|
1049 |
-
self,
|
1050 |
-
timer,
|
1051 |
-
api,
|
1052 |
-
volumeLevel;
|
1053 |
|
1054 |
-
|
|
|
|
|
|
|
|
|
1055 |
|
1056 |
-
pick: function(sources) {
|
1057 |
-
if (support.video) {
|
1058 |
-
if (conf.videoTypePreference) {
|
1059 |
-
var mp4source = findFromSourcesByType(sources, conf.videoTypePreference);
|
1060 |
-
if (mp4source) return mp4source;
|
1061 |
-
}
|
1062 |
-
for (var i = 0, source; i < sources.length; i++) {
|
1063 |
-
if (canPlay(sources[i].type)) return sources[i];
|
1064 |
-
}
|
1065 |
-
}
|
1066 |
-
},
|
1067 |
|
1068 |
-
load: function(video) {
|
1069 |
|
1070 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1071 |
|
1072 |
-
|
|
|
|
|
1073 |
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
});
|
1079 |
-
}
|
1080 |
|
1081 |
-
|
|
|
|
|
1082 |
|
1083 |
-
|
|
|
|
|
1084 |
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1089 |
|
1090 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1091 |
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1098 |
|
1099 |
-
|
1100 |
-
if (player.video.src && video.src != player.video.src) {
|
1101 |
-
videoTag.attr("autoplay", "autoplay");
|
1102 |
-
api.src = video.src;
|
1103 |
|
1104 |
-
|
1105 |
-
|
|
|
|
|
|
|
1106 |
|
1107 |
-
|
1108 |
-
player.trigger("ready", video).trigger("pause").one("ready", function() {
|
1109 |
-
root.trigger("resume", [player]);
|
1110 |
-
});
|
1111 |
|
1112 |
-
|
1113 |
-
player.one("ready", function() {
|
1114 |
-
root.trigger("pause", [player]);
|
1115 |
-
});
|
1116 |
-
}
|
1117 |
-
}
|
1118 |
|
1119 |
-
|
1120 |
|
1121 |
-
|
|
|
|
|
|
|
1122 |
|
1123 |
-
|
1124 |
-
if (conf.preload != 'none' && video.type != "mpegurl" || !support.zeropreload || !support.dataload) api.load();
|
1125 |
-
if (conf.splash) api.load();
|
1126 |
-
},
|
1127 |
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
|
|
|
|
|
|
|
|
1131 |
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
|
|
|
|
|
|
|
|
|
|
1135 |
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1139 |
|
1140 |
-
|
1141 |
-
try {
|
1142 |
-
var pausedState = player.paused;
|
1143 |
-
api.currentTime = time;
|
1144 |
-
if (pausedState) api.pause();
|
1145 |
-
} catch (ignored) {}
|
1146 |
-
},
|
1147 |
|
1148 |
-
|
1149 |
-
|
1150 |
-
if (api) {
|
1151 |
-
api.volume = level;
|
1152 |
-
}
|
1153 |
-
},
|
1154 |
|
1155 |
-
|
1156 |
-
|
1157 |
-
if (!support.cachedVideoTag) videoTagCache = null;
|
1158 |
-
timer = clearInterval(timer);
|
1159 |
-
api = 0;
|
1160 |
-
}
|
1161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1162 |
};
|
1163 |
|
1164 |
-
function
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
}
|
1176 |
-
} catch (er) {
|
1177 |
-
// Most likely: https://bugzilla.mozilla.org/show_bug.cgi?id=208427
|
1178 |
-
}
|
1179 |
-
});
|
1180 |
|
1181 |
-
|
|
|
|
|
|
|
|
|
1182 |
|
1183 |
-
|
1184 |
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
}
|
1192 |
-
}, 10000);
|
1193 |
-
}
|
1194 |
|
1195 |
-
|
1196 |
|
1197 |
-
|
1198 |
-
|
1199 |
|
1200 |
-
|
|
|
1201 |
|
1202 |
-
|
|
|
1203 |
|
1204 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1205 |
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
|
1214 |
-
|
1215 |
-
arg.seekable = !conf.live && /mpegurl/i.test(video ? (video.type || '') : '') && api.duration || api.seekable && api.seekable.end(null);
|
1216 |
|
1217 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1218 |
|
1219 |
-
// buffer
|
1220 |
-
timer = timer || setInterval(function() {
|
1221 |
|
1222 |
-
|
1223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1224 |
|
1225 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1226 |
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1230 |
|
1231 |
-
} else if (!arg.buffered) {
|
1232 |
-
arg.buffered = true;
|
1233 |
-
player.trigger("buffer", e).trigger("buffered", e);
|
1234 |
-
clearInterval(timer);
|
1235 |
-
timer = 0;
|
1236 |
-
}
|
1237 |
-
}
|
1238 |
|
1239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1240 |
|
1241 |
-
|
1242 |
-
var durationChanged = function() {
|
1243 |
-
arg.duration = api.duration;
|
1244 |
-
try {
|
1245 |
-
arg.seekable = api.seekable && api.seekable.end(null);
|
1246 |
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
}
|
1254 |
|
1255 |
-
|
1256 |
|
1257 |
-
|
|
|
|
|
1258 |
|
1259 |
-
|
1260 |
|
1261 |
-
|
1262 |
-
arg = Math.max(api.currentTime, 0);
|
1263 |
-
break;
|
1264 |
|
1265 |
-
|
1266 |
-
return;
|
1267 |
-
}
|
1268 |
|
|
|
1269 |
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
|
|
1273 |
|
1274 |
-
|
1275 |
-
arg = round(api.volume);
|
1276 |
-
break;
|
1277 |
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
}
|
1285 |
-
|
|
|
|
|
1286 |
|
1287 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1288 |
|
1289 |
-
|
|
|
|
|
1290 |
|
1291 |
-
|
|
|
1292 |
|
1293 |
-
|
1294 |
|
1295 |
-
|
1296 |
-
|
|
|
|
|
1297 |
|
1298 |
-
function
|
|
|
|
|
|
|
1299 |
|
1300 |
-
|
1301 |
-
|
1302 |
-
suffix = src.split(TYPE_RE)[1];
|
1303 |
-
|
1304 |
-
type = /mpegurl/i.test(type) ? "mpegurl" : type.replace("video/", "");
|
1305 |
-
|
1306 |
-
return { src: src, suffix: suffix || type, type: type || suffix };
|
1307 |
-
}
|
1308 |
|
1309 |
-
|
1310 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1311 |
|
1312 |
-
|
1313 |
-
|
|
|
|
|
|
|
|
|
|
|
1314 |
|
1315 |
-
|
1316 |
-
|
1317 |
-
sources.push(parseSource($(this)));
|
1318 |
});
|
1319 |
|
1320 |
-
|
1321 |
|
1322 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1323 |
|
1324 |
-
|
1325 |
-
|
1326 |
|
1327 |
-
|
|
|
|
|
|
|
1328 |
|
1329 |
-
|
1330 |
-
var type, ret = $.extend({}, el);
|
1331 |
-
$.each(el, function(key, value) { type = key; });
|
1332 |
-
ret.type = type;
|
1333 |
-
ret.src = el[type];
|
1334 |
-
delete ret[type];
|
1335 |
-
return ret;
|
1336 |
-
})};
|
1337 |
|
1338 |
-
|
|
|
|
|
|
|
|
|
1339 |
|
1340 |
-
|
|
|
|
|
|
|
|
|
1341 |
|
1342 |
-
|
1343 |
-
if (source.type != 'flash') {
|
1344 |
-
video.sources.push({
|
1345 |
-
type: source.type,
|
1346 |
-
src: video.src.replace(TYPE_RE, "." + source.suffix + "$2")
|
1347 |
-
});
|
1348 |
-
}
|
1349 |
-
});
|
1350 |
-
}
|
1351 |
|
1352 |
-
|
1353 |
-
};
|
1354 |
|
1355 |
-
|
1356 |
-
|
|
|
|
|
|
|
|
|
1357 |
|
1358 |
-
//
|
1359 |
-
|
1360 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1361 |
|
1362 |
-
|
1363 |
-
$.throttle = function(fn, delay) {
|
1364 |
-
var locked;
|
1365 |
|
1366 |
-
|
1367 |
-
if (!locked) {
|
1368 |
-
fn.apply(this, arguments);
|
1369 |
-
locked = 1;
|
1370 |
-
setTimeout(function () { locked = 0; }, delay);
|
1371 |
-
}
|
1372 |
-
};
|
1373 |
-
};
|
1374 |
|
|
|
1375 |
|
1376 |
-
|
|
|
1377 |
|
1378 |
-
|
|
|
|
|
|
|
|
|
1379 |
|
1380 |
-
|
|
|
|
|
1381 |
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
/* exit from fullscreen can mess this up.*/
|
1402 |
-
// vertical = height > width;
|
1403 |
-
|
1404 |
-
size = vertical ? height : width;
|
1405 |
-
max = toDelta(maxValue);
|
1406 |
-
},
|
1407 |
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
api.value = value;
|
1412 |
-
}
|
1413 |
-
},
|
1414 |
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
pageX = e.originalEvent.touches[0].pageX;
|
1419 |
-
}
|
1420 |
-
var delta = vertical ? e.pageY - offset.top : pageX - offset.left;
|
1421 |
-
delta = Math.max(0, Math.min(max || size, delta));
|
1422 |
|
1423 |
-
|
1424 |
-
if (vertical) value = 1 - value;
|
1425 |
-
if (rtl) value = 1 - value;
|
1426 |
-
return move(value, 0, true);
|
1427 |
-
},
|
1428 |
|
1429 |
-
move = function(value, speed) {
|
1430 |
-
if (speed === undefined) { speed = 0; }
|
1431 |
-
if (value > 1) value = 1;
|
1432 |
|
1433 |
-
|
|
|
|
|
|
|
1434 |
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1443 |
|
1444 |
-
|
1445 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1446 |
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1450 |
|
1451 |
-
/* public */
|
1452 |
-
api = {
|
1453 |
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
|