ravnur-player-public 3.4.4 → 3.4.6
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 +72 -68
- 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
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
const SECS_IN_HOUR = 3600; // 60 * 60
|
|
2
|
-
const SECS_IN_MIN = 60;
|
|
3
|
-
const MINS_IN_HOUR = 60;
|
|
4
|
-
const HOURS_IN_DAY = 24;
|
|
5
|
-
const SECS_IN_SEC = 1;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Convert a '00:00:00' tiem string into seconds
|
|
9
|
-
*
|
|
10
|
-
* @param {String} time time
|
|
11
|
-
* @return {number} time
|
|
12
|
-
*/
|
|
13
|
-
export default function timeCodeToSeconds(time) {
|
|
14
|
-
// 00:00:00 HH:MM:SS
|
|
15
|
-
// 00:00 MM:SS
|
|
16
|
-
// 00 SS
|
|
17
|
-
const parts = time.split(':');
|
|
18
|
-
const multiples = [SECS_IN_HOUR, SECS_IN_MIN, SECS_IN_SEC];
|
|
19
|
-
let seconds = 0;
|
|
20
|
-
|
|
21
|
-
while (parts.length && multiples.length) {
|
|
22
|
-
seconds += parts.pop() * multiples.pop();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return seconds;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function secondsToTime(seconds, showHours = false, showMS = false) {
|
|
29
|
-
const ms = Math.round(seconds * 1000) % 1000;
|
|
30
|
-
seconds = Math.floor(seconds);
|
|
31
|
-
const multiples = showHours ? [HOURS_IN_DAY, MINS_IN_HOUR, SECS_IN_MIN] : [MINS_IN_HOUR, SECS_IN_MIN];
|
|
32
|
-
|
|
33
|
-
const parts = [];
|
|
34
|
-
while (multiples.length) {
|
|
35
|
-
const koeff = multiples.pop();
|
|
36
|
-
parts.unshift(pad(seconds % koeff));
|
|
37
|
-
seconds = Math.floor(seconds / koeff);
|
|
38
|
-
}
|
|
39
|
-
return showMS ? parts.join(':') + '.' + ms : parts.join(':');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function pad(n) {
|
|
43
|
-
return n < 10 ? `0${n}` : `${n}`;
|
|
44
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { existy } from '../../utils';
|
|
2
|
-
|
|
3
|
-
export default function load({ url, success, responseType, rangeStart, rangeEnd, error }) {
|
|
4
|
-
const xhr = createXHR(() => {
|
|
5
|
-
const data = xhr.responseType === 'arraybuffer' ? xhr.response : xhr.responseText;
|
|
6
|
-
success({ url: xhr.responseURL, data });
|
|
7
|
-
}, error);
|
|
8
|
-
|
|
9
|
-
xhr.open('GET', url, true);
|
|
10
|
-
|
|
11
|
-
if ( existy(rangeEnd) && existy(rangeStart) ) {
|
|
12
|
-
xhr.setRequestHeader('Range', 'bytes=' + rangeStart + '-' + --rangeEnd);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if ( existy(responseType) ) {
|
|
16
|
-
xhr.responseType = responseType;
|
|
17
|
-
}
|
|
18
|
-
xhr.send(null);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function createXHR(callback, error) {
|
|
22
|
-
if (typeof XDomainRequest === 'undefined') {
|
|
23
|
-
const xhr = new XMLHttpRequest();
|
|
24
|
-
xhr.onreadystatechange = function onreadystatechange() {
|
|
25
|
-
try {
|
|
26
|
-
if (xhr.readyState === 4) {
|
|
27
|
-
if (xhr.status === 200) {
|
|
28
|
-
setTimeout(callback);
|
|
29
|
-
} else if (error && (!xhr.status || xhr.status >= 400)) {
|
|
30
|
-
setTimeout(error);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
} catch (e) {
|
|
34
|
-
// noop
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
return xhr;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const xdr = new XDomainRequest();
|
|
41
|
-
xdr.onload = callback;
|
|
42
|
-
return xdr;
|
|
43
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import load from './transport';
|
|
4
|
-
import timeCodeToSeconds from './timeCodeToSeconds';
|
|
5
|
-
import { head, last, map, filter, uidGenerator } from '../../utils';
|
|
6
|
-
|
|
7
|
-
import type { Player$TimeData } from '../../types/TimeData';
|
|
8
|
-
|
|
9
|
-
const SCRIPT_TAG_REGEX = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;
|
|
10
|
-
|
|
11
|
-
export default function loadVTT(url: string, callback: (Player$TimeData[]) => void, error: any) {
|
|
12
|
-
const success = ({data}) => {
|
|
13
|
-
callback(decode(data));
|
|
14
|
-
};
|
|
15
|
-
load({ url, success, error });
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function decode(data: string): Player$TimeData[] {
|
|
19
|
-
let array = data.split(/\n\s*\n+/gm);
|
|
20
|
-
|
|
21
|
-
const format = array.shift().trim();
|
|
22
|
-
|
|
23
|
-
if (format !== 'WEBVTT') {
|
|
24
|
-
return [];
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const timeDelim = '-->';
|
|
28
|
-
|
|
29
|
-
return map(filter(array), str => {
|
|
30
|
-
const lines = str.split(/\n/g);
|
|
31
|
-
|
|
32
|
-
const title = head(lines).indexOf(timeDelim) < 0 ? lines.shift() : '';
|
|
33
|
-
|
|
34
|
-
const period = lines.shift().split(timeDelim);
|
|
35
|
-
const from = timeCodeToSeconds(head(period).trim());
|
|
36
|
-
const to = timeCodeToSeconds(last(period).trim());
|
|
37
|
-
|
|
38
|
-
const text = lines.filter(l => !!l).join('<br/> ').replace(SCRIPT_TAG_REGEX, '');
|
|
39
|
-
|
|
40
|
-
return { from, to, text, title, id: uidGenerator() };
|
|
41
|
-
});
|
|
42
|
-
}
|
package/src/extensions/index.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import each from '../utils/each';
|
|
3
|
-
|
|
4
|
-
import BasePlayer from '../players/base';
|
|
5
|
-
import StateEntity from '../state';
|
|
6
|
-
|
|
7
|
-
import BaseExtension from './base';
|
|
8
|
-
import ProgressExtension from './progress';
|
|
9
|
-
import PlayExtension from './play';
|
|
10
|
-
import VolumeExtension from './volume';
|
|
11
|
-
import FullScreenExtension from './fullscreen';
|
|
12
|
-
import ClosedCaptionsExtension from './cc';
|
|
13
|
-
import TOCExtension from './toc';
|
|
14
|
-
import AnnotationsExtension from './annotations';
|
|
15
|
-
import PosterExtension from './poster';
|
|
16
|
-
import PlaceholderExtension from './placeholder';
|
|
17
|
-
import ForwardExtension from './forward';
|
|
18
|
-
import BackwardExtensaion from './backward';
|
|
19
|
-
import DownloadExtension from './download';
|
|
20
|
-
import SettingsExtension from './settings';
|
|
21
|
-
// import HelpExtension from './help';
|
|
22
|
-
import ResizerExtension from './resizer';
|
|
23
|
-
import TitleExtension from './title';
|
|
24
|
-
import PrevExtension from './prev';
|
|
25
|
-
import NextExtension from './next';
|
|
26
|
-
import NextFrameExtensaion from './next-frame';
|
|
27
|
-
import PrevFrameExtensaion from './prev-frame';
|
|
28
|
-
import BufferingExtension from './buffering';
|
|
29
|
-
import MuxExtension from './mux';
|
|
30
|
-
import TheaterExtension from './theater';
|
|
31
|
-
import AudioTracksExtension from './audio-tarcks';
|
|
32
|
-
import CaptionSearchExtension from './caption-search';
|
|
33
|
-
// import C2PA from './c2pa';
|
|
34
|
-
import BottomNext from './bottom-next';
|
|
35
|
-
import BottomPrev from './bottom-prev';
|
|
36
|
-
import CrawlExtension from './crawl';
|
|
37
|
-
import LiveExtension from './live';
|
|
38
|
-
import ErrorExtension from './error';
|
|
39
|
-
|
|
40
|
-
import type { Player$ExtensionOptions } from '../types/Options';
|
|
41
|
-
|
|
42
|
-
const cond = [
|
|
43
|
-
['showTitle', TitleExtension],
|
|
44
|
-
[true, BufferingExtension],
|
|
45
|
-
['showPoster', PosterExtension],
|
|
46
|
-
['showError', ErrorExtension],
|
|
47
|
-
['showBackward', BackwardExtensaion],
|
|
48
|
-
['showPrevFrame', PrevFrameExtensaion],
|
|
49
|
-
['showBottomPrev', BottomPrev],
|
|
50
|
-
['showPlay', PlayExtension],
|
|
51
|
-
['showBottomNext', BottomNext],
|
|
52
|
-
['showNextFrame', NextFrameExtensaion],
|
|
53
|
-
['showForward', ForwardExtension],
|
|
54
|
-
['showVolume', VolumeExtension],
|
|
55
|
-
['isLive', LiveExtension],
|
|
56
|
-
['showProgress', ProgressExtension],
|
|
57
|
-
['showAnnotations', AnnotationsExtension],
|
|
58
|
-
['showTheaterMode', TheaterExtension],
|
|
59
|
-
['showClosedCaptions', ClosedCaptionsExtension],
|
|
60
|
-
['showTOC', TOCExtension],
|
|
61
|
-
['showAudioTracks', AudioTracksExtension],
|
|
62
|
-
['showPlaceholder', PlaceholderExtension],
|
|
63
|
-
['showCaptionSearch', CaptionSearchExtension],
|
|
64
|
-
['showDownload', DownloadExtension],
|
|
65
|
-
// ['showHelp', HelpExtension],
|
|
66
|
-
['showPrev', PrevExtension],
|
|
67
|
-
['showNext', NextExtension],
|
|
68
|
-
['useMux', MuxExtension],
|
|
69
|
-
[true, ResizerExtension],
|
|
70
|
-
// ['showC2PA', C2PA]
|
|
71
|
-
['showCrawl', CrawlExtension],
|
|
72
|
-
['showSettings', SettingsExtension], // must be last (except FullScreenExtension)
|
|
73
|
-
['showFullScreen', FullScreenExtension]
|
|
74
|
-
];
|
|
75
|
-
|
|
76
|
-
// eslint-disable-next-line
|
|
77
|
-
export default function extensions(player: BasePlayer, state: StateEntity, options: Player$ExtensionOptions): Array<BaseExtension> {
|
|
78
|
-
const res = [];
|
|
79
|
-
|
|
80
|
-
each(cond, ([ key, Extension ]) => {
|
|
81
|
-
if (key === true || typeof key === 'string' && options[key] === true) {
|
|
82
|
-
res.push(new Extension(player, state, options));
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
return res;
|
|
87
|
-
}
|
package/src/extensions/live.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import BaseExtension from './base';
|
|
2
|
-
|
|
3
|
-
import { createElement, addClass, removeClass } from '../utils';
|
|
4
|
-
|
|
5
|
-
import createSvg, { BROADCAST_OFF, BROADCAST_ON } from '../svgs';
|
|
6
|
-
|
|
7
|
-
import popover from './helpers/popover';
|
|
8
|
-
|
|
9
|
-
const CN = 'rmp-ext-live';
|
|
10
|
-
const BROADCAST_ON_CN = `${CN}--live`;
|
|
11
|
-
|
|
12
|
-
export default class LiveExtension extends BaseExtension {
|
|
13
|
-
constructor(player, state, options) {
|
|
14
|
-
super(player, state, options, ['timeupdate', 'progress']);
|
|
15
|
-
this.logger.debug('play:extension:creating');
|
|
16
|
-
|
|
17
|
-
this.render();
|
|
18
|
-
this.addEvent(this.$el, 'click', this.toggle.bind(this));
|
|
19
|
-
|
|
20
|
-
this.logger.debug('live:extension:created');
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
/** @type {HTMLMediaElement} */
|
|
25
|
-
this.$el = createElement('button', { type: 'button', class: CN});
|
|
26
|
-
|
|
27
|
-
createSvg(this.$el, BROADCAST_OFF, {class: 'broadcast-off', width: 50, height: 50, viewBox: '0 0 50 50'});
|
|
28
|
-
createSvg(this.$el, BROADCAST_ON, {class: 'broadcast-on', width: 50, height: 50, viewBox: '0 0 50 50'});
|
|
29
|
-
|
|
30
|
-
setTimeout(() => {
|
|
31
|
-
const text = this.player.isLive() ? 'Live' : 'Go to live';
|
|
32
|
-
popover(this, { $button: this.$el, text });
|
|
33
|
-
}, 100);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
toggle() {
|
|
37
|
-
this.goToLive();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
goToLive() {
|
|
41
|
-
this.player.goToLive();
|
|
42
|
-
addClass(this.$el, BROADCAST_ON_CN);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
onTimeupdate() {
|
|
46
|
-
if (!this.player.isLive()) {
|
|
47
|
-
this.$el.setAttribute('aria-label', 'Go to live');
|
|
48
|
-
removeClass(this.$el, BROADCAST_ON_CN);
|
|
49
|
-
} else {
|
|
50
|
-
this.$el.setAttribute('aria-label', 'Live');
|
|
51
|
-
addClass(this.$el, BROADCAST_ON_CN);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
onProgress() {
|
|
56
|
-
if (!this.player.isLive()) {
|
|
57
|
-
this.$el.setAttribute('aria-label', 'Go to live');
|
|
58
|
-
removeClass(this.$el, BROADCAST_ON_CN);
|
|
59
|
-
} else {
|
|
60
|
-
this.$el.setAttribute('aria-label', 'Live');
|
|
61
|
-
addClass(this.$el, BROADCAST_ON_CN);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
getElement() {
|
|
66
|
-
return this.$el;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
destroy() {
|
|
70
|
-
super.destroy();
|
|
71
|
-
|
|
72
|
-
const parent = this.$el.parentNode;
|
|
73
|
-
parent.removeChild(this.$el);
|
|
74
|
-
this.$el = null;
|
|
75
|
-
}
|
|
76
|
-
}
|
package/src/extensions/mux.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import BaseExtension from './base';
|
|
2
|
-
|
|
3
|
-
import { existy, first, createElement, extend } from '../utils';
|
|
4
|
-
|
|
5
|
-
/* eslint camelcase: 0 */
|
|
6
|
-
|
|
7
|
-
const MUX_OPTIONS = {
|
|
8
|
-
page_type: 'watchpage',
|
|
9
|
-
|
|
10
|
-
player_name: 'RavnurPlayer',
|
|
11
|
-
player_version: '3.3.3',
|
|
12
|
-
|
|
13
|
-
video_stream_type: 'on-demand'
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default class MuxExtension extends BaseExtension {
|
|
17
|
-
constructor(player, state, options) {
|
|
18
|
-
super(player, state, options);
|
|
19
|
-
this.logger.debug('mux:extension:creating');
|
|
20
|
-
|
|
21
|
-
this.init();
|
|
22
|
-
|
|
23
|
-
this.logger.debug('mux:extension:created');
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
init() {
|
|
27
|
-
if ( existy(window.mux) ) {
|
|
28
|
-
this.monitor();
|
|
29
|
-
} else {
|
|
30
|
-
this.loadLibraryAndStartMonitor();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
loadLibraryAndStartMonitor() {
|
|
35
|
-
const script = createElement('script', { src: this.options.muxURL } );
|
|
36
|
-
const firstScriptTag = first(document.getElementsByTagName('script'));
|
|
37
|
-
script.onload = script.onreadystatechange = () => this.monitor();
|
|
38
|
-
|
|
39
|
-
if (!firstScriptTag.parentNode) return;
|
|
40
|
-
|
|
41
|
-
firstScriptTag.parentNode.insertBefore(script, firstScriptTag);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
monitor() {
|
|
45
|
-
const $el = this.player.getElement();
|
|
46
|
-
const data = extend({}, MUX_OPTIONS, this.options.mux);
|
|
47
|
-
window.mux.monitor(`#${$el.id}`, { debug: false, data });
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
destroy() {
|
|
51
|
-
const $el = this.player.getElement();
|
|
52
|
-
if ($el?.mux) {
|
|
53
|
-
$el.mux.destroy();
|
|
54
|
-
}
|
|
55
|
-
super.destroy();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import BaseExtension from './base';
|
|
2
|
-
|
|
3
|
-
import createElement from '../utils/createElement';
|
|
4
|
-
|
|
5
|
-
import popover from './helpers/popover';
|
|
6
|
-
|
|
7
|
-
import createSvg, { NEXT_TRACK } from '../svgs';
|
|
8
|
-
|
|
9
|
-
const CN = 'rmp-ext-next-frame';
|
|
10
|
-
|
|
11
|
-
export default class NextFrameExtension extends BaseExtension {
|
|
12
|
-
constructor(player, state, options) {
|
|
13
|
-
super(player, state, options);
|
|
14
|
-
this.logger.debug('nextframe:extension:creating');
|
|
15
|
-
|
|
16
|
-
this.render();
|
|
17
|
-
this.addEvent(this.$el, 'click', this.nextframe.bind(this));
|
|
18
|
-
|
|
19
|
-
this.logger.debug('nextframe:extension:created');
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
render() {
|
|
23
|
-
/** @type {HTMLMediaElement} */
|
|
24
|
-
this.$el = createElement('button', { type: 'button', class: CN });
|
|
25
|
-
setTimeout(() => popover(this, { $button: this.$el, text: this.$t('nextframe') }) );
|
|
26
|
-
createSvg(this.$el, NEXT_TRACK);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
nextframe() {
|
|
30
|
-
this.player.nextFrame();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
getElement() {
|
|
34
|
-
return this.$el;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
destroy() {
|
|
38
|
-
super.destroy();
|
|
39
|
-
|
|
40
|
-
const parent = this.$el.parentNode;
|
|
41
|
-
parent.removeChild(this.$el);
|
|
42
|
-
this.$el = null;
|
|
43
|
-
}
|
|
44
|
-
}
|
package/src/extensions/next.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import BaseExtension from './base';
|
|
2
|
-
|
|
3
|
-
import createElement from '../utils/createElement';
|
|
4
|
-
import createSvg, { NEXT_TRACK } from '../svgs';
|
|
5
|
-
|
|
6
|
-
const CN = 'rmp-ext-next';
|
|
7
|
-
const BUTTON_CN = `${CN}__button`;
|
|
8
|
-
const THUMBNAIL_CN = `${CN}__thumbnail`;
|
|
9
|
-
|
|
10
|
-
export default class NextExtension extends BaseExtension {
|
|
11
|
-
/** @type {HTMLElement} */
|
|
12
|
-
$outer;
|
|
13
|
-
/** @type {HTMLButtonElement} */
|
|
14
|
-
$button;
|
|
15
|
-
|
|
16
|
-
constructor(player, state, options) {
|
|
17
|
-
super(player, state, options);
|
|
18
|
-
this.logger.debug('next:extension:creating');
|
|
19
|
-
|
|
20
|
-
this.render();
|
|
21
|
-
|
|
22
|
-
const bus = this.options.bus;
|
|
23
|
-
|
|
24
|
-
this.addEvent(this.$outer, 'click', () => bus.emit('nexttrack') );
|
|
25
|
-
|
|
26
|
-
this.logger.debug('next:extension:created');
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
render() {
|
|
30
|
-
const title = this.options.nextTrackTitle;
|
|
31
|
-
this.$outer = createElement('div', { class: CN, title });
|
|
32
|
-
this.$button = createElement('button', { type: 'button', class: BUTTON_CN }, this.$outer);
|
|
33
|
-
createSvg(this.$button, NEXT_TRACK);
|
|
34
|
-
this.$button.setAttribute('aria-label', 'Go to next track');
|
|
35
|
-
|
|
36
|
-
createElement('img', { src: this.options.nextTrackThumbnails, class: THUMBNAIL_CN }, this.$outer);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
getOuter() {
|
|
40
|
-
return this.$outer;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
destroy() {
|
|
44
|
-
super.destroy();
|
|
45
|
-
this.$outer.parentNode.removeChild(this.$outer);
|
|
46
|
-
this.$outer = null;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import BaseExtension from './base';
|
|
2
|
-
|
|
3
|
-
import { createElement, removeClass, addClass, isFunction, existy, hasClass, each } from '../utils';
|
|
4
|
-
|
|
5
|
-
import createSvg, { PAUSE_CIRCLE, PLAY_CIRCLE, MUTED, VOLUME_UP, VOLUME_DOWN, BACKWARD, FORWARD, PLAY } from '../svgs';
|
|
6
|
-
|
|
7
|
-
const CN = 'rmp-ext-placeholder';
|
|
8
|
-
const ANIMATION_CN = `${CN}--animation`;
|
|
9
|
-
|
|
10
|
-
const ICON_CN = `${CN}__icon`;
|
|
11
|
-
const PLAY_BUTTON_CN = `${CN}__play-btn`;
|
|
12
|
-
|
|
13
|
-
const SPACE_CODE = 32;
|
|
14
|
-
const LEFT_CODE = 37;
|
|
15
|
-
const UP_CODE = 38;
|
|
16
|
-
const RIGHT_CODE = 39;
|
|
17
|
-
const DOWN_CODE = 40;
|
|
18
|
-
const PREV_FRAME = 74;
|
|
19
|
-
const NEXT_FRAME = 75;
|
|
20
|
-
|
|
21
|
-
const VOLUME_DELTA = 0.1;
|
|
22
|
-
const MAX_VOLUME = 1;
|
|
23
|
-
const MIN_VOLUME = 0;
|
|
24
|
-
|
|
25
|
-
const MAP = {};
|
|
26
|
-
|
|
27
|
-
MAP[SPACE_CODE] = '_togglePlay';
|
|
28
|
-
MAP[LEFT_CODE] = '_skeepLeft';
|
|
29
|
-
MAP[RIGHT_CODE] = '_skeepRight';
|
|
30
|
-
MAP[UP_CODE] = '_upVolume';
|
|
31
|
-
MAP[DOWN_CODE] = '_downVolume';
|
|
32
|
-
MAP[PREV_FRAME] = '_prevFrame';
|
|
33
|
-
MAP[NEXT_FRAME] = '_nextFrame';
|
|
34
|
-
|
|
35
|
-
const CLICK_DELAY = 350;
|
|
36
|
-
|
|
37
|
-
let timerId;
|
|
38
|
-
let animationTimerId;
|
|
39
|
-
let accessibilityEnabled;
|
|
40
|
-
|
|
41
|
-
export default class PlaceholderExtension extends BaseExtension {
|
|
42
|
-
/** @type {HTMLElement} */
|
|
43
|
-
$outer;
|
|
44
|
-
/** @type {HTMLElement} */
|
|
45
|
-
$placeholderIcon;
|
|
46
|
-
/** @type {HTMLElement} */
|
|
47
|
-
$playButton;
|
|
48
|
-
|
|
49
|
-
constructor(player, state, options) {
|
|
50
|
-
super(player, state, options);
|
|
51
|
-
this.logger.debug('placeholder:extension:creating');
|
|
52
|
-
|
|
53
|
-
accessibilityEnabled = this.options.accessibility;
|
|
54
|
-
|
|
55
|
-
this.render();
|
|
56
|
-
if (options.isHandlingKeyboardEvents) {
|
|
57
|
-
this.addEvent(document, 'keydown', this.onKeyDown.bind(this), options.globalKeyboardListeners);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
this.addEvent(this.$outer, 'click', this.onPlaceholderClick.bind(this));
|
|
61
|
-
this.addEvent(this.$playButton, 'click', this.onPlaceholderClick.bind(this));
|
|
62
|
-
setTimeout(() => {
|
|
63
|
-
const $title = this.$outer.parentNode.querySelector('.rmp-ext-title');
|
|
64
|
-
if ($title) {
|
|
65
|
-
this.addEvent($title, 'click', this.onPlaceholderClick.bind(this));
|
|
66
|
-
}
|
|
67
|
-
this.addEvent(this.$outer.parentNode, 'dblclick', this.toggleFullScreen.bind(this));
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
this.logger.debug('placeholder:extension:created');
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
render() {
|
|
74
|
-
this.$outer = createElement('div', { class: CN, tabindex: -1 });
|
|
75
|
-
this.$placeholderIcon = createElement('div', { class: ICON_CN, tabindex: -1 }, this.$outer);
|
|
76
|
-
this.$playButton = createElement('button', { type: 'button', class: PLAY_BUTTON_CN, tabindex: -1 }, this.$outer);
|
|
77
|
-
createSvg(this.$playButton, PLAY);
|
|
78
|
-
this.$playButton.setAttribute('aria-label', 'Play');
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
onPlaceholderClick() {
|
|
82
|
-
this.logger.debug('placeholder:click');
|
|
83
|
-
clearTimeout(timerId);
|
|
84
|
-
timerId = setTimeout(() => this._togglePlay(), CLICK_DELAY);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
onKeyDown(e) {
|
|
88
|
-
if (!this.player.getElement()) return;
|
|
89
|
-
|
|
90
|
-
this.logger.debug('placeholder:keydown');
|
|
91
|
-
const target = e.target || e.srcElement;
|
|
92
|
-
let isPlayerEvent = target === this.player.getElement();
|
|
93
|
-
isPlayerEvent = isPlayerEvent || hasClass(target, 'rplayer');
|
|
94
|
-
// ie 11
|
|
95
|
-
isPlayerEvent = isPlayerEvent || this.player.getElement().parentNode.contains(target);
|
|
96
|
-
|
|
97
|
-
if ( isPlayerEvent ) {
|
|
98
|
-
this._processKeyDown(e);
|
|
99
|
-
} else if ( this.options.globalKeyboardListeners && !_isTextInput(e.target)) {
|
|
100
|
-
this._processKeyDown(e);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
_processKeyDown(e) {
|
|
105
|
-
if (e.target instanceof HTMLInputElement) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const keyCode = e.keyCode;
|
|
110
|
-
|
|
111
|
-
// Accessibility: If accessibility enabled, space button should trigger focused one, not play
|
|
112
|
-
if (keyCode === SPACE_CODE && accessibilityEnabled && e.target.tagName === 'BUTTON') {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
let fnc = MAP[keyCode];
|
|
117
|
-
if ( existy(fnc) && isFunction(this[fnc]) ) {
|
|
118
|
-
this[fnc](this.player);
|
|
119
|
-
e.preventDefault();
|
|
120
|
-
e.stopPropagation();
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
fnc = this.options.keyboardListeners[keyCode];
|
|
124
|
-
if ( existy(fnc) && isFunction(fnc) ) {
|
|
125
|
-
fnc(this.player);
|
|
126
|
-
e.preventDefault();
|
|
127
|
-
e.stopPropagation();
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
toggleFullScreen() {
|
|
132
|
-
this.logger.debug('placeholder:toggleFullScreen');
|
|
133
|
-
clearTimeout(timerId);
|
|
134
|
-
if (this.options.showFullScreen) {
|
|
135
|
-
this.bus.emit('fullscreenchanging');
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
_togglePlay() {
|
|
140
|
-
this.logger.debug('placeholder:togglePlay');
|
|
141
|
-
if ( this.options.isMobile ) {
|
|
142
|
-
this.bus.emit('mobiletouch');
|
|
143
|
-
} else if (this.player.isPaused()) {
|
|
144
|
-
this.player.play();
|
|
145
|
-
this._showAction(PLAY_CIRCLE);
|
|
146
|
-
} else {
|
|
147
|
-
this.player.pause();
|
|
148
|
-
this._showAction(PAUSE_CIRCLE);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
_skeepLeft() {
|
|
153
|
-
this.logger.debug('placeholder:skeepLeft');
|
|
154
|
-
this.player.setCurrentTime(this.player.getCurrentTime() - this.options.skipDelta);
|
|
155
|
-
this._showAction(BACKWARD);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
_skeepRight() {
|
|
159
|
-
this.logger.debug('placeholder:skeepRight');
|
|
160
|
-
this.player.setCurrentTime(this.player.getCurrentTime() + this.options.skipDelta);
|
|
161
|
-
this._showAction(FORWARD);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
_upVolume() {
|
|
165
|
-
this.logger.debug('placeholder:volumeup');
|
|
166
|
-
const volume = Math.min(MAX_VOLUME, VOLUME_DELTA + this.player.getVolume());
|
|
167
|
-
this.player.setMuted(false);
|
|
168
|
-
this.player.setVolume(volume);
|
|
169
|
-
this._showAction(VOLUME_UP);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
_downVolume() {
|
|
173
|
-
this.logger.debug('placeholder:volumedown');
|
|
174
|
-
const volume = Math.max(MIN_VOLUME, this.player.getVolume() - VOLUME_DELTA).toFixed(2);
|
|
175
|
-
// eslint-disable-next-line eqeqeq
|
|
176
|
-
if (volume == MIN_VOLUME) {
|
|
177
|
-
this.player.setVolume(0);
|
|
178
|
-
this.player.setMuted(true);
|
|
179
|
-
this._showAction(MUTED);
|
|
180
|
-
} else {
|
|
181
|
-
this.player.setVolume(volume);
|
|
182
|
-
this._showAction(VOLUME_DOWN);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
_showAction(path) {
|
|
187
|
-
this.logger.debug('placeholder:showaction');
|
|
188
|
-
removeClass(this.$outer, ANIMATION_CN);
|
|
189
|
-
clearTimeout(animationTimerId);
|
|
190
|
-
animationTimerId = setTimeout(() => {
|
|
191
|
-
this.logger.debug('placeholder:showaction:clear');
|
|
192
|
-
this._clearPlaceholderIcon();
|
|
193
|
-
createSvg(this.$placeholderIcon, path);
|
|
194
|
-
addClass(this.$outer, ANIMATION_CN);
|
|
195
|
-
animationTimerId = setTimeout(() => {
|
|
196
|
-
this.logger.debug('placeholder:showaction:remove');
|
|
197
|
-
this._clearPlaceholderIcon();
|
|
198
|
-
removeClass(this.$outer, ANIMATION_CN);
|
|
199
|
-
}, 500);
|
|
200
|
-
}, CLICK_DELAY);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
_clearPlaceholderIcon() {
|
|
204
|
-
if (!this.$placeholderIcon.childNodes.length) {
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
each(this.$placeholderIcon.childNodes, c => {
|
|
208
|
-
this.$placeholderIcon.removeChild(c);
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
_prevFrame() {
|
|
213
|
-
this.player.prevFrame();
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
_nextFrame() {
|
|
217
|
-
this.player.nextFrame();
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
getOuter() {
|
|
221
|
-
return this.$outer;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
destroy() {
|
|
225
|
-
super.destroy();
|
|
226
|
-
this.$outer.removeChild(this.$placeholderIcon);
|
|
227
|
-
this.$outer.parentNode.removeChild(this.$outer);
|
|
228
|
-
|
|
229
|
-
this.$outer = null;
|
|
230
|
-
this.$placeholderIcon = null;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
function _isTextInput(target) {
|
|
235
|
-
let res = false;
|
|
236
|
-
|
|
237
|
-
res = res || target instanceof HTMLTextAreaElement;
|
|
238
|
-
res = res || target instanceof HTMLInputElement && target.type === 'text';
|
|
239
|
-
|
|
240
|
-
return res;
|
|
241
|
-
}
|