samvera_hls 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/samvera_hls/version.rb +1 -1
- data/vendor/assets/flash/mediaelement-flash-audio-ogg.swf +0 -0
- data/vendor/assets/flash/mediaelement-flash-audio.swf +0 -0
- data/vendor/assets/flash/mediaelement-flash-video-hls.swf +0 -0
- data/vendor/assets/flash/mediaelement-flash-video-mdash.swf +0 -0
- data/vendor/assets/flash/mediaelement-flash-video.swf +0 -0
- data/vendor/assets/images/mejs-controls.png +0 -0
- data/vendor/assets/images/mejs-controls.svg +1 -0
- data/vendor/assets/images/playlist-controls.svg +52 -0
- data/vendor/assets/javascripts/lang/ca.js +89 -0
- data/vendor/assets/javascripts/lang/cs.js +90 -0
- data/vendor/assets/javascripts/lang/de.js +90 -0
- data/vendor/assets/javascripts/lang/es.js +90 -0
- data/vendor/assets/javascripts/lang/fa.js +90 -0
- data/vendor/assets/javascripts/lang/fr.js +91 -0
- data/vendor/assets/javascripts/lang/hr.js +87 -0
- data/vendor/assets/javascripts/lang/hu.js +90 -0
- data/vendor/assets/javascripts/lang/it.js +90 -0
- data/vendor/assets/javascripts/lang/ja.js +90 -0
- data/vendor/assets/javascripts/lang/ko.js +90 -0
- data/vendor/assets/javascripts/lang/nl.js +91 -0
- data/vendor/assets/javascripts/lang/pl.js +90 -0
- data/vendor/assets/javascripts/lang/pt.js +92 -0
- data/vendor/assets/javascripts/lang/ro.js +90 -0
- data/vendor/assets/javascripts/lang/ru.js +90 -0
- data/vendor/assets/javascripts/lang/sk.js +90 -0
- data/vendor/assets/javascripts/lang/sv.js +89 -0
- data/vendor/assets/javascripts/lang/uk.js +89 -0
- data/vendor/assets/javascripts/lang/zh-cn.js +90 -0
- data/vendor/assets/javascripts/lang/zh.js +91 -0
- data/vendor/assets/javascripts/mediaelement-and-player.js +8497 -0
- data/vendor/assets/javascripts/playlist-i18n.js +149 -0
- data/vendor/assets/javascripts/playlist.js +348 -0
- data/vendor/assets/javascripts/renderers/dailymotion.js +415 -0
- data/vendor/assets/javascripts/renderers/dailymotion.min.js +12 -0
- data/vendor/assets/javascripts/renderers/facebook.js +361 -0
- data/vendor/assets/javascripts/renderers/facebook.min.js +12 -0
- data/vendor/assets/javascripts/renderers/soundcloud.js +306 -0
- data/vendor/assets/javascripts/renderers/soundcloud.min.js +12 -0
- data/vendor/assets/javascripts/renderers/twitch.js +374 -0
- data/vendor/assets/javascripts/renderers/twitch.min.js +12 -0
- data/vendor/assets/javascripts/renderers/vimeo.js +411 -0
- data/vendor/assets/javascripts/renderers/vimeo.min.js +12 -0
- data/vendor/assets/stylesheets/mediaelementplayer-legacy.css.erb +774 -0
- data/vendor/assets/stylesheets/mediaelementplayer.css.erb +774 -0
- data/vendor/assets/stylesheets/playlist.css.erb +229 -0
- metadata +46 -1
@@ -0,0 +1,411 @@
|
|
1
|
+
/*!
|
2
|
+
* MediaElement.js
|
3
|
+
* http://www.mediaelementjs.com/
|
4
|
+
*
|
5
|
+
* Wrapper that mimics native HTML5 MediaElement (audio and video)
|
6
|
+
* using a variety of technologies (pure JavaScript, Flash, iframe)
|
7
|
+
*
|
8
|
+
* Copyright 2010-2017, John Dyer (http://j.hn/)
|
9
|
+
* License: MIT
|
10
|
+
*
|
11
|
+
*/(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
12
|
+
'use strict';
|
13
|
+
|
14
|
+
var VimeoApi = {
|
15
|
+
|
16
|
+
promise: null,
|
17
|
+
|
18
|
+
load: function load(settings) {
|
19
|
+
|
20
|
+
if (typeof Vimeo !== 'undefined') {
|
21
|
+
VimeoApi._createPlayer(settings);
|
22
|
+
} else {
|
23
|
+
VimeoApi.promise = VimeoApi.promise || mejs.Utils.loadScript('https://player.vimeo.com/api/player.js');
|
24
|
+
VimeoApi.promise.then(function () {
|
25
|
+
VimeoApi._createPlayer(settings);
|
26
|
+
});
|
27
|
+
}
|
28
|
+
},
|
29
|
+
|
30
|
+
_createPlayer: function _createPlayer(settings) {
|
31
|
+
var player = new Vimeo.Player(settings.iframe);
|
32
|
+
window['__ready__' + settings.id](player);
|
33
|
+
},
|
34
|
+
|
35
|
+
getVimeoId: function getVimeoId(url) {
|
36
|
+
if (url === undefined || url === null) {
|
37
|
+
return null;
|
38
|
+
}
|
39
|
+
|
40
|
+
var parts = url.split('?');
|
41
|
+
url = parts[0];
|
42
|
+
return parseInt(url.substring(url.lastIndexOf('/') + 1), 10);
|
43
|
+
}
|
44
|
+
};
|
45
|
+
|
46
|
+
var vimeoIframeRenderer = {
|
47
|
+
|
48
|
+
name: 'vimeo_iframe',
|
49
|
+
options: {
|
50
|
+
prefix: 'vimeo_iframe'
|
51
|
+
},
|
52
|
+
|
53
|
+
canPlayType: function canPlayType(type) {
|
54
|
+
return ~['video/vimeo', 'video/x-vimeo'].indexOf(type.toLowerCase());
|
55
|
+
},
|
56
|
+
|
57
|
+
create: function create(mediaElement, options, mediaFiles) {
|
58
|
+
var apiStack = [],
|
59
|
+
vimeo = {},
|
60
|
+
readyState = 4;
|
61
|
+
|
62
|
+
var paused = true,
|
63
|
+
volume = 1,
|
64
|
+
oldVolume = volume,
|
65
|
+
currentTime = 0,
|
66
|
+
bufferedTime = 0,
|
67
|
+
ended = false,
|
68
|
+
duration = 0,
|
69
|
+
vimeoPlayer = null,
|
70
|
+
url = '';
|
71
|
+
|
72
|
+
vimeo.options = options;
|
73
|
+
vimeo.id = mediaElement.id + '_' + options.prefix;
|
74
|
+
vimeo.mediaElement = mediaElement;
|
75
|
+
|
76
|
+
var errorHandler = function errorHandler(error) {
|
77
|
+
mediaElement.generateError('Code ' + error.name + ': ' + error.message, mediaFiles);
|
78
|
+
};
|
79
|
+
|
80
|
+
var props = mejs.html5media.properties,
|
81
|
+
assignGettersSetters = function assignGettersSetters(propName) {
|
82
|
+
|
83
|
+
var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
|
84
|
+
|
85
|
+
vimeo['get' + capName] = function () {
|
86
|
+
if (vimeoPlayer !== null) {
|
87
|
+
var value = null;
|
88
|
+
|
89
|
+
switch (propName) {
|
90
|
+
case 'currentTime':
|
91
|
+
return currentTime;
|
92
|
+
case 'duration':
|
93
|
+
return duration;
|
94
|
+
case 'volume':
|
95
|
+
return volume;
|
96
|
+
case 'muted':
|
97
|
+
return volume === 0;
|
98
|
+
case 'paused':
|
99
|
+
return paused;
|
100
|
+
case 'ended':
|
101
|
+
return ended;
|
102
|
+
case 'src':
|
103
|
+
vimeoPlayer.getVideoUrl().then(function (_url) {
|
104
|
+
url = _url;
|
105
|
+
}).catch(function (error) {
|
106
|
+
return errorHandler(error);
|
107
|
+
});
|
108
|
+
return url;
|
109
|
+
case 'buffered':
|
110
|
+
return {
|
111
|
+
start: function start() {
|
112
|
+
return 0;
|
113
|
+
},
|
114
|
+
end: function end() {
|
115
|
+
return bufferedTime * duration;
|
116
|
+
},
|
117
|
+
length: 1
|
118
|
+
};
|
119
|
+
case 'readyState':
|
120
|
+
return readyState;
|
121
|
+
}
|
122
|
+
return value;
|
123
|
+
} else {
|
124
|
+
return null;
|
125
|
+
}
|
126
|
+
};
|
127
|
+
|
128
|
+
vimeo['set' + capName] = function (value) {
|
129
|
+
if (vimeoPlayer !== null) {
|
130
|
+
switch (propName) {
|
131
|
+
case 'src':
|
132
|
+
var _url2 = typeof value === 'string' ? value : value[0].src,
|
133
|
+
videoId = VimeoApi.getVimeoId(_url2);
|
134
|
+
|
135
|
+
vimeoPlayer.loadVideo(videoId).then(function () {
|
136
|
+
if (mediaElement.originalNode.autoplay) {
|
137
|
+
vimeoPlayer.play();
|
138
|
+
}
|
139
|
+
}).catch(function (error) {
|
140
|
+
return errorHandler(error);
|
141
|
+
});
|
142
|
+
break;
|
143
|
+
case 'currentTime':
|
144
|
+
vimeoPlayer.setCurrentTime(value).then(function () {
|
145
|
+
currentTime = value;
|
146
|
+
setTimeout(function () {
|
147
|
+
var event = mejs.Utils.createEvent('timeupdate', vimeo);
|
148
|
+
mediaElement.dispatchEvent(event);
|
149
|
+
}, 50);
|
150
|
+
}).catch(function (error) {
|
151
|
+
return errorHandler(error);
|
152
|
+
});
|
153
|
+
break;
|
154
|
+
case 'volume':
|
155
|
+
vimeoPlayer.setVolume(value).then(function () {
|
156
|
+
volume = value;
|
157
|
+
oldVolume = volume;
|
158
|
+
setTimeout(function () {
|
159
|
+
var event = mejs.Utils.createEvent('volumechange', vimeo);
|
160
|
+
mediaElement.dispatchEvent(event);
|
161
|
+
}, 50);
|
162
|
+
}).catch(function (error) {
|
163
|
+
return errorHandler(error);
|
164
|
+
});
|
165
|
+
break;
|
166
|
+
case 'loop':
|
167
|
+
vimeoPlayer.setLoop(value).catch(function (error) {
|
168
|
+
return errorHandler(error);
|
169
|
+
});
|
170
|
+
break;
|
171
|
+
case 'muted':
|
172
|
+
if (value) {
|
173
|
+
vimeoPlayer.setVolume(0).then(function () {
|
174
|
+
volume = 0;
|
175
|
+
setTimeout(function () {
|
176
|
+
var event = mejs.Utils.createEvent('volumechange', vimeo);
|
177
|
+
mediaElement.dispatchEvent(event);
|
178
|
+
}, 50);
|
179
|
+
}).catch(function (error) {
|
180
|
+
return errorHandler(error);
|
181
|
+
});
|
182
|
+
} else {
|
183
|
+
vimeoPlayer.setVolume(oldVolume).then(function () {
|
184
|
+
volume = oldVolume;
|
185
|
+
setTimeout(function () {
|
186
|
+
var event = mejs.Utils.createEvent('volumechange', vimeo);
|
187
|
+
mediaElement.dispatchEvent(event);
|
188
|
+
}, 50);
|
189
|
+
}).catch(function (error) {
|
190
|
+
return errorHandler(error);
|
191
|
+
});
|
192
|
+
}
|
193
|
+
break;
|
194
|
+
case 'readyState':
|
195
|
+
var event = mejs.Utils.createEvent('canplay', vimeo);
|
196
|
+
mediaElement.dispatchEvent(event);
|
197
|
+
break;
|
198
|
+
default:
|
199
|
+
|
200
|
+
break;
|
201
|
+
}
|
202
|
+
} else {
|
203
|
+
apiStack.push({ type: 'set', propName: propName, value: value });
|
204
|
+
}
|
205
|
+
};
|
206
|
+
};
|
207
|
+
|
208
|
+
for (var i = 0, total = props.length; i < total; i++) {
|
209
|
+
assignGettersSetters(props[i]);
|
210
|
+
}
|
211
|
+
|
212
|
+
var methods = mejs.html5media.methods,
|
213
|
+
assignMethods = function assignMethods(methodName) {
|
214
|
+
vimeo[methodName] = function () {
|
215
|
+
if (vimeoPlayer !== null) {
|
216
|
+
switch (methodName) {
|
217
|
+
case 'play':
|
218
|
+
paused = false;
|
219
|
+
return vimeoPlayer.play();
|
220
|
+
case 'pause':
|
221
|
+
paused = true;
|
222
|
+
return vimeoPlayer.pause();
|
223
|
+
case 'load':
|
224
|
+
return null;
|
225
|
+
}
|
226
|
+
} else {
|
227
|
+
apiStack.push({ type: 'call', methodName: methodName });
|
228
|
+
}
|
229
|
+
};
|
230
|
+
};
|
231
|
+
|
232
|
+
for (var _i = 0, _total = methods.length; _i < _total; _i++) {
|
233
|
+
assignMethods(methods[_i]);
|
234
|
+
}
|
235
|
+
|
236
|
+
window['__ready__' + vimeo.id] = function (_vimeoPlayer) {
|
237
|
+
|
238
|
+
mediaElement.vimeoPlayer = vimeoPlayer = _vimeoPlayer;
|
239
|
+
|
240
|
+
if (apiStack.length) {
|
241
|
+
for (var _i2 = 0, _total2 = apiStack.length; _i2 < _total2; _i2++) {
|
242
|
+
var stackItem = apiStack[_i2];
|
243
|
+
|
244
|
+
if (stackItem.type === 'set') {
|
245
|
+
var propName = stackItem.propName,
|
246
|
+
capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
|
247
|
+
|
248
|
+
vimeo['set' + capName](stackItem.value);
|
249
|
+
} else if (stackItem.type === 'call') {
|
250
|
+
vimeo[stackItem.methodName]();
|
251
|
+
}
|
252
|
+
}
|
253
|
+
}
|
254
|
+
|
255
|
+
if (mediaElement.originalNode.muted) {
|
256
|
+
vimeoPlayer.setVolume(0);
|
257
|
+
volume = 0;
|
258
|
+
}
|
259
|
+
|
260
|
+
var vimeoIframe = document.getElementById(vimeo.id);
|
261
|
+
var events = void 0;
|
262
|
+
|
263
|
+
events = ['mouseover', 'mouseout'];
|
264
|
+
|
265
|
+
var assignEvents = function assignEvents(e) {
|
266
|
+
var event = mejs.Utils.createEvent(e.type, vimeo);
|
267
|
+
mediaElement.dispatchEvent(event);
|
268
|
+
};
|
269
|
+
|
270
|
+
for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
|
271
|
+
vimeoIframe.addEventListener(events[_i3], assignEvents, false);
|
272
|
+
}
|
273
|
+
|
274
|
+
vimeoPlayer.on('loaded', function () {
|
275
|
+
vimeoPlayer.getDuration().then(function (loadProgress) {
|
276
|
+
duration = loadProgress;
|
277
|
+
if (duration > 0) {
|
278
|
+
bufferedTime = duration * loadProgress;
|
279
|
+
if (mediaElement.originalNode.autoplay) {
|
280
|
+
paused = false;
|
281
|
+
ended = false;
|
282
|
+
var event = mejs.Utils.createEvent('play', vimeo);
|
283
|
+
mediaElement.dispatchEvent(event);
|
284
|
+
}
|
285
|
+
}
|
286
|
+
}).catch(function (error) {
|
287
|
+
errorHandler(error, vimeo);
|
288
|
+
});
|
289
|
+
});
|
290
|
+
vimeoPlayer.on('progress', function () {
|
291
|
+
vimeoPlayer.getDuration().then(function (loadProgress) {
|
292
|
+
duration = loadProgress;
|
293
|
+
|
294
|
+
if (duration > 0) {
|
295
|
+
bufferedTime = duration * loadProgress;
|
296
|
+
if (mediaElement.originalNode.autoplay) {
|
297
|
+
var initEvent = mejs.Utils.createEvent('play', vimeo);
|
298
|
+
mediaElement.dispatchEvent(initEvent);
|
299
|
+
|
300
|
+
var playingEvent = mejs.Utils.createEvent('playing', vimeo);
|
301
|
+
mediaElement.dispatchEvent(playingEvent);
|
302
|
+
}
|
303
|
+
}
|
304
|
+
|
305
|
+
var event = mejs.Utils.createEvent('progress', vimeo);
|
306
|
+
mediaElement.dispatchEvent(event);
|
307
|
+
}).catch(function (error) {
|
308
|
+
return errorHandler(error);
|
309
|
+
});
|
310
|
+
});
|
311
|
+
vimeoPlayer.on('timeupdate', function () {
|
312
|
+
vimeoPlayer.getCurrentTime().then(function (seconds) {
|
313
|
+
currentTime = seconds;
|
314
|
+
var event = mejs.Utils.createEvent('timeupdate', vimeo);
|
315
|
+
mediaElement.dispatchEvent(event);
|
316
|
+
}).catch(function (error) {
|
317
|
+
return errorHandler(error);
|
318
|
+
});
|
319
|
+
});
|
320
|
+
vimeoPlayer.on('play', function () {
|
321
|
+
paused = false;
|
322
|
+
ended = false;
|
323
|
+
var event = mejs.Utils.createEvent('play', vimeo);
|
324
|
+
mediaElement.dispatchEvent(event);
|
325
|
+
|
326
|
+
var playingEvent = mejs.Utils.createEvent('playing', vimeo);
|
327
|
+
mediaElement.dispatchEvent(playingEvent);
|
328
|
+
});
|
329
|
+
vimeoPlayer.on('pause', function () {
|
330
|
+
paused = true;
|
331
|
+
ended = false;
|
332
|
+
|
333
|
+
var event = mejs.Utils.createEvent('pause', vimeo);
|
334
|
+
mediaElement.dispatchEvent(event);
|
335
|
+
});
|
336
|
+
vimeoPlayer.on('ended', function () {
|
337
|
+
paused = false;
|
338
|
+
ended = true;
|
339
|
+
|
340
|
+
var event = mejs.Utils.createEvent('ended', vimeo);
|
341
|
+
mediaElement.dispatchEvent(event);
|
342
|
+
});
|
343
|
+
|
344
|
+
events = ['rendererready', 'loadedmetadata', 'loadeddata', 'canplay'];
|
345
|
+
|
346
|
+
for (var _i4 = 0, _total4 = events.length; _i4 < _total4; _i4++) {
|
347
|
+
var event = mejs.Utils.createEvent(events[_i4], vimeo);
|
348
|
+
mediaElement.dispatchEvent(event);
|
349
|
+
}
|
350
|
+
};
|
351
|
+
|
352
|
+
var height = mediaElement.originalNode.height,
|
353
|
+
width = mediaElement.originalNode.width,
|
354
|
+
vimeoContainer = document.createElement('iframe'),
|
355
|
+
standardUrl = 'https://player.vimeo.com/video/' + VimeoApi.getVimeoId(mediaFiles[0].src);
|
356
|
+
|
357
|
+
var queryArgs = ~mediaFiles[0].src.indexOf('?') ? '?' + mediaFiles[0].src.slice(mediaFiles[0].src.indexOf('?') + 1) : '';
|
358
|
+
if (queryArgs && mediaElement.originalNode.autoplay && queryArgs.indexOf('autoplay') === -1) {
|
359
|
+
queryArgs += '&autoplay=1';
|
360
|
+
}
|
361
|
+
if (queryArgs && mediaElement.originalNode.loop && queryArgs.indexOf('loop') === -1) {
|
362
|
+
queryArgs += '&loop=1';
|
363
|
+
}
|
364
|
+
|
365
|
+
vimeoContainer.setAttribute('id', vimeo.id);
|
366
|
+
vimeoContainer.setAttribute('width', width);
|
367
|
+
vimeoContainer.setAttribute('height', height);
|
368
|
+
vimeoContainer.setAttribute('frameBorder', '0');
|
369
|
+
vimeoContainer.setAttribute('src', '' + standardUrl + queryArgs);
|
370
|
+
vimeoContainer.setAttribute('webkitallowfullscreen', '');
|
371
|
+
vimeoContainer.setAttribute('mozallowfullscreen', '');
|
372
|
+
vimeoContainer.setAttribute('allowfullscreen', '');
|
373
|
+
|
374
|
+
mediaElement.originalNode.parentNode.insertBefore(vimeoContainer, mediaElement.originalNode);
|
375
|
+
mediaElement.originalNode.style.display = 'none';
|
376
|
+
|
377
|
+
VimeoApi.load({
|
378
|
+
iframe: vimeoContainer,
|
379
|
+
id: vimeo.id
|
380
|
+
});
|
381
|
+
|
382
|
+
vimeo.hide = function () {
|
383
|
+
vimeo.pause();
|
384
|
+
if (vimeoPlayer) {
|
385
|
+
vimeoContainer.style.display = 'none';
|
386
|
+
}
|
387
|
+
};
|
388
|
+
vimeo.setSize = function (width, height) {
|
389
|
+
vimeoContainer.setAttribute('width', width);
|
390
|
+
vimeoContainer.setAttribute('height', height);
|
391
|
+
};
|
392
|
+
vimeo.show = function () {
|
393
|
+
if (vimeoPlayer) {
|
394
|
+
vimeoContainer.style.display = '';
|
395
|
+
}
|
396
|
+
};
|
397
|
+
|
398
|
+
vimeo.destroy = function () {};
|
399
|
+
|
400
|
+
return vimeo;
|
401
|
+
}
|
402
|
+
};
|
403
|
+
|
404
|
+
mejs.Utils.typeChecks.push(function (url) {
|
405
|
+
return (/(\/\/player\.vimeo|vimeo\.com)/i.test(url) ? 'video/x-vimeo' : null
|
406
|
+
);
|
407
|
+
});
|
408
|
+
|
409
|
+
mejs.Renderers.add(vimeoIframeRenderer);
|
410
|
+
|
411
|
+
},{}]},{},[1]);
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/*!
|
2
|
+
* MediaElement.js
|
3
|
+
* http://www.mediaelementjs.com/
|
4
|
+
*
|
5
|
+
* Wrapper that mimics native HTML5 MediaElement (audio and video)
|
6
|
+
* using a variety of technologies (pure JavaScript, Flash, iframe)
|
7
|
+
*
|
8
|
+
* Copyright 2010-2017, John Dyer (http://j.hn/)
|
9
|
+
* License: MIT
|
10
|
+
*
|
11
|
+
*/
|
12
|
+
!function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return i(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){"use strict";var r={promise:null,load:function(e){"undefined"!=typeof Vimeo?r._createPlayer(e):(r.promise=r.promise||mejs.Utils.loadScript("https://player.vimeo.com/api/player.js"),r.promise.then(function(){r._createPlayer(e)}))},_createPlayer:function(e){var t=new Vimeo.Player(e.iframe);window["__ready__"+e.id](t)},getVimeoId:function(e){return void 0===e||null===e?null:(e=e.split("?")[0],parseInt(e.substring(e.lastIndexOf("/")+1),10))}},i={name:"vimeo_iframe",options:{prefix:"vimeo_iframe"},canPlayType:function(e){return~["video/vimeo","video/x-vimeo"].indexOf(e.toLowerCase())},create:function(e,t,n){var i=[],a={},o=!0,s=1,u=s,c=0,l=0,d=!1,f=0,p=null,m="";a.options=t,a.id=e.id+"_"+t.prefix,a.mediaElement=e;for(var v=function(t){e.generateError("Code "+t.name+": "+t.message,n)},h=mejs.html5media.properties,y=0,g=h.length;y<g;y++)!function(t){var n=""+t.substring(0,1).toUpperCase()+t.substring(1);a["get"+n]=function(){if(null!==p){switch(t){case"currentTime":return c;case"duration":return f;case"volume":return s;case"muted":return 0===s;case"paused":return o;case"ended":return d;case"src":return p.getVideoUrl().then(function(e){m=e}).catch(function(e){return v(e)}),m;case"buffered":return{start:function(){return 0},end:function(){return l*f},length:1};case"readyState":return 4}return null}return null},a["set"+n]=function(n){if(null!==p)switch(t){case"src":var o="string"==typeof n?n:n[0].src,l=r.getVimeoId(o);p.loadVideo(l).then(function(){e.originalNode.autoplay&&p.play()}).catch(function(e){return v(e)});break;case"currentTime":p.setCurrentTime(n).then(function(){c=n,setTimeout(function(){var t=mejs.Utils.createEvent("timeupdate",a);e.dispatchEvent(t)},50)}).catch(function(e){return v(e)});break;case"volume":p.setVolume(n).then(function(){u=s=n,setTimeout(function(){var t=mejs.Utils.createEvent("volumechange",a);e.dispatchEvent(t)},50)}).catch(function(e){return v(e)});break;case"loop":p.setLoop(n).catch(function(e){return v(e)});break;case"muted":n?p.setVolume(0).then(function(){s=0,setTimeout(function(){var t=mejs.Utils.createEvent("volumechange",a);e.dispatchEvent(t)},50)}).catch(function(e){return v(e)}):p.setVolume(u).then(function(){s=u,setTimeout(function(){var t=mejs.Utils.createEvent("volumechange",a);e.dispatchEvent(t)},50)}).catch(function(e){return v(e)});break;case"readyState":var d=mejs.Utils.createEvent("canplay",a);e.dispatchEvent(d)}else i.push({type:"set",propName:t,value:n})}}(h[y]);for(var E=mejs.html5media.methods,U=0,b=E.length;U<b;U++)!function(e){a[e]=function(){if(null!==p)switch(e){case"play":return o=!1,p.play();case"pause":return o=!0,p.pause();case"load":return null}else i.push({type:"call",methodName:e})}}(E[U]);window["__ready__"+a.id]=function(t){if(e.vimeoPlayer=p=t,i.length)for(var n=0,r=i.length;n<r;n++){var u=i[n];if("set"===u.type){var m=u.propName,h=""+m.substring(0,1).toUpperCase()+m.substring(1);a["set"+h](u.value)}else"call"===u.type&&a[u.methodName]()}e.originalNode.muted&&(p.setVolume(0),s=0);for(var y=document.getElementById(a.id),g=void 0,E=0,U=(g=["mouseover","mouseout"]).length;E<U;E++)y.addEventListener(g[E],function(t){var n=mejs.Utils.createEvent(t.type,a);e.dispatchEvent(n)},!1);p.on("loaded",function(){p.getDuration().then(function(t){if((f=t)>0&&(l=f*t,e.originalNode.autoplay)){o=!1,d=!1;var n=mejs.Utils.createEvent("play",a);e.dispatchEvent(n)}}).catch(function(e){v(e)})}),p.on("progress",function(){p.getDuration().then(function(t){if((f=t)>0&&(l=f*t,e.originalNode.autoplay)){var n=mejs.Utils.createEvent("play",a);e.dispatchEvent(n);var r=mejs.Utils.createEvent("playing",a);e.dispatchEvent(r)}var i=mejs.Utils.createEvent("progress",a);e.dispatchEvent(i)}).catch(function(e){return v(e)})}),p.on("timeupdate",function(){p.getCurrentTime().then(function(t){c=t;var n=mejs.Utils.createEvent("timeupdate",a);e.dispatchEvent(n)}).catch(function(e){return v(e)})}),p.on("play",function(){o=!1,d=!1;var t=mejs.Utils.createEvent("play",a);e.dispatchEvent(t);var n=mejs.Utils.createEvent("playing",a);e.dispatchEvent(n)}),p.on("pause",function(){o=!0,d=!1;var t=mejs.Utils.createEvent("pause",a);e.dispatchEvent(t)}),p.on("ended",function(){o=!1,d=!0;var t=mejs.Utils.createEvent("ended",a);e.dispatchEvent(t)});for(var b=0,j=(g=["rendererready","loadedmetadata","loadeddata","canplay"]).length;b<j;b++){var w=mejs.Utils.createEvent(g[b],a);e.dispatchEvent(w)}};var j=e.originalNode.height,w=e.originalNode.width,N=document.createElement("iframe"),_="https://player.vimeo.com/video/"+r.getVimeoId(n[0].src),x=~n[0].src.indexOf("?")?"?"+n[0].src.slice(n[0].src.indexOf("?")+1):"";return x&&e.originalNode.autoplay&&-1===x.indexOf("autoplay")&&(x+="&autoplay=1"),x&&e.originalNode.loop&&-1===x.indexOf("loop")&&(x+="&loop=1"),N.setAttribute("id",a.id),N.setAttribute("width",w),N.setAttribute("height",j),N.setAttribute("frameBorder","0"),N.setAttribute("src",""+_+x),N.setAttribute("webkitallowfullscreen",""),N.setAttribute("mozallowfullscreen",""),N.setAttribute("allowfullscreen",""),e.originalNode.parentNode.insertBefore(N,e.originalNode),e.originalNode.style.display="none",r.load({iframe:N,id:a.id}),a.hide=function(){a.pause(),p&&(N.style.display="none")},a.setSize=function(e,t){N.setAttribute("width",e),N.setAttribute("height",t)},a.show=function(){p&&(N.style.display="")},a.destroy=function(){},a}};mejs.Utils.typeChecks.push(function(e){return/(\/\/player\.vimeo|vimeo\.com)/i.test(e)?"video/x-vimeo":null}),mejs.Renderers.add(i)},{}]},{},[1]);
|