ravnur-player-public 3.4.4 → 3.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RavnurMediaPlayer.min.js +1 -1
- package/dist/cdn/RavnurMediaPlayer.min.js +1 -1
- package/package.json +10 -6
- package/.eslintignore +0 -7
- package/.eslintrc.js +0 -206
- package/.flowconfig +0 -3
- package/.vscode/extensions.json +0 -7
- package/.vscode/launch.json +0 -37
- package/.vscode/settings.json +0 -4
- package/README-Private.md +0 -54
- package/babel.config.js +0 -28
- package/bitbucket-pipelines.yml +0 -61
- package/cert.pem +0 -23
- package/demo/BaseM.mp4 +0 -0
- package/demo/HD.mp4 +0 -0
- package/demo/annotations.json +0 -50
- package/demo/annotations_ge.json +0 -50
- package/demo/base.mp3 +0 -0
- package/demo/cc_2125en.vtt +0 -4958
- package/demo/cc_en.vtt +0 -171
- package/demo/cc_ge.vtt +0 -178
- package/demo/chapters_en.vtt +0 -38
- package/demo/chapters_ge.vtt +0 -5
- package/demo/chapters_ge1.json +0 -23
- package/demo/hls/audio/stereo/en/128kbit.m3u8 +0 -912
- package/demo/hls/audio/stereo/none/128kbit.m3u8 +0 -912
- package/demo/hls/audio/surround/en/320kbit.m3u8 +0 -912
- package/demo/hls/playlist.m3u8 +0 -31
- package/demo/hls/video/10000kbit.m3u8 +0 -894
- package/demo/hls/video/1100kbit.m3u8 +0 -894
- package/demo/hls/video/1500kbit.m3u8 +0 -894
- package/demo/hls/video/250kbit.m3u8 +0 -894
- package/demo/hls/video/4000kbit.m3u8 +0 -894
- package/demo/hls/video/500kbit.m3u8 +0 -894
- package/demo/hls/video/6000kbit.m3u8 +0 -894
- package/demo/hls/video/800kbit.m3u8 +0 -894
- package/demo/hls.js +0 -5
- package/demo/hls.js.map +0 -1
- package/demo/hls.min.js +0 -2
- package/demo/hls.min.js.map +0 -1
- package/demo/playlist.m3u8 +0 -31
- package/demo/ravnur-flash-audio.swf +0 -0
- package/demo/ravnur-flash-video-hls.swf +0 -0
- package/demo/ravnur-flash-video.swf +0 -0
- package/demo/shaka/shaka-player.foo.debug.d.ts +0 -4532
- package/demo/shaka/shaka-player.foo.debug.externs.js +0 -3886
- package/demo/shaka/shaka-player.foo.debug.js +0 -1746
- package/demo/shaka/shaka-player.foo.debug.map +0 -8
- package/demo/shaka/wrapper.js +0 -7
- package/demo/test.html +0 -458
- package/jest.config.js +0 -4
- package/key.pem +0 -27
- package/lib/es5.js +0 -344
- package/lib/images/Spinner-small.gif +0 -0
- package/lib/images/close.png +0 -0
- package/lib/images/ic_check_box_black_24dp_1x.png +0 -0
- package/lib/images/ic_check_box_outline_blank_black_24dp_1x.png +0 -0
- package/lib/images/ic_chevron_left_white_24dp_1x.png +0 -0
- package/lib/images/ic_chevron_right_white_24dp_1x.png +0 -0
- package/lib/images/ic_closed_caption_white_24dp_1x.png +0 -0
- package/lib/images/ic_fast_forward_white_24dp_1x.png +0 -0
- package/lib/images/ic_fast_rewind_white_24dp_1x.png +0 -0
- package/lib/images/ic_fullscreen_exit_white_24dp_1x.png +0 -0
- package/lib/images/ic_fullscreen_white_24dp_1x.png +0 -0
- package/lib/images/ic_hd_white_24dp_1x.png +0 -0
- package/lib/images/ic_keyboard_arrow_left_black_24dp_1x.png +0 -0
- package/lib/images/ic_keyboard_arrow_right_black_24dp_1x.png +0 -0
- package/lib/images/ic_pause_white_24dp_1x.png +0 -0
- package/lib/images/ic_photo_white_24dp_1x.png +0 -0
- package/lib/images/ic_play_arrow_white_24dp_1x.png +0 -0
- package/lib/images/ic_refresh_white_24dp_1x.png +0 -0
- package/lib/images/ic_settings_white_24dp_1x.png +0 -0
- package/lib/images/ic_skip_next_white_24dp_1x.png +0 -0
- package/lib/images/ic_skip_previous_white_24dp_1x.png +0 -0
- package/lib/images/ic_toc_white_24dp_1x.png +0 -0
- package/lib/images/ic_volume_off_white_24dp_1x.png +0 -0
- package/lib/images/ic_volume_up_white_24dp_1x.png +0 -0
- package/lib/player4ie8.css +0 -225
- package/server.js +0 -29
- package/src/config/cc.js +0 -56
- package/src/config/i18n.js +0 -101
- package/src/config/options.js +0 -123
- package/src/config/playlist.js +0 -9
- package/src/config/source.js +0 -23
- package/src/config/statuses.js +0 -8
- package/src/config/styles.js +0 -16
- package/src/entity.js +0 -27
- package/src/events.js +0 -5
- package/src/extensions/annotations.js +0 -142
- package/src/extensions/audio-tarcks.js +0 -115
- package/src/extensions/backward.js +0 -45
- package/src/extensions/base.js +0 -73
- package/src/extensions/bottom-next.js +0 -50
- package/src/extensions/bottom-prev.js +0 -50
- package/src/extensions/buffering.js +0 -78
- package/src/extensions/c2pa.js +0 -350
- package/src/extensions/caption-search.js +0 -230
- package/src/extensions/cc.js +0 -874
- package/src/extensions/crawl.js +0 -118
- package/src/extensions/download.js +0 -411
- package/src/extensions/error.js +0 -47
- package/src/extensions/forward.js +0 -44
- package/src/extensions/fullscreen.js +0 -84
- package/src/extensions/help.js +0 -201
- package/src/extensions/helpers/FileSaver.js +0 -157
- package/src/extensions/helpers/clickOpener.js +0 -180
- package/src/extensions/helpers/opener.js +0 -30
- package/src/extensions/helpers/openerHeightChecker.js +0 -13
- package/src/extensions/helpers/popover.js +0 -33
- package/src/extensions/helpers/popoverPosition.js +0 -30
- package/src/extensions/helpers/scrollIntoView.js +0 -9
- package/src/extensions/helpers/storage.js +0 -20
- package/src/extensions/helpers/textContent.js +0 -6
- package/src/extensions/helpers/timeCodeToSeconds.js +0 -44
- package/src/extensions/helpers/transport.js +0 -43
- package/src/extensions/helpers/vtt-loader.js +0 -42
- package/src/extensions/index.js +0 -87
- package/src/extensions/live.js +0 -76
- package/src/extensions/mux.js +0 -57
- package/src/extensions/next-frame.js +0 -44
- package/src/extensions/next.js +0 -48
- package/src/extensions/placeholder.js +0 -241
- package/src/extensions/play.js +0 -102
- package/src/extensions/poster.js +0 -47
- package/src/extensions/prev-frame.js +0 -44
- package/src/extensions/prev.js +0 -48
- package/src/extensions/progress.js +0 -465
- package/src/extensions/resizer.js +0 -37
- package/src/extensions/settings.js +0 -367
- package/src/extensions/theater.js +0 -56
- package/src/extensions/title.js +0 -38
- package/src/extensions/toc.js +0 -334
- package/src/extensions/volume.js +0 -196
- package/src/flash/FlashPlugin.js +0 -301
- package/src/flash/MediaElement.js +0 -361
- package/src/flash/plugins.js +0 -32
- package/src/flash-detector.js +0 -66
- package/src/helpers/$t.js +0 -10
- package/src/helpers/binder.js +0 -11
- package/src/helpers/isAndroid.js +0 -5
- package/src/helpers/isBlackBerry.js +0 -5
- package/src/helpers/isCanvasSupported.js +0 -6
- package/src/helpers/isIE.js +0 -21
- package/src/helpers/isMobile.js +0 -10
- package/src/helpers/isWindows.js +0 -5
- package/src/helpers/isWindowsPhone.js +0 -5
- package/src/helpers/isiOS.js +0 -5
- package/src/html5media.js +0 -19
- package/src/index.js +0 -2
- package/src/logger.js +0 -31
- package/src/microevent.js +0 -65
- package/src/normalize-options.js +0 -139
- package/src/player.js +0 -864
- package/src/players/base.js +0 -209
- package/src/players/flash.js +0 -172
- package/src/players/hls.js +0 -278
- package/src/players/html.js +0 -205
- package/src/players/index.js +0 -59
- package/src/players/shaka.js +0 -219
- package/src/playlist.js +0 -362
- package/src/screenfull.js +0 -121
- package/src/state.js +0 -474
- package/src/static/es5.js +0 -344
- package/src/static/images/Spinner-small.gif +0 -0
- package/src/static/images/close.png +0 -0
- package/src/static/images/ic_check_box_black_24dp_1x.png +0 -0
- package/src/static/images/ic_check_box_outline_blank_black_24dp_1x.png +0 -0
- package/src/static/images/ic_chevron_left_white_24dp_1x.png +0 -0
- package/src/static/images/ic_chevron_right_white_24dp_1x.png +0 -0
- package/src/static/images/ic_closed_caption_white_24dp_1x.png +0 -0
- package/src/static/images/ic_fast_forward_white_24dp_1x.png +0 -0
- package/src/static/images/ic_fast_rewind_white_24dp_1x.png +0 -0
- package/src/static/images/ic_fullscreen_exit_white_24dp_1x.png +0 -0
- package/src/static/images/ic_fullscreen_white_24dp_1x.png +0 -0
- package/src/static/images/ic_hd_white_24dp_1x.png +0 -0
- package/src/static/images/ic_keyboard_arrow_left_black_24dp_1x.png +0 -0
- package/src/static/images/ic_keyboard_arrow_right_black_24dp_1x.png +0 -0
- package/src/static/images/ic_pause_white_24dp_1x.png +0 -0
- package/src/static/images/ic_play_arrow_white_24dp_1x.png +0 -0
- package/src/static/images/ic_refresh_white_24dp_1x.png +0 -0
- package/src/static/images/ic_settings_white_24dp_1x.png +0 -0
- package/src/static/images/ic_skip_next_white_24dp_1x.png +0 -0
- package/src/static/images/ic_skip_previous_white_24dp_1x.png +0 -0
- package/src/static/images/ic_toc_white_24dp_1x.png +0 -0
- package/src/static/images/ic_volume_off_white_24dp_1x.png +0 -0
- package/src/static/images/ic_volume_up_white_24dp_1x.png +0 -0
- package/src/static/player4ie8.css +0 -225
- package/src/styles/bplaylist.css.js +0 -124
- package/src/styles/index.js +0 -1966
- package/src/styles/playlist.css.js +0 -84
- package/src/styles/rplaylist.css.js +0 -98
- package/src/svgs.js +0 -111
- package/src/types/Logger.js +0 -10
- package/src/types/Options.js +0 -179
- package/src/types/Playlist.js +0 -3
- package/src/types/Source.js +0 -28
- package/src/types/State.js +0 -46
- package/src/types/Styles.js +0 -11
- package/src/types/TimeData.js +0 -8
- package/src/types/Translation.js +0 -69
- package/src/utils/absolutizeUrl.js +0 -9
- package/src/utils/addClass.js +0 -9
- package/src/utils/addEvent.js +0 -31
- package/src/utils/addProperty.js +0 -65
- package/src/utils/appendChild.js +0 -14
- package/src/utils/buff2hex.js +0 -5
- package/src/utils/contains.js +0 -33
- package/src/utils/createElement.js +0 -24
- package/src/utils/each.js +0 -34
- package/src/utils/escapeHTML.js +0 -8
- package/src/utils/existy.js +0 -4
- package/src/utils/extend.js +0 -17
- package/src/utils/filter.js +0 -16
- package/src/utils/find.js +0 -11
- package/src/utils/findIndex.js +0 -20
- package/src/utils/first.js +0 -5
- package/src/utils/get.js +0 -19
- package/src/utils/has.js +0 -5
- package/src/utils/hasClass.js +0 -6
- package/src/utils/head.js +0 -11
- package/src/utils/inRange.js +0 -16
- package/src/utils/index.js +0 -73
- package/src/utils/isArray.js +0 -4
- package/src/utils/isBoolean.js +0 -3
- package/src/utils/isElement.js +0 -7
- package/src/utils/isEmpty.js +0 -6
- package/src/utils/isEqual.js +0 -33
- package/src/utils/isEqualBuffer.js +0 -13
- package/src/utils/isFunction.js +0 -3
- package/src/utils/isNotEmpty.js +0 -5
- package/src/utils/isObject.js +0 -5
- package/src/utils/isString.js +0 -9
- package/src/utils/last.js +0 -4
- package/src/utils/map.js +0 -11
- package/src/utils/negate.js +0 -8
- package/src/utils/noop.js +0 -1
- package/src/utils/notExisty.js +0 -5
- package/src/utils/reduce.js +0 -8
- package/src/utils/remove.js +0 -7
- package/src/utils/removeClass.js +0 -8
- package/src/utils/removeEvent.js +0 -7
- package/src/utils/toArray.js +0 -7
- package/src/utils/toggleClass.js +0 -16
- package/src/utils/uidGenerator.js +0 -8
- package/src/utils/upperFirst.js +0 -4
- package/tests/extensions/__snapshots__/download.spec.js.snap +0 -226
- package/tests/extensions/__snapshots__/fullscreen.spec.js.snap +0 -30
- package/tests/extensions/__snapshots__/title.spec.js.snap +0 -16
- package/tests/extensions/download.spec.js +0 -111
- package/tests/extensions/fullscreen.spec.js +0 -56
- package/tests/extensions/title.spec.js +0 -35
- package/tests/mocks/assets/BaseM.mp4 +0 -0
- package/tests/mocks/assets/hls.min.js +0 -5
- package/tests/mocks/assets/styleMock.js +0 -1
- package/tests/mocks/base-player-options.js +0 -47
- package/tests/mocks/sources.js +0 -58
- package/tests/mocks/timedata/cc_en.vtt +0 -171
- package/tests/mocks/timedata/cc_ge.vtt +0 -178
- package/tests/utils/wait.js +0 -1
- package/webpack.config.js +0 -78
package/src/flash/FlashPlugin.js
DELETED
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
contains, each, upperFirst, existy, notExisty, isNotEmpty, absolutizeUrl, get,
|
|
3
|
-
append, createElement
|
|
4
|
-
} from '../utils';
|
|
5
|
-
|
|
6
|
-
import { properties, methods } from '../html5media';
|
|
7
|
-
|
|
8
|
-
const APP_NAME = window.navigator.appName.toLowerCase();
|
|
9
|
-
const IS_IE = APP_NAME.indexOf('microsoft') !== -1 || APP_NAME.match(/trident/gi) !== null;
|
|
10
|
-
|
|
11
|
-
export default class FlashRenderer {
|
|
12
|
-
/**
|
|
13
|
-
* Creates an instance of FlashRenderer.
|
|
14
|
-
*
|
|
15
|
-
* @param {String} name name of flash plugin
|
|
16
|
-
* @param {Object} options some options for flash plugin
|
|
17
|
-
* @param {Array} supportedMediaTypes list of supported types
|
|
18
|
-
*
|
|
19
|
-
* @memberOf FlashRenderer
|
|
20
|
-
*/
|
|
21
|
-
constructor(name, options, supportedMediaTypes) {
|
|
22
|
-
this.name = name;
|
|
23
|
-
this.options = options;
|
|
24
|
-
this.supportedMediaTypes = supportedMediaTypes;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
canPlayType(type) {
|
|
28
|
-
return contains(this.supportedMediaTypes, type);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Create the player instance and add all native events/methods/properties as possible
|
|
33
|
-
*
|
|
34
|
-
* @param {MediaElement} mediaElement Instance of mejs.MediaElement already created
|
|
35
|
-
* @param {Object} options All the player configuration options passed through constructor
|
|
36
|
-
* @param {Object[]} mediaFiles List of sources with format: {src: url, type: x/y-z}
|
|
37
|
-
* @return {Object} flash api
|
|
38
|
-
*/
|
|
39
|
-
create(mediaElement, options, mediaFiles) {
|
|
40
|
-
options.logger.debug('FlashRenderer.create', options, mediaFiles);
|
|
41
|
-
|
|
42
|
-
let flash = {},
|
|
43
|
-
i,
|
|
44
|
-
il;
|
|
45
|
-
|
|
46
|
-
// store main variable
|
|
47
|
-
flash.options = options;
|
|
48
|
-
flash.id = mediaElement.id + '_' + flash.options.prefix;
|
|
49
|
-
flash.mediaElement = mediaElement;
|
|
50
|
-
|
|
51
|
-
// insert data
|
|
52
|
-
flash.flashState = {};
|
|
53
|
-
flash.flashApi = null;
|
|
54
|
-
flash.flashApiStack = [];
|
|
55
|
-
|
|
56
|
-
// mediaElements for get/set
|
|
57
|
-
each(properties, assignGettersSettersForFlash(flash));
|
|
58
|
-
|
|
59
|
-
// add mediaElements for native methods
|
|
60
|
-
const _methods = methods.slice();
|
|
61
|
-
_methods.push('stop');
|
|
62
|
-
|
|
63
|
-
each(_methods, assignMethodsForFlash(flash));
|
|
64
|
-
|
|
65
|
-
// add a ready method that Flash can call to
|
|
66
|
-
window['__ready__' + flash.id] = createOnReadyFnc(flash);
|
|
67
|
-
window['__event__' + flash.id] = (eventName, message) => options.bus.emit(eventName, message);
|
|
68
|
-
|
|
69
|
-
const isVideo = get(mediaElement, 'originalNode.tagName', '').toLowerCase() === 'video';
|
|
70
|
-
|
|
71
|
-
render(flash, mediaElement, isVideo);
|
|
72
|
-
|
|
73
|
-
flash.hide = () => {
|
|
74
|
-
flash.options.logger.debug('hiding flash plugin');
|
|
75
|
-
if (isVideo) {
|
|
76
|
-
flash.flashNode.style.position = 'absolute';
|
|
77
|
-
flash.flashNode.style.width = '1px';
|
|
78
|
-
flash.flashNode.style.height = '1px';
|
|
79
|
-
try {
|
|
80
|
-
flash.flashNode.style.clip = 'rect(0 0 0 0);';
|
|
81
|
-
} catch (e) {
|
|
82
|
-
flash.options.logger.error('error on hiding flash player', e);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
flash.show = () => {
|
|
87
|
-
flash.options.logger.debug('showing flash plugin');
|
|
88
|
-
if (isVideo) {
|
|
89
|
-
flash.flashNode.style.position = '';
|
|
90
|
-
flash.flashNode.style.width = '';
|
|
91
|
-
flash.flashNode.style.height = '';
|
|
92
|
-
try {
|
|
93
|
-
flash.flashNode.style.clip = '';
|
|
94
|
-
} catch (e) {
|
|
95
|
-
flash.options.logger.error('error on showing flash player', e);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
flash.setSize = (width, height) => {
|
|
100
|
-
flash.options.logger.debug('changing size for flash plugin', width, height);
|
|
101
|
-
|
|
102
|
-
flash.flashNode.style.width = width;
|
|
103
|
-
flash.flashNode.style.height = height;
|
|
104
|
-
|
|
105
|
-
if (flash.flashApi !== null) {
|
|
106
|
-
flash.flashApi.fire_setSize(width, height);
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
if (isNotEmpty(mediaFiles)) {
|
|
111
|
-
for (i = 0, il = mediaFiles.length; i < il; i++) {
|
|
112
|
-
if (this.canPlayType(mediaFiles[i].type)) {
|
|
113
|
-
flash.options.logger.debug('FLASH', 'init, set src', mediaFiles[i].src);
|
|
114
|
-
flash.setSrc(mediaFiles[i].src);
|
|
115
|
-
flash.load();
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return flash;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function assignGettersSettersForFlash(flash) {
|
|
126
|
-
return propName => {
|
|
127
|
-
// add to flash state that we will store
|
|
128
|
-
flash.flashState[propName] = null;
|
|
129
|
-
|
|
130
|
-
const capName = upperFirst(propName);
|
|
131
|
-
|
|
132
|
-
flash['get' + capName] = () => {
|
|
133
|
-
flash.options.logger.debug('[', flash.options.prefix, ' get]: ', propName);
|
|
134
|
-
if (flash.flashApi === null) {
|
|
135
|
-
return null;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (notExisty(flash.flashApi['get_' + propName])) {
|
|
139
|
-
flash.options.logger.warn('[', flash.options.prefix, ' MISSING]: ', propName);
|
|
140
|
-
return null;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
var value = flash.flashApi['get_' + propName]();
|
|
144
|
-
|
|
145
|
-
// special case for buffered to conform to HTML5's newest
|
|
146
|
-
if (propName === 'buffered') {
|
|
147
|
-
return {
|
|
148
|
-
start: () => 0,
|
|
149
|
-
end: () => value,
|
|
150
|
-
length: 1
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return value;
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
flash['set' + capName] = (value) => {
|
|
158
|
-
flash.options.logger.debug('[', flash.options.prefix, ' set]: ', propName, ' = ', value);
|
|
159
|
-
|
|
160
|
-
if (propName === 'src') {
|
|
161
|
-
value = absolutizeUrl(value);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// send value to Flash
|
|
165
|
-
if (flash.flashApi !== null && existy(flash.flashApi['set_' + propName])) {
|
|
166
|
-
flash.flashApi['set_' + propName](value);
|
|
167
|
-
} else {
|
|
168
|
-
// store for after "READY" event fires
|
|
169
|
-
flash.flashApiStack.push({ type: 'set', propName, value });
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function assignMethodsForFlash(flash) {
|
|
176
|
-
return methodName => {
|
|
177
|
-
// run the method on the native HTMLMediaElement
|
|
178
|
-
flash[methodName] = () => {
|
|
179
|
-
flash.options.logger.debug('[' + flash.options.prefix + ' ' + methodName + '()]');
|
|
180
|
-
|
|
181
|
-
if (notExisty(flash.flashApi)) {
|
|
182
|
-
// store for after "READY" event fires
|
|
183
|
-
flash.flashApiStack.push({ type: 'call', methodName });
|
|
184
|
-
} else if (flash.flashApi['fire_' + methodName]) {
|
|
185
|
-
// send call up to Flash ExternalInterface API
|
|
186
|
-
try {
|
|
187
|
-
flash.flashApi['fire_' + methodName]();
|
|
188
|
-
} catch (e) {
|
|
189
|
-
flash.options.logger.error('error occurred when calling flash api.', e);
|
|
190
|
-
}
|
|
191
|
-
} else {
|
|
192
|
-
flash.options.logger.warn('flash', 'missing method', methodName);
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function createOnReadyFnc(flash) {
|
|
199
|
-
return () => {
|
|
200
|
-
flash.options.logger.debug('flash is ready');
|
|
201
|
-
|
|
202
|
-
try {
|
|
203
|
-
flash.flashApi = document.getElementById('__' + flash.id);
|
|
204
|
-
|
|
205
|
-
flash.options.bus.emit('rendererready', flash);
|
|
206
|
-
|
|
207
|
-
// do call stack
|
|
208
|
-
each(flash.flashApiStack, stackItem => {
|
|
209
|
-
flash.options.logger.debug('- stack', stackItem.type, stackItem);
|
|
210
|
-
if (stackItem.type === 'set') {
|
|
211
|
-
const capName = upperFirst(stackItem.propName);
|
|
212
|
-
flash['set' + capName](stackItem.value);
|
|
213
|
-
} else if (stackItem.type === 'call') {
|
|
214
|
-
flash[stackItem.methodName]();
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
} catch (e) {
|
|
218
|
-
flash.options.logger.error(e);
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function render(flash, mediaElement, isVideo) {
|
|
224
|
-
// insert Flash object
|
|
225
|
-
flash.flashWrapper = createElement('div', { class: 'rmp-flash-wrapper' });
|
|
226
|
-
const options = flash.options;
|
|
227
|
-
|
|
228
|
-
const
|
|
229
|
-
autoplay = mediaElement.getAttribute('autoplay'),
|
|
230
|
-
flashVars = ['uid=' + flash.id, 'autoplay=' + autoplay],
|
|
231
|
-
flashHeight = isVideo ? mediaElement.originalNode.height : 1,
|
|
232
|
-
flashWidth = isVideo ? mediaElement.originalNode.width : 1;
|
|
233
|
-
|
|
234
|
-
flashVars.push('pseudostreamstart=start');
|
|
235
|
-
flashVars.push('pseudostreamtype=byte');
|
|
236
|
-
|
|
237
|
-
append(mediaElement, flash.flashWrapper);
|
|
238
|
-
|
|
239
|
-
if (isVideo && mediaElement.originalNode !== null) {
|
|
240
|
-
mediaElement.originalNode.style.display = 'none';
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
var settings = [];
|
|
244
|
-
|
|
245
|
-
if (IS_IE) {
|
|
246
|
-
var specialIEContainer = createElement('div');
|
|
247
|
-
append(flash.flashWrapper, specialIEContainer);
|
|
248
|
-
|
|
249
|
-
settings = [
|
|
250
|
-
'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"',
|
|
251
|
-
'codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"',
|
|
252
|
-
'id="__' + flash.id + '"',
|
|
253
|
-
'width="' + flashWidth + '"',
|
|
254
|
-
'height="' + flashHeight + '"'
|
|
255
|
-
];
|
|
256
|
-
|
|
257
|
-
if (!isVideo) {
|
|
258
|
-
settings.push('style="clip: rect(0 0 0 0); position: absolute;"');
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
specialIEContainer.outerHTML =
|
|
262
|
-
'<object ' + settings.join(' ') + '>' +
|
|
263
|
-
'<param name="movie" value="' + options.flashPath + options.filename + '?x=' + new Date() + '" />' +
|
|
264
|
-
'<param name="flashvars" value="' + flashVars.join('&') + '" />' +
|
|
265
|
-
'<param name="quality" value="high" />' +
|
|
266
|
-
'<param name="bgcolor" value="#000000" />' +
|
|
267
|
-
'<param name="wmode" value="transparent" />' +
|
|
268
|
-
'<param name="allowScriptAccess" value="always" />' +
|
|
269
|
-
'<param name="allowFullScreen" value="true" />' +
|
|
270
|
-
'<div>Loading...</div>' +
|
|
271
|
-
'</object>';
|
|
272
|
-
|
|
273
|
-
} else {
|
|
274
|
-
|
|
275
|
-
settings = [
|
|
276
|
-
`id="__${flash.id}"`,
|
|
277
|
-
`name="__${flash.id}"`,
|
|
278
|
-
'play="true"',
|
|
279
|
-
'loop="false"',
|
|
280
|
-
'quality="high"',
|
|
281
|
-
'bgcolor="#000000"',
|
|
282
|
-
'wmode="transparent"',
|
|
283
|
-
'allowScriptAccess="always"',
|
|
284
|
-
'allowFullScreen="true"',
|
|
285
|
-
'type="application/x-shockwave-flash"',
|
|
286
|
-
'pluginspage="//www.macromedia.com/go/getflashplayer"',
|
|
287
|
-
`src="${options.flashPath}${options.filename}"`,
|
|
288
|
-
`flashvars="${flashVars.join('&')}"`,
|
|
289
|
-
`width="${flashWidth}"`,
|
|
290
|
-
`height="${flashHeight}"`
|
|
291
|
-
];
|
|
292
|
-
|
|
293
|
-
if (!isVideo) {
|
|
294
|
-
settings.push('style="clip: rect(0 0 0 0); position: absolute;"');
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
flash.flashWrapper.innerHTML = `<embed ${settings.join(' ')}>`;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
flash.flashNode = flash.flashWrapper.lastChild;
|
|
301
|
-
}
|
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
contains,
|
|
3
|
-
each,
|
|
4
|
-
extend,
|
|
5
|
-
existy,
|
|
6
|
-
notExisty,
|
|
7
|
-
get,
|
|
8
|
-
head,
|
|
9
|
-
find,
|
|
10
|
-
isNotEmpty,
|
|
11
|
-
upperFirst,
|
|
12
|
-
addProperty,
|
|
13
|
-
absolutizeUrl,
|
|
14
|
-
createElement
|
|
15
|
-
} from '../utils';
|
|
16
|
-
|
|
17
|
-
import { methods, properties } from '../html5media';
|
|
18
|
-
import { VIDEO, HLS, AUDIO } from './plugins';
|
|
19
|
-
|
|
20
|
-
const renderers = [VIDEO, HLS, AUDIO];
|
|
21
|
-
|
|
22
|
-
const ELEMENT_NODE = 1;
|
|
23
|
-
|
|
24
|
-
let idx = 0;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Create a fake DOM element with properties that look like a real HTMLMediaElement
|
|
28
|
-
* with all its methods/properties/events.
|
|
29
|
-
*
|
|
30
|
-
* @constructor
|
|
31
|
-
* @param {HTMLElement} node element
|
|
32
|
-
* @param {Object} options some options
|
|
33
|
-
* @return {HTMLElement} created element
|
|
34
|
-
*/
|
|
35
|
-
export default function MediaElement(node, options = {}) {
|
|
36
|
-
// create our node (note: older versions of iOS don't support Object.defineProperty on DOM nodes)
|
|
37
|
-
var mediaElement = createElement('div', { class: 'rmp-flash-wrapper' });
|
|
38
|
-
|
|
39
|
-
mediaElement.options = options;
|
|
40
|
-
|
|
41
|
-
mediaElement.originalNode = node;
|
|
42
|
-
const id = node.id || 'me_flash_' + ++idx;
|
|
43
|
-
|
|
44
|
-
// change id
|
|
45
|
-
mediaElement.originalNode.setAttribute('id', id + '_from_mejs');
|
|
46
|
-
|
|
47
|
-
// add next to this one
|
|
48
|
-
if (mediaElement.originalNode.parentNode) {
|
|
49
|
-
mediaElement.originalNode.parentNode.insertBefore(mediaElement, mediaElement.originalNode);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// insert this one inside
|
|
53
|
-
mediaElement.appendChild(mediaElement.originalNode);
|
|
54
|
-
|
|
55
|
-
mediaElement.id = id;
|
|
56
|
-
|
|
57
|
-
mediaElement.renderers = {};
|
|
58
|
-
mediaElement.renderer = null;
|
|
59
|
-
mediaElement.rendererName = null;
|
|
60
|
-
|
|
61
|
-
// add properties get/set
|
|
62
|
-
each(properties, createAssigner(mediaElement));
|
|
63
|
-
|
|
64
|
-
// special .src property
|
|
65
|
-
const getSrc = () => existy(mediaElement.renderer) ? mediaElement.renderer.getSrc() : null;
|
|
66
|
-
const setSrc = value => {
|
|
67
|
-
let renderInfo;
|
|
68
|
-
const mediaFiles = [];
|
|
69
|
-
|
|
70
|
-
// clean up URLs
|
|
71
|
-
if (typeof value === 'string') {
|
|
72
|
-
mediaFiles.push({
|
|
73
|
-
src: value,
|
|
74
|
-
type: value ? getTypeFromFile(value) : ''
|
|
75
|
-
});
|
|
76
|
-
} else {
|
|
77
|
-
each(value, data => {
|
|
78
|
-
const src = absolutizeUrl(data.src), type = data.type;
|
|
79
|
-
mediaFiles.push({
|
|
80
|
-
src,
|
|
81
|
-
type: type || getTypeFromFile(src)
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
mediaElement.originalNode.setAttribute('src', get(head(mediaFiles), 'src', ''));
|
|
87
|
-
|
|
88
|
-
// find a renderer and URL match
|
|
89
|
-
renderInfo = selectRenderer(mediaFiles);
|
|
90
|
-
|
|
91
|
-
// Ensure that the original gets the first source found
|
|
92
|
-
mediaElement.originalNode.setAttribute('src', get(head(mediaFiles), 'src', ''));
|
|
93
|
-
|
|
94
|
-
// did we find a renderer?
|
|
95
|
-
if (renderInfo === null) {
|
|
96
|
-
options.bus.emit('error', { message: 'No renderer found'} );
|
|
97
|
-
mediaElement.options.logger.error('No renderer found');
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// turn on the renderer (this checks for the existing renderer already)
|
|
102
|
-
mediaElement.changeRenderer(renderInfo.rendererName, mediaFiles);
|
|
103
|
-
|
|
104
|
-
if (notExisty(mediaElement.renderer)) {
|
|
105
|
-
options.bus.emit('error', { message: 'Error creating renderer'} );
|
|
106
|
-
mediaElement.options.logger.error('Error creating renderer');
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
addProperty(mediaElement, 'src', getSrc, setSrc);
|
|
111
|
-
mediaElement.getSrc = getSrc;
|
|
112
|
-
mediaElement.setSrc = setSrc;
|
|
113
|
-
|
|
114
|
-
each(methods, createMethodAssigner(mediaElement));
|
|
115
|
-
|
|
116
|
-
mediaElement.changeRenderer = createChanger(mediaElement);
|
|
117
|
-
|
|
118
|
-
mediaElement.setSize = (width, height) => {
|
|
119
|
-
if (existy(mediaElement.renderer)) {
|
|
120
|
-
mediaElement.renderer.setSize(width, height);
|
|
121
|
-
} else {
|
|
122
|
-
mediaElement.options.logger.warn('Could not set the sizes. Renderer is not found');
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
// find <source> elements
|
|
127
|
-
if (existy(mediaElement.originalNode)) {
|
|
128
|
-
detectSources(mediaElement);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return mediaElement;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function createChanger(mediaElement) {
|
|
135
|
-
return function changeRenderer(rendererName, mediaFiles) {
|
|
136
|
-
|
|
137
|
-
// check for a match on the current renderer
|
|
138
|
-
if (get(mediaElement, 'renderer.name') === rendererName) {
|
|
139
|
-
mediaElement.options.logger.debug('Already using: ', rendererName);
|
|
140
|
-
|
|
141
|
-
mediaElement.renderer.show();
|
|
142
|
-
mediaElement.renderer.setSrc(head(mediaFiles).src);
|
|
143
|
-
|
|
144
|
-
return true;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// if existing renderer is not the right one, then hide it
|
|
148
|
-
if (existy(mediaElement.renderer)) {
|
|
149
|
-
mediaElement.options.logger.debug('Stopping and hiding: ', mediaElement.renderer);
|
|
150
|
-
mediaElement.renderer.pause();
|
|
151
|
-
if (mediaElement.renderer.stop) {
|
|
152
|
-
mediaElement.renderer.stop();
|
|
153
|
-
}
|
|
154
|
-
mediaElement.renderer.hide();
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// see if we have the renderer already created
|
|
158
|
-
let newRenderer = mediaElement.renderers[rendererName];
|
|
159
|
-
|
|
160
|
-
if (existy(newRenderer)) {
|
|
161
|
-
mediaElement.options.logger.debug('restoring: ', newRenderer.name);
|
|
162
|
-
|
|
163
|
-
newRenderer.show();
|
|
164
|
-
newRenderer.setSrc(head(mediaFiles).src);
|
|
165
|
-
|
|
166
|
-
mediaElement.renderer = newRenderer;
|
|
167
|
-
return true;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
const renderer = find(renderers, r => r.name === rendererName);
|
|
171
|
-
|
|
172
|
-
if (notExisty(renderer)) {
|
|
173
|
-
mediaElement.options.logger.error('can\'t found: ' + rendererName);
|
|
174
|
-
return false;
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
var renderOptions = extend({}, mediaElement.options, renderer.options);
|
|
179
|
-
newRenderer = renderer.create(mediaElement, renderOptions, mediaFiles);
|
|
180
|
-
newRenderer.name = rendererName;
|
|
181
|
-
|
|
182
|
-
// store for later
|
|
183
|
-
mediaElement.renderers[renderer.name] = newRenderer;
|
|
184
|
-
mediaElement.renderer = newRenderer;
|
|
185
|
-
mediaElement.rendererName = rendererName;
|
|
186
|
-
newRenderer.show();
|
|
187
|
-
|
|
188
|
-
return true;
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function createAssigner(mediaElement) {
|
|
193
|
-
return function assignGettersSetters(propName) {
|
|
194
|
-
// src is a special one below
|
|
195
|
-
if (propName === 'src') {
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const capName = upperFirst(propName),
|
|
200
|
-
getFn = () => {
|
|
201
|
-
if (existy(mediaElement.renderer)) {
|
|
202
|
-
return mediaElement.renderer['get' + capName]();
|
|
203
|
-
}
|
|
204
|
-
mediaElement.options.logger.warn(`Could not called getter "${capName}". Renderer is empty`);
|
|
205
|
-
return null;
|
|
206
|
-
},
|
|
207
|
-
setFn = (value) => {
|
|
208
|
-
if (existy(mediaElement.renderer)) {
|
|
209
|
-
mediaElement.renderer['set' + capName](value);
|
|
210
|
-
} else {
|
|
211
|
-
mediaElement.options.logger.warn(`Could not called setter "${capName}". Renderer is empty`);
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
addProperty(mediaElement, propName, getFn, setFn);
|
|
216
|
-
|
|
217
|
-
mediaElement['get' + capName] = getFn;
|
|
218
|
-
mediaElement['set' + capName] = setFn;
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
function createMethodAssigner(mediaElement) {
|
|
223
|
-
return function methodAssigner(methodName) {
|
|
224
|
-
// run the method on the current renderer
|
|
225
|
-
mediaElement[methodName] = (...args) => {
|
|
226
|
-
mediaElement.options.logger.debug('[wrapper ', mediaElement.id, '.', methodName, '()]', mediaElement.renderer);
|
|
227
|
-
if (get(mediaElement, `renderer.${methodName}`)) {
|
|
228
|
-
return mediaElement.renderer[methodName](args);
|
|
229
|
-
}
|
|
230
|
-
mediaElement.options.logger.warn(`Could not called method "${methodName}"`);
|
|
231
|
-
return null;
|
|
232
|
-
};
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
function detectSources(mediaElement) {
|
|
237
|
-
const mediaFiles = [];
|
|
238
|
-
const node = mediaElement.originalNode;
|
|
239
|
-
|
|
240
|
-
switch (node.nodeName.toLowerCase()) {
|
|
241
|
-
|
|
242
|
-
case 'iframe':
|
|
243
|
-
mediaFiles.push({ type: '', src: node.getAttribute('src') });
|
|
244
|
-
|
|
245
|
-
break;
|
|
246
|
-
|
|
247
|
-
case 'audio':
|
|
248
|
-
case 'video':
|
|
249
|
-
var
|
|
250
|
-
sources = node.childNodes.length,
|
|
251
|
-
nodeSource = node.getAttribute('src');
|
|
252
|
-
|
|
253
|
-
// Consider if node contains the `src` and `type` attributes
|
|
254
|
-
if (nodeSource) {
|
|
255
|
-
mediaFiles.push({ src: nodeSource, type: formatType(nodeSource, node.getAttribute('type')) });
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// test <source> types to see if they are usable
|
|
259
|
-
|
|
260
|
-
for (let i = 0; i < sources; i++) {
|
|
261
|
-
const n = node.childNodes[i];
|
|
262
|
-
if (n.nodeType === ELEMENT_NODE && n.tagName.toLowerCase() === 'source') {
|
|
263
|
-
const src = n.getAttribute('src');
|
|
264
|
-
mediaFiles.push({ src, type: formatType(src, n.getAttribute('type')) });
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
break;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
if (isNotEmpty(mediaFiles)) {
|
|
271
|
-
mediaElement.options.logger.debug('initializing src', head(mediaFiles).src);
|
|
272
|
-
mediaElement.src = mediaFiles;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
// Return the mime part of the type in case the attribute contains the codec
|
|
277
|
-
// (`video/mp4; codecs="avc1.42E01E, mp4a.40.2"` becomes `video/mp4`)
|
|
278
|
-
function getMimeFromType(type) {
|
|
279
|
-
// eslint-disable-next-line no-bitwise
|
|
280
|
-
if (type && ~type.indexOf(';')) {
|
|
281
|
-
return head(type.split(';'));
|
|
282
|
-
}
|
|
283
|
-
return type;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
// Get the format of a specific media, either based on URL or its mime type
|
|
287
|
-
function formatType(url, type) {
|
|
288
|
-
// if no type is supplied, fake it with the extension
|
|
289
|
-
if (url && !type) {
|
|
290
|
-
return getTypeFromFile(url);
|
|
291
|
-
}
|
|
292
|
-
return getMimeFromType(type);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// Get the type of media based on URL structure
|
|
296
|
-
function getTypeFromFile(url) {
|
|
297
|
-
|
|
298
|
-
url = url.toLowerCase();
|
|
299
|
-
|
|
300
|
-
if (contains(url, 'rtmp')) {
|
|
301
|
-
if (contains(url, '.mp3')) {
|
|
302
|
-
return 'audio/rtmp';
|
|
303
|
-
}
|
|
304
|
-
return 'video/rtmp';
|
|
305
|
-
} else if (contains(url, '.oga') || contains(url, '.ogg')) {
|
|
306
|
-
return 'audio/ogg';
|
|
307
|
-
} else if (contains(url, '.m3u8') || contains(url, 'm3u8-aapl-v3')) {
|
|
308
|
-
return 'application/x-mpegURL';
|
|
309
|
-
} else if (contains(url, '.mpd')) {
|
|
310
|
-
return 'application/dash+xml';
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// the do standard extension check
|
|
314
|
-
const ext = getExtension(url), normalizedExt = normalizeExtension(ext);
|
|
315
|
-
return (/(mp4|m4v|ogg|ogv|webm|webmv|flv|wmv|mpeg|mov)/gi.test(ext) ? 'video' : 'audio') + '/' + normalizedExt;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
function getExtension(url) {
|
|
319
|
-
const pure = head(url.split('?'));
|
|
320
|
-
// eslint-disable-next-line no-bitwise
|
|
321
|
-
if (~pure.indexOf('.')) {
|
|
322
|
-
let idx = pure.lastIndexOf('.');
|
|
323
|
-
return pure.substring(++idx);
|
|
324
|
-
}
|
|
325
|
-
return '';
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
// Get standard extension of a media file
|
|
329
|
-
function normalizeExtension(extension) {
|
|
330
|
-
switch (extension) {
|
|
331
|
-
case 'mp4':
|
|
332
|
-
case 'm4v':
|
|
333
|
-
return 'mp4';
|
|
334
|
-
case 'webm':
|
|
335
|
-
case 'webma':
|
|
336
|
-
case 'webmv':
|
|
337
|
-
return 'webm';
|
|
338
|
-
case 'ogg':
|
|
339
|
-
case 'oga':
|
|
340
|
-
case 'ogv':
|
|
341
|
-
return 'ogg';
|
|
342
|
-
default:
|
|
343
|
-
return extension;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
function selectRenderer(mediaFiles) {
|
|
348
|
-
for (let i = 0, il = renderers.length; i < il; i++) {
|
|
349
|
-
const renderer = renderers[i];
|
|
350
|
-
const res = renderer4files(renderer, mediaFiles);
|
|
351
|
-
if (existy(res)) {
|
|
352
|
-
return res;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
return null;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
function renderer4files(renderer, mediaFiles) {
|
|
359
|
-
const file = find(mediaFiles, file => renderer.canPlayType(file.type));
|
|
360
|
-
return existy(file) ? { rendererName: renderer.name, src: file.src } : null;
|
|
361
|
-
}
|
package/src/flash/plugins.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import FlashPlugin from './FlashPlugin';
|
|
2
|
-
|
|
3
|
-
const VIDEO_OPTIONS = {
|
|
4
|
-
prefix: 'flash_video',
|
|
5
|
-
filename: 'ravnur-flash-video.swf',
|
|
6
|
-
enablePseudoStreaming: false,
|
|
7
|
-
// start query parameter sent to server for pseudo-streaming
|
|
8
|
-
pseudoStreamingStartQueryParam: 'start',
|
|
9
|
-
// pseudo streaming type: use `time` for time based seeking (MP4) or `byte` for file byte position (FLV)
|
|
10
|
-
pseudoStreamingType: 'byte'
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const HLS_OPTIONS = {
|
|
14
|
-
prefix: 'flash_hls',
|
|
15
|
-
filename: 'ravnur-flash-video-hls.swf'
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const AUDIO_OPTIONS = {
|
|
19
|
-
prefix: 'flash_audio',
|
|
20
|
-
filename: 'ravnur-flash-audio.swf'
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const SUPPORTED_VIDEO_FORMATS = ['video/mp4', 'video/flv', 'video/rtmp', 'audio/rtmp', 'rtmp/mp4', 'audio/mp4'];
|
|
24
|
-
const SUPPORTED_HLS_FORMATS = ['audio/hls', 'video/hls', 'application/x-mpegURL',
|
|
25
|
-
'application/x-mpegurl', 'vnd.apple.mpegURL', 'audio/ism/manifest(format=m3u8-aapl-v3)'];
|
|
26
|
-
|
|
27
|
-
// VIDEO
|
|
28
|
-
export const VIDEO = new FlashPlugin('flash_video', VIDEO_OPTIONS, SUPPORTED_VIDEO_FORMATS);
|
|
29
|
-
// HLS
|
|
30
|
-
export const HLS = new FlashPlugin('flash_hls', HLS_OPTIONS, SUPPORTED_HLS_FORMATS);
|
|
31
|
-
// AUDIO
|
|
32
|
-
export const AUDIO = new FlashPlugin('flash_audio', AUDIO_OPTIONS, ['audio/mp3']);
|