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/config/cc.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
Player$CCColor, Player$CCFontFamily, Player$CCFontSize, Player$CCLocation
|
|
5
|
-
} from '../types/State';
|
|
6
|
-
|
|
7
|
-
import type { Player$Translation } from '../types/Translation';
|
|
8
|
-
|
|
9
|
-
export type CCOption<T: string> = {
|
|
10
|
-
key?: $Keys<Player$Translation>,
|
|
11
|
-
label?: string,
|
|
12
|
-
value: T
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const DEFAULT_CC_TEXT_COLOR: Player$CCColor = '#FFF';
|
|
16
|
-
export const DEFAULT_CC_BG_COLOR: Player$CCColor = '#000';
|
|
17
|
-
|
|
18
|
-
export const CC_COLORS: CCOption<Player$CCColor>[] = [
|
|
19
|
-
{ key: 'red', value: '#F44336' },
|
|
20
|
-
{ key: 'purple', value: '#9C27B0' },
|
|
21
|
-
{ key: 'indigo', value: '#3F51B5' },
|
|
22
|
-
{ key: 'blue', value: '#2196F3' },
|
|
23
|
-
{ key: 'green', value: '#4CAF50' },
|
|
24
|
-
{ key: 'yellow', value: '#FFEB3B' },
|
|
25
|
-
{ key: 'orange', value: '#FF9800' },
|
|
26
|
-
{ key: 'brown', value: '#795548' },
|
|
27
|
-
{ key: 'grey', value: '#9E9E9E' },
|
|
28
|
-
{ key: 'white', value: '#FFF' },
|
|
29
|
-
{ key: 'black', value: '#000' }
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
export const DEFAULT_CC_FONT_SIZE = '100%';
|
|
33
|
-
|
|
34
|
-
export const CC_FONT_SIZES: CCOption<Player$CCFontSize>[] = [
|
|
35
|
-
{ label: '75%', value: '75%' },
|
|
36
|
-
{ label: '100%', value: '100%' },
|
|
37
|
-
{ label: '125%', value: '125%' },
|
|
38
|
-
{ label: '150%', value: '150%' },
|
|
39
|
-
{ label: '200%', value: '200%' }
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
export const DEFAULT_CC_FONT_FAMILY = 'Roboto, "Arial Unicode Ms", Arial, Helvetica, Verdana, sans-serif';
|
|
43
|
-
|
|
44
|
-
export const CC_FONT_FAMILIES: CCOption<Player$CCFontFamily>[] = [
|
|
45
|
-
{ key: 'monoserif', value: '"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace' },
|
|
46
|
-
{ key: 'propserif', value: '"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif' },
|
|
47
|
-
{ key: 'monosans', value: '"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace' },
|
|
48
|
-
{ key: 'propssans', value: 'Roboto, "Arial Unicode Ms", Arial, Helvetica, Verdana, sans-serif' }
|
|
49
|
-
];
|
|
50
|
-
|
|
51
|
-
export const DEFAULT_CC_LOCATION = 'over';
|
|
52
|
-
|
|
53
|
-
export const CC_LOCATIONS: CCOption<Player$CCLocation>[] = [
|
|
54
|
-
{ key: 'cc-location-over', value: 'over' },
|
|
55
|
-
{ key: 'cc-location-below', value: 'below' }
|
|
56
|
-
];
|
package/src/config/i18n.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import type { Player$Translation } from '../types/Translation';
|
|
3
|
-
|
|
4
|
-
const i18n: Player$Translation = {
|
|
5
|
-
fullscreen: 'Fullscreen',
|
|
6
|
-
'exit-fullscreen': 'Exit full screen',
|
|
7
|
-
|
|
8
|
-
theater: 'Theater mode',
|
|
9
|
-
'exit-theater': 'Standard mode',
|
|
10
|
-
|
|
11
|
-
play: 'Play',
|
|
12
|
-
pause: 'Pause',
|
|
13
|
-
replay: 'Replay',
|
|
14
|
-
'standard-playbackrate': 'Standard',
|
|
15
|
-
forward: 'Forward 10 sec',
|
|
16
|
-
backward: 'Back 10 sec',
|
|
17
|
-
prevframe: 'Move to previous frame',
|
|
18
|
-
nextframe: 'Move to next frame',
|
|
19
|
-
annotations: 'Annotations',
|
|
20
|
-
quality: 'Quality',
|
|
21
|
-
'audio-tracks': 'Audio tracks',
|
|
22
|
-
'playback-rate': 'Playback rate',
|
|
23
|
-
settings: 'Settings',
|
|
24
|
-
buffering: 'Buffering...',
|
|
25
|
-
cc: 'Closed Captions',
|
|
26
|
-
transcript: 'Transcript',
|
|
27
|
-
chapters: 'Chapters',
|
|
28
|
-
back: 'Back',
|
|
29
|
-
'settings-fontcolor': 'Font color',
|
|
30
|
-
'settings-fontsize': 'Font size',
|
|
31
|
-
'settings-fontfamily': 'Font family',
|
|
32
|
-
'settings-background': 'Background color',
|
|
33
|
-
'settings-captionlocations': 'Captions location',
|
|
34
|
-
help: 'Help',
|
|
35
|
-
download: 'Download',
|
|
36
|
-
'video-drm': 'Video',
|
|
37
|
-
'video-only': 'Video Only',
|
|
38
|
-
'video-and': 'Video and',
|
|
39
|
-
language: 'Language',
|
|
40
|
-
|
|
41
|
-
'unapproved-source': '(unapproved)',
|
|
42
|
-
translate: 'Translate',
|
|
43
|
-
translating: 'Translating...',
|
|
44
|
-
|
|
45
|
-
monoserif : 'Monospace serif',
|
|
46
|
-
propserif : 'Proportionate serif',
|
|
47
|
-
monosans : 'Monospace sans serif',
|
|
48
|
-
propssans : 'Proportionate sans serif',
|
|
49
|
-
|
|
50
|
-
'cc-location-over' : 'Overlay video',
|
|
51
|
-
'cc-location-below' : 'Below the video',
|
|
52
|
-
|
|
53
|
-
red : 'Red',
|
|
54
|
-
purple : 'Purple',
|
|
55
|
-
indigo : 'Indigo',
|
|
56
|
-
blue : 'Blue',
|
|
57
|
-
green : 'Green',
|
|
58
|
-
yellow : 'Yellow',
|
|
59
|
-
orange : 'Orange',
|
|
60
|
-
brown : 'Brown',
|
|
61
|
-
grey : 'Grey',
|
|
62
|
-
white : 'White',
|
|
63
|
-
black : 'Black',
|
|
64
|
-
|
|
65
|
-
'help-bacward' : '"Left (◄)" - Jump backward by 10 seconds',
|
|
66
|
-
'help-play' : '"Space" - Toggle playback',
|
|
67
|
-
'help-skip' : '"Right (►)" - Skip 10 seconds',
|
|
68
|
-
'help-volume' : '"UP/DOWN (▲/▼)" - Change volume by 10%',
|
|
69
|
-
'help-esc' : '"ESC" - exit fullscreen',
|
|
70
|
-
|
|
71
|
-
'no-video' : 'No playable sources found',
|
|
72
|
-
'no-flash' : 'For watching video you need to install Flash Player and restart your browser',
|
|
73
|
-
'playlist-count-of': 'videos',
|
|
74
|
-
|
|
75
|
-
'caption-search': 'Search captions',
|
|
76
|
-
|
|
77
|
-
c2pa: 'C2PA',
|
|
78
|
-
'view-more': 'Learn more',
|
|
79
|
-
'c2pa-invalid-claim': 'Content credentials are incomplete or missing',
|
|
80
|
-
'c2pa-exception-subtitle': 'Unexpected error occurred while validating content provenance',
|
|
81
|
-
'c2pa-unverified-claim': 'Content credentials are unverified',
|
|
82
|
-
'c2pa-no-data-message': 'Video is missing provenance information. Video owner cannot be established',
|
|
83
|
-
'c2pa-video-credentials-status': 'Video credentials status:',
|
|
84
|
-
'c2pa-status-valid': 'Valid',
|
|
85
|
-
'c2pa-status-invalid': 'Invalid',
|
|
86
|
-
'c2pa-status-incomplete': 'Incomplete',
|
|
87
|
-
'c2pa-status-unknown': 'Unknown',
|
|
88
|
-
'c2pa-signature-valid': 'Digital signature is valid',
|
|
89
|
-
'c2pa-signature-valid-extended': 'Digital signature is valid. All tracks pass validation and are signed by the owner.',
|
|
90
|
-
'c2pa-issued-to': 'Issued to:',
|
|
91
|
-
'c2pa-issued-by': 'Issued by:',
|
|
92
|
-
'c2pa-encoded-by': 'Encoded by:',
|
|
93
|
-
'c2pa-video-owner': 'Video owner:',
|
|
94
|
-
'c2pa-signature-invalid': 'Content credentials have been changed, and authenticity cannot be verified',
|
|
95
|
-
next: 'Next',
|
|
96
|
-
prev: 'Previous',
|
|
97
|
-
|
|
98
|
-
error: 'An error occurred while playing the media.'
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export default i18n;
|
package/src/config/options.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
// import type { Player$InputOptions } from '../types/Options';
|
|
2
|
-
|
|
3
|
-
import { AUTO_MODE } from './playlist';
|
|
4
|
-
|
|
5
|
-
/* eslint camelcase: 0 */
|
|
6
|
-
|
|
7
|
-
const DEFAULT_OPTIONS = {
|
|
8
|
-
// logger: null,
|
|
9
|
-
loggerLevel: 2,
|
|
10
|
-
|
|
11
|
-
timecode: 0,
|
|
12
|
-
frameRate: 23.976,
|
|
13
|
-
|
|
14
|
-
autoStart: false,
|
|
15
|
-
startTime: null,
|
|
16
|
-
endTime: null,
|
|
17
|
-
|
|
18
|
-
useNativeControls: false,
|
|
19
|
-
|
|
20
|
-
useOriginTimeForPreview: true,
|
|
21
|
-
|
|
22
|
-
playlistmode: AUTO_MODE,
|
|
23
|
-
plalistAutoGoNext: true,
|
|
24
|
-
playlistitle: '',
|
|
25
|
-
playlistforcepoint: 0,
|
|
26
|
-
|
|
27
|
-
showExtensions: true,
|
|
28
|
-
alwaysShowExtensions: false,
|
|
29
|
-
extensionsVisibilityTimeout: 2000,
|
|
30
|
-
|
|
31
|
-
showPlay: true,
|
|
32
|
-
showProgress: true,
|
|
33
|
-
showVolume: true,
|
|
34
|
-
showFullScreen: true,
|
|
35
|
-
showClosedCaptions: true,
|
|
36
|
-
showTOC: true,
|
|
37
|
-
showAnnotations: true,
|
|
38
|
-
showQuality: true,
|
|
39
|
-
showAudioTracks: false,
|
|
40
|
-
showPoster: true,
|
|
41
|
-
showError: false,
|
|
42
|
-
showPlaceholder: true,
|
|
43
|
-
showPlaybackRate: true,
|
|
44
|
-
showForward: true,
|
|
45
|
-
showBackward: true,
|
|
46
|
-
showSettings: true,
|
|
47
|
-
showDownload: true,
|
|
48
|
-
showDownloadVideo: true,
|
|
49
|
-
showDownloadCC: false,
|
|
50
|
-
showBottomNext: false,
|
|
51
|
-
showBottomPrev: false,
|
|
52
|
-
showCaptionSearch: false,
|
|
53
|
-
showCrawl: false,
|
|
54
|
-
crawl: {},
|
|
55
|
-
downloadVideoURL: null,
|
|
56
|
-
|
|
57
|
-
showHelp: true,
|
|
58
|
-
showTitle: true,
|
|
59
|
-
showNext: false,
|
|
60
|
-
showNextFrame: false,
|
|
61
|
-
showPrevFrame: false,
|
|
62
|
-
showCCLayout: true,
|
|
63
|
-
showTheaterMode: false,
|
|
64
|
-
useMux: false,
|
|
65
|
-
showSubtitles: false,
|
|
66
|
-
skipDelta: 10,
|
|
67
|
-
keyboardListeners: {},
|
|
68
|
-
globalKeyboardListeners: false,
|
|
69
|
-
isHandlingKeyboardEvents: true,
|
|
70
|
-
|
|
71
|
-
bufferingTimeout: 200,
|
|
72
|
-
|
|
73
|
-
// qualityLevel: null,
|
|
74
|
-
// startLevel: null,
|
|
75
|
-
|
|
76
|
-
hls: {
|
|
77
|
-
maxFragLookUpTolerance: 0.001,
|
|
78
|
-
maxMaxBufferLength: 60 // 60 s = 1 min; default - 10 min
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
shaka: {},
|
|
82
|
-
|
|
83
|
-
mux: {
|
|
84
|
-
env_key: '', // required
|
|
85
|
-
page_type: 'watchpage', // (see docs) 'watchpage', 'iframe', or leave empty
|
|
86
|
-
viewer_user_id: '', // ex: '12345'
|
|
87
|
-
experiment_name: '', // ex: 'player_test_A'
|
|
88
|
-
sub_property_id: '', // ex: 'cus-1'
|
|
89
|
-
|
|
90
|
-
// Player Metadata
|
|
91
|
-
player_name: 'RavnurPlayer',
|
|
92
|
-
player_version: '3.3.3',
|
|
93
|
-
player_init_time: '', // ex: 1451606400000
|
|
94
|
-
|
|
95
|
-
// Video Metadata (cleared with 'videochange' event)
|
|
96
|
-
video_id: '', // ex: 'abcd123'
|
|
97
|
-
video_title: '', // ex: 'My Great Video'
|
|
98
|
-
video_series: '', // ex: 'Weekly Great Videos'
|
|
99
|
-
video_producer: '', // ex: 'Bob the Producer'
|
|
100
|
-
video_content_type: '', // 'short', 'movie', 'episode', 'clip', 'trailer', or 'event'
|
|
101
|
-
video_language_code: '', // ex: 'en'
|
|
102
|
-
video_variant_name: '', // ex: 'Spanish Hard Subs'
|
|
103
|
-
video_variant_id: '', // ex: 'abcd1234'
|
|
104
|
-
video_duration: '', // in milliseconds, ex: 120000
|
|
105
|
-
video_stream_type: 'on-demand', // 'live' or 'on-demand'
|
|
106
|
-
video_encoding_variant: '', // ex: 'Variant 1'
|
|
107
|
-
video_cdn: '' // ex: 'Fastly', 'Akamai'
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
i18n: null,
|
|
111
|
-
|
|
112
|
-
hlsjsURL : 'https://cdn.jsdelivr.net/npm/hls.js@1.5.17/dist/hls.min.js',
|
|
113
|
-
shakaURL : 'https://cdn.jsdelivr.net/npm/shaka-player@4.16.0/dist/shaka-player.compiled.min.js',
|
|
114
|
-
flashPath : '/',
|
|
115
|
-
muxURL : 'https://src.litix.io/core/4/mux.js',
|
|
116
|
-
|
|
117
|
-
disableAutoUrlRewrite: false,
|
|
118
|
-
|
|
119
|
-
useHTMLPlayer: false,
|
|
120
|
-
useHLSJSPlayer: false
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
export default DEFAULT_OPTIONS;
|
package/src/config/playlist.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import type { Player$PlaylistMode } from '../types/Playlist';
|
|
4
|
-
|
|
5
|
-
export const BOTTOM_MODE: Player$PlaylistMode = 'bottom';
|
|
6
|
-
export const RIGHT_MODE: Player$PlaylistMode = 'right';
|
|
7
|
-
export const AUTO_MODE: Player$PlaylistMode = 'auto';
|
|
8
|
-
|
|
9
|
-
export const PLAYLIST_MODES = [ AUTO_MODE, BOTTOM_MODE, RIGHT_MODE ];
|
package/src/config/source.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
// import type { Player$Source } from '../types/Source';
|
|
4
|
-
|
|
5
|
-
const SOURCE_OPTIONS = {
|
|
6
|
-
annotations: null,
|
|
7
|
-
chapters: null,
|
|
8
|
-
cc: null,
|
|
9
|
-
preview: null,
|
|
10
|
-
poster: null,
|
|
11
|
-
|
|
12
|
-
title: '',
|
|
13
|
-
|
|
14
|
-
nextTrackTitle: '',
|
|
15
|
-
nextTrackThumbnails: '',
|
|
16
|
-
|
|
17
|
-
clip: null, // [ 10, 300 ] sec
|
|
18
|
-
|
|
19
|
-
// inner props
|
|
20
|
-
isAudio: false
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default SOURCE_OPTIONS;
|
package/src/config/statuses.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import type { Player$SourceStatus } from '../types/Source';
|
|
4
|
-
|
|
5
|
-
export const APPROVED_TIMEDATA_STATUS: Player$SourceStatus = 2;
|
|
6
|
-
export const UNAPPROVED_TIMEDATA_STATUS: Player$SourceStatus = 1;
|
|
7
|
-
export const TRANSLATABLE_TIMEDATA_STATUS: Player$SourceStatus = 0;
|
|
8
|
-
export const UNTRANSLATED_TIMEDATA_STATUS: Player$SourceStatus = 3;
|
package/src/config/styles.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import type { Player$Styles } from '../types/Styles';
|
|
3
|
-
|
|
4
|
-
const DEFAULT_STYLES: Player$Styles = {
|
|
5
|
-
accentColor: '#81d4fa',
|
|
6
|
-
mainColor: '#fff',
|
|
7
|
-
submenuBgColor: '#eee',
|
|
8
|
-
submenuColor: '#333',
|
|
9
|
-
chaptersBubbleColor: '#1565C0',
|
|
10
|
-
|
|
11
|
-
pltHeight: '135px',
|
|
12
|
-
|
|
13
|
-
rplaylistHeight: '30%'
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default DEFAULT_STYLES;
|
package/src/entity.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import { addEvent, removeEvent, each } from './utils';
|
|
3
|
-
|
|
4
|
-
import MicroEvent from './microevent';
|
|
5
|
-
|
|
6
|
-
import type { Player$Logger } from './types/Logger';
|
|
7
|
-
|
|
8
|
-
export default class Entity {
|
|
9
|
-
_tokens: Array<mixed> = []
|
|
10
|
-
bus: MicroEvent
|
|
11
|
-
logger: Player$Logger
|
|
12
|
-
|
|
13
|
-
constructor(bus: MicroEvent, logger: Player$Logger) {
|
|
14
|
-
this.bus = bus;
|
|
15
|
-
this.logger = logger;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
addEvent(el: EventTarget, event: string, callback: (Event) => void, useCapture: boolean = false) {
|
|
19
|
-
const token = addEvent(el, event, callback, useCapture);
|
|
20
|
-
this._tokens.push(token);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
destroy() {
|
|
24
|
-
each(this._tokens, removeEvent);
|
|
25
|
-
this._tokens.length = 0;
|
|
26
|
-
}
|
|
27
|
-
}
|
package/src/events.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export default [
|
|
2
|
-
'loadstart', 'progress', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'play', 'pause', 'loadedmetadata',
|
|
3
|
-
'loadeddata', 'waiting', 'playing', 'canplay', 'canplaythrough', 'seeking', 'seeked', 'timeupdate', 'ended',
|
|
4
|
-
'ratechange', 'durationchange', 'volumechange'
|
|
5
|
-
];
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import BaseExtension from './base';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
createElement, existy, inRange, find, addClass, removeClass, remove, map, isArray
|
|
5
|
-
} from '../utils';
|
|
6
|
-
|
|
7
|
-
import load from './helpers/transport';
|
|
8
|
-
import timeCodeToSeconds from './helpers/timeCodeToSeconds';
|
|
9
|
-
import createSvg, { CROSS } from '../svgs';
|
|
10
|
-
|
|
11
|
-
const OUTER_CN = 'rmp-annotation';
|
|
12
|
-
const OUTER_VISIBLE_CN = `${OUTER_CN}--visible`;
|
|
13
|
-
const OUTER_HOLDER_CN = `${OUTER_CN}__holder`;
|
|
14
|
-
const OUTER_BUTTON_CN = `${OUTER_CN}__button`;
|
|
15
|
-
|
|
16
|
-
const URL_REGEX = /(https?:\/\/[^\s]+)/g;
|
|
17
|
-
const CROSS_SIZE = 16;
|
|
18
|
-
|
|
19
|
-
export default class AnnotationsExtension extends BaseExtension {
|
|
20
|
-
/** @type {Array} */
|
|
21
|
-
annotations = [];
|
|
22
|
-
/** @type {Array} */
|
|
23
|
-
sources = [];
|
|
24
|
-
/** @type {Object} */
|
|
25
|
-
current = null;
|
|
26
|
-
|
|
27
|
-
constructor(player, state, options) {
|
|
28
|
-
super(player, state, options, ['timeupdate', 'annotationslang']);
|
|
29
|
-
this.logger.debug('annotations:extension:creating');
|
|
30
|
-
|
|
31
|
-
this.render();
|
|
32
|
-
this.init();
|
|
33
|
-
|
|
34
|
-
this.logger.debug('annotations:extension:created');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
init() {
|
|
38
|
-
this.addEvent(this.$button, 'click', () => {
|
|
39
|
-
remove(this.annotations, this.current);
|
|
40
|
-
removeClass(this.$outer, OUTER_VISIBLE_CN);
|
|
41
|
-
this.current = null;
|
|
42
|
-
this.player.focus();
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const { annotations } = this.options;
|
|
46
|
-
this.sources = isArray(annotations) ? annotations : [annotations];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
onAnnotationslang(lang) {
|
|
50
|
-
this.annotations.length = 0;
|
|
51
|
-
this.current = null;
|
|
52
|
-
this.onTimeupdate();
|
|
53
|
-
const source = find(this.sources, s => s.srclang === lang );
|
|
54
|
-
if (source) {
|
|
55
|
-
load({ url: source.src, success: (resp) => {
|
|
56
|
-
try {
|
|
57
|
-
this.annotations = map( JSON.parse(resp.data), _convert);
|
|
58
|
-
this.onTimeupdate();
|
|
59
|
-
} catch (e) {
|
|
60
|
-
this.logger.error('Error occurred when parsing the response', resp.data, e);
|
|
61
|
-
}
|
|
62
|
-
}});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
render() {
|
|
67
|
-
/** @type {HTMLMediaElement} */
|
|
68
|
-
this.$outer = createElement('div', { class: OUTER_CN } );
|
|
69
|
-
|
|
70
|
-
this.$button = createElement('button', { type: 'button', class: OUTER_BUTTON_CN }, this.$outer);
|
|
71
|
-
this.$button.setAttribute('aria-label', 'Close annotation');
|
|
72
|
-
|
|
73
|
-
createSvg(this.$button, CROSS, { width: CROSS_SIZE, height: CROSS_SIZE });
|
|
74
|
-
|
|
75
|
-
this.$outerHolder = createElement('div', { class: OUTER_HOLDER_CN }, this.$outer);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
onTimeupdate() {
|
|
79
|
-
const time = this.player.getCurrentTime();
|
|
80
|
-
if ( existy(this.current) && inRange(time, this.current.from, this.current.to) ) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
this.current = find(this.annotations, ann => inRange(time, ann.from, ann.to));
|
|
85
|
-
|
|
86
|
-
if ( existy(this.current) ) {
|
|
87
|
-
_applyStyles(this.$outer, this.current);
|
|
88
|
-
_insertText(this.$outerHolder, this.current.text);
|
|
89
|
-
addClass(this.$outer, OUTER_VISIBLE_CN);
|
|
90
|
-
} else {
|
|
91
|
-
removeClass(this.$outer, OUTER_VISIBLE_CN);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
getOuter() {
|
|
96
|
-
return this.$outer;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
destroy() {
|
|
100
|
-
super.destroy();
|
|
101
|
-
|
|
102
|
-
if (this.$outer) {
|
|
103
|
-
const parent = this.$outer.parentNode;
|
|
104
|
-
parent.removeChild(this.$outer);
|
|
105
|
-
this.$outer = null;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function _wrapURLs(text) {
|
|
111
|
-
return text.replace(URL_REGEX, '<a href="$1">$1</a>');
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function _wrapNewLine(text) {
|
|
115
|
-
return text.replace(/\n/g, '<br />');
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function _convert({ text, starts, ends, top, left, width, height, fontsize, fontcolor, background }) {
|
|
119
|
-
return {
|
|
120
|
-
text, top, left, width, height, fontsize, fontcolor, background,
|
|
121
|
-
from: timeCodeToSeconds(`${starts.hh}:${starts.mm}:${starts.ss}`),
|
|
122
|
-
to: timeCodeToSeconds(`${ends.hh}:${ends.mm}:${ends.ss}`)
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function _applyStyles(element, ann) {
|
|
127
|
-
element.style.top = `${ann.top}px`;
|
|
128
|
-
element.style.left = `${ann.left}px`;
|
|
129
|
-
element.style.width = `${ann.width}px`;
|
|
130
|
-
element.style.height = `${ann.height}px`;
|
|
131
|
-
|
|
132
|
-
element.style.fontSize = ann.fontsize;
|
|
133
|
-
element.style.color = `#${ann.fontcolor}`;
|
|
134
|
-
element.style.backgroundColor = `#${ann.background}`;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function _insertText(element, text) {
|
|
138
|
-
element.textContent = text;
|
|
139
|
-
let html = _wrapURLs(element.innerHTML);
|
|
140
|
-
html = _wrapNewLine(html);
|
|
141
|
-
element.innerHTML = html;
|
|
142
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import BaseExtension from './base';
|
|
2
|
-
|
|
3
|
-
import { createElement, addClass, removeClass, each, toArray } from '../utils';
|
|
4
|
-
|
|
5
|
-
import opener from './helpers/clickOpener';
|
|
6
|
-
import popover from './helpers/popover';
|
|
7
|
-
import createSvg, { HEADPHONE } from '../svgs';
|
|
8
|
-
|
|
9
|
-
const CN = 'rmp-ext-audio-tracks';
|
|
10
|
-
const BUTTON_CN = `${CN}__button`;
|
|
11
|
-
const SELECTOR_CN = `${CN}__selector`;
|
|
12
|
-
const SELECTOR_OPEN_CN = `${SELECTOR_CN}--open`;
|
|
13
|
-
|
|
14
|
-
const ITEM_CN = `${CN}__item`;
|
|
15
|
-
const ITEM_CHECKED_CN = `${ITEM_CN}--checked`;
|
|
16
|
-
|
|
17
|
-
export default class AudioTracksExtension extends BaseExtension {
|
|
18
|
-
constructor(player, state, options) {
|
|
19
|
-
super(player, state, options, ['loadeddata', 'audiotrackswitched']);
|
|
20
|
-
this.logger.debug('audio-tracks:extension:creating');
|
|
21
|
-
|
|
22
|
-
this.render();
|
|
23
|
-
this.init();
|
|
24
|
-
|
|
25
|
-
this.logger.debug('audio-tracks:extension:created');
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
render() {
|
|
29
|
-
this.$el = createElement('div', { class: CN });
|
|
30
|
-
|
|
31
|
-
this.$button = createElement(
|
|
32
|
-
'button',
|
|
33
|
-
{ type: 'button', class: BUTTON_CN },
|
|
34
|
-
this.$el
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
this.$selector = createElement('div', { class: SELECTOR_CN, tabindex: -1 }, this.$el);
|
|
38
|
-
|
|
39
|
-
createSvg(this.$button, HEADPHONE);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
init() {
|
|
43
|
-
const $button = this.$button,
|
|
44
|
-
$selector = this.$selector,
|
|
45
|
-
reposition = false,
|
|
46
|
-
closeOnClick = true,
|
|
47
|
-
heightControl = true;
|
|
48
|
-
popover(this, { $button, text: this.$t('audio-tracks') });
|
|
49
|
-
opener(this, {
|
|
50
|
-
$button,
|
|
51
|
-
$selector,
|
|
52
|
-
SELECTOR_OPEN_CN,
|
|
53
|
-
reposition,
|
|
54
|
-
closeOnClick,
|
|
55
|
-
heightControl,
|
|
56
|
-
firstFocusItemSelector: `.${ITEM_CN}`
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
_renderAudioTracks() {
|
|
61
|
-
// fix RAV-411
|
|
62
|
-
each(toArray(this.$selector.childNodes), (btn) =>
|
|
63
|
-
this.$selector.removeChild(btn)
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
const audioTrackIdx = this.player.getAudioTrack();
|
|
67
|
-
|
|
68
|
-
const items = [];
|
|
69
|
-
each(this.player.getAudioTracks(), (track, idx) => {
|
|
70
|
-
if (!track || typeof track !== 'object') {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const item = createElement(
|
|
74
|
-
'button',
|
|
75
|
-
{ type: 'button', class: ITEM_CN },
|
|
76
|
-
this.$selector
|
|
77
|
-
);
|
|
78
|
-
item.textContent = track.name || track.label;
|
|
79
|
-
|
|
80
|
-
if (+idx === audioTrackIdx) {
|
|
81
|
-
addClass(item, ITEM_CHECKED_CN);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
this.addEvent(item, 'click', () => {
|
|
85
|
-
each(items, (el) => removeClass(el, ITEM_CHECKED_CN));
|
|
86
|
-
addClass(item, ITEM_CHECKED_CN);
|
|
87
|
-
this.player.setAudioTrack(track.id);
|
|
88
|
-
});
|
|
89
|
-
items.push(item);
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
onAudiotrackswitched() {
|
|
94
|
-
this._renderAudioTracks();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
onLoadeddata() {
|
|
98
|
-
if (this.player.isMultiAudioTracks()) {
|
|
99
|
-
this._renderAudioTracks();
|
|
100
|
-
} else {
|
|
101
|
-
this.$el.style.display = 'none';
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
getElement() {
|
|
106
|
-
return this.$el;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
destroy() {
|
|
110
|
-
super.destroy();
|
|
111
|
-
const parent = this.$el.parentNode;
|
|
112
|
-
parent.removeChild(this.$el);
|
|
113
|
-
this.$el = null;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
@@ -1,45 +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, { BACKWARD } from '../svgs';
|
|
8
|
-
|
|
9
|
-
const CN = 'rmp-ext-backward';
|
|
10
|
-
|
|
11
|
-
export default class BackwardExtension extends BaseExtension {
|
|
12
|
-
constructor(player, state, options) {
|
|
13
|
-
super(player, state, options);
|
|
14
|
-
this.logger.debug('backward:extension:creating');
|
|
15
|
-
|
|
16
|
-
this.render();
|
|
17
|
-
this.addEvent(this.$el, 'click', this.backward.bind(this));
|
|
18
|
-
|
|
19
|
-
this.logger.debug('backward: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('backward') }) );
|
|
26
|
-
createSvg(this.$el, BACKWARD);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
backward() {
|
|
30
|
-
this.player.setCurrentTime(this.player.getCurrentTime() - this.options.skipDelta);
|
|
31
|
-
this.bus.emit('heartbeatextensions');
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
getElement() {
|
|
35
|
-
return this.$el;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
destroy() {
|
|
39
|
-
super.destroy();
|
|
40
|
-
|
|
41
|
-
const parent = this.$el.parentNode;
|
|
42
|
-
parent.removeChild(this.$el);
|
|
43
|
-
this.$el = null;
|
|
44
|
-
}
|
|
45
|
-
}
|