chuijs 4.0.2 → 4.0.4
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/CHANGELOG.md +597 -0
- package/README.md +43 -644
- package/framework/appLayout/default/chui_app_layout.js +602 -496
- package/framework/appLayout/default/global_style.css +288 -97
- package/framework/appLayout/default/main_theme_style.css +188 -101
- package/framework/components/chui_accordion/accordion.js +38 -35
- package/framework/components/chui_accordion/styles.css +13 -12
- package/framework/components/chui_action_sheet/action_sheet.js +93 -64
- package/framework/components/chui_action_sheet/styles.css +12 -5
- package/framework/components/chui_actions_bar/actions_bar.js +338 -0
- package/framework/components/chui_actions_bar/styles.css +139 -0
- package/framework/components/chui_affix/affix.js +16 -11
- package/framework/components/chui_affix/styles.css +5 -0
- package/framework/components/chui_alert/alert.js +34 -19
- package/framework/components/chui_alert/styles.css +7 -0
- package/framework/components/chui_avatar/avatar.js +36 -35
- package/framework/components/chui_avatar/styles.css +1 -1
- package/framework/components/chui_avatar_group/avatar_group.js +25 -23
- package/framework/components/chui_avatar_group/styles.css +1 -1
- package/framework/components/chui_backtop/backtop.js +60 -21
- package/framework/components/chui_backtop/styles.css +21 -0
- package/framework/components/chui_badge/badge.js +30 -28
- package/framework/components/chui_badge/styles.css +6 -6
- package/framework/components/chui_banner/banner.js +222 -0
- package/framework/components/chui_banner/styles.css +170 -0
- package/framework/components/chui_breadcrumb/breadcrumb.js +15 -13
- package/framework/components/chui_breadcrumb/styles.css +1 -1
- package/framework/components/chui_button/button.js +52 -36
- package/framework/components/chui_button/styles.css +7 -7
- package/framework/components/chui_calendar/calendar.js +18 -16
- package/framework/components/chui_card/card.js +52 -32
- package/framework/components/chui_card_scroll/card_scroll.js +169 -0
- package/framework/components/chui_card_scroll/styles.css +86 -0
- package/framework/components/chui_chat/chat.js +140 -79
- package/framework/components/chui_chat/styles.css +18 -7
- package/framework/components/chui_clipboard_history/clipboard_history.js +53 -39
- package/framework/components/chui_clipboard_history/styles.css +13 -9
- package/framework/components/chui_code/code.js +10 -10
- package/framework/components/chui_code/styles.css +4 -4
- package/framework/components/chui_code_editor/code_editor.js +73 -57
- package/framework/components/chui_code_editor/styles.css +6 -5
- package/framework/components/chui_command_palette/command_palette.js +87 -64
- package/framework/components/chui_command_palette/styles.css +5 -5
- package/framework/components/chui_console/console.js +13 -13
- package/framework/components/chui_console/styles.css +6 -3
- package/framework/components/chui_content_block/content_block.js +35 -21
- package/framework/components/chui_content_block/styles.css +2 -2
- package/framework/components/chui_context_menu/context_menu.js +171 -58
- package/framework/components/chui_context_menu/styles.css +82 -8
- package/framework/components/chui_custom_element/custom_element.js +25 -18
- package/framework/components/chui_data_grid/data_grid.js +633 -471
- package/framework/components/chui_data_grid/styles.css +24 -22
- package/framework/components/chui_descriptions/descriptions.js +34 -17
- package/framework/components/chui_descriptions/styles.css +1 -1
- package/framework/components/chui_details/details.js +42 -36
- package/framework/components/chui_details/styles.css +12 -11
- package/framework/components/chui_diff_viewer/diff_viewer.js +172 -147
- package/framework/components/chui_diff_viewer/styles.css +10 -10
- package/framework/components/chui_divider/divider.js +19 -17
- package/framework/components/chui_divider/styles.css +2 -2
- package/framework/components/chui_drawer/drawer.js +63 -38
- package/framework/components/chui_drawer/styles.css +18 -4
- package/framework/components/chui_drop_zone/drop_zone.js +37 -27
- package/framework/components/chui_drop_zone/styles.css +10 -6
- package/framework/components/chui_empty_state/empty_state.js +20 -15
- package/framework/components/chui_fieldset/fieldset.js +40 -23
- package/framework/components/chui_fieldset/styles.css +6 -6
- package/framework/components/chui_file_explorer/file_explorer.js +260 -189
- package/framework/components/chui_file_explorer/styles.css +8 -7
- package/framework/components/chui_form/form.js +40 -28
- package/framework/components/chui_form/styles.css +1 -1
- package/framework/components/chui_gantt/gantt.js +102 -78
- package/framework/components/chui_gantt/styles.css +5 -5
- package/framework/components/chui_graphs/graphs.js +376 -239
- package/framework/components/chui_graphs/styles.css +27 -6
- package/framework/components/chui_hero/hero.js +98 -37
- package/framework/components/chui_hero/styles.css +176 -7
- package/framework/components/chui_html_block/html_block.js +8 -8
- package/framework/components/chui_html_block/styles.css +3 -3
- package/framework/components/chui_hx/hx.js +3 -3
- package/framework/components/chui_hx/styles.css +13 -6
- package/framework/components/chui_icons/icons.js +2115 -2115
- package/framework/components/chui_icons/styles.css +4 -3
- package/framework/components/chui_inputs/chui_check_box/check_box.js +31 -19
- package/framework/components/chui_inputs/chui_check_box/styles.css +30 -21
- package/framework/components/chui_inputs/chui_chips/chips.js +141 -70
- package/framework/components/chui_inputs/chui_chips/styles.css +32 -7
- package/framework/components/chui_inputs/chui_color_picker/color_picker.js +55 -38
- package/framework/components/chui_inputs/chui_color_picker/styles.css +7 -7
- package/framework/components/chui_inputs/chui_combo_box/combo_box.js +127 -109
- package/framework/components/chui_inputs/chui_combo_box/styles.css +23 -21
- package/framework/components/chui_inputs/chui_date/date.js +161 -127
- package/framework/components/chui_inputs/chui_date/styles.css +20 -19
- package/framework/components/chui_inputs/chui_date_range/date_range.js +61 -50
- package/framework/components/chui_inputs/chui_date_range/styles.css +3 -3
- package/framework/components/chui_inputs/chui_datetime/datetime.js +47 -39
- package/framework/components/chui_inputs/chui_datetime/styles.css +3 -3
- package/framework/components/chui_inputs/chui_email/email.js +48 -36
- package/framework/components/chui_inputs/chui_email/styles.css +11 -11
- package/framework/components/chui_inputs/chui_file/file.js +71 -44
- package/framework/components/chui_inputs/chui_file/styles.css +23 -19
- package/framework/components/chui_inputs/chui_hotkey/hotkey.js +101 -76
- package/framework/components/chui_inputs/chui_hotkey/styles.css +6 -6
- package/framework/components/chui_inputs/chui_masked/masked.js +83 -72
- package/framework/components/chui_inputs/chui_masked/styles.css +5 -5
- package/framework/components/chui_inputs/chui_mention/mention.js +87 -40
- package/framework/components/chui_inputs/chui_mention/styles.css +14 -8
- package/framework/components/chui_inputs/chui_multi_combo_box/multi_combo_box.js +242 -212
- package/framework/components/chui_inputs/chui_multi_combo_box/styles.css +23 -15
- package/framework/components/chui_inputs/chui_number/number.js +84 -70
- package/framework/components/chui_inputs/chui_number/styles.css +13 -13
- package/framework/components/chui_inputs/chui_otp/otp.js +71 -62
- package/framework/components/chui_inputs/chui_otp/styles.css +5 -5
- package/framework/components/chui_inputs/chui_password/password.js +72 -56
- package/framework/components/chui_inputs/chui_password/styles.css +15 -15
- package/framework/components/chui_inputs/chui_radio_button/radio_button.js +37 -25
- package/framework/components/chui_inputs/chui_radio_button/styles.css +22 -22
- package/framework/components/chui_inputs/chui_rating/rating.js +54 -50
- package/framework/components/chui_inputs/chui_rating/styles.css +3 -3
- package/framework/components/chui_inputs/chui_select_box/select_box.js +132 -108
- package/framework/components/chui_inputs/chui_select_box/styles.css +21 -21
- package/framework/components/chui_inputs/chui_slider/slider.js +41 -38
- package/framework/components/chui_inputs/chui_slider/styles.css +7 -5
- package/framework/components/chui_inputs/chui_text/styles.css +14 -14
- package/framework/components/chui_inputs/chui_text/text.js +69 -52
- package/framework/components/chui_inputs/chui_text_area/styles.css +14 -14
- package/framework/components/chui_inputs/chui_text_area/text_area.js +59 -36
- package/framework/components/chui_inputs/chui_time/styles.css +18 -20
- package/framework/components/chui_inputs/chui_time/time.js +71 -49
- package/framework/components/chui_inputs/chui_toggle/styles.css +13 -6
- package/framework/components/chui_inputs/chui_toggle/toggle.js +27 -27
- package/framework/components/chui_json_editor/json_editor.js +137 -127
- package/framework/components/chui_json_editor/styles.css +5 -5
- package/framework/components/chui_json_viewer/json_viewer.js +133 -114
- package/framework/components/chui_json_viewer/styles.css +9 -8
- package/framework/components/chui_kanban/kanban.js +78 -60
- package/framework/components/chui_kanban/styles.css +8 -4
- package/framework/components/chui_kbd/kbd.js +12 -10
- package/framework/components/chui_kbd/styles.css +1 -1
- package/framework/components/chui_label/label.js +31 -29
- package/framework/components/chui_label/styles.css +3 -3
- package/framework/components/chui_link/link.js +36 -29
- package/framework/components/chui_link/styles.css +11 -4
- package/framework/components/chui_list/list.js +42 -38
- package/framework/components/chui_list/styles.css +4 -3
- package/framework/components/chui_markdown_editor/markdown_editor.js +125 -109
- package/framework/components/chui_markdown_editor/styles.css +5 -5
- package/framework/components/chui_media/audio.js +457 -364
- package/framework/components/chui_media/audio_styles.css +74 -37
- package/framework/components/chui_media/image.js +99 -64
- package/framework/components/chui_media/image_compare.js +86 -55
- package/framework/components/chui_media/image_compare_styles.css +5 -5
- package/framework/components/chui_media/image_styles.css +4 -4
- package/framework/components/chui_media/video.js +264 -171
- package/framework/components/chui_media/video_styles.css +57 -24
- package/framework/components/chui_menu_bar/menu_bar.js +67 -65
- package/framework/components/chui_menu_bar/styles.css +14 -12
- package/framework/components/chui_message_bar/message_bar.js +551 -0
- package/framework/components/chui_message_bar/styles.css +248 -0
- package/framework/components/chui_modal/modal.js +81 -56
- package/framework/components/chui_modal/styles.css +3 -2
- package/framework/components/chui_notification/notification.js +107 -69
- package/framework/components/chui_notification/notification_download.js +28 -77
- package/framework/components/chui_notification/notification_download_card.js +115 -0
- package/framework/components/chui_notification/notification_download_progress.css +5 -4
- package/framework/components/chui_notification/notification_download_progress.js +73 -105
- package/framework/components/chui_notification/notification_update.js +44 -37
- package/framework/components/chui_notification/status_plate.css +3 -3
- package/framework/components/chui_notification/status_plate.js +2 -2
- package/framework/components/chui_notification/styles.css +6 -1
- package/framework/components/chui_notification/styles_download.css +2 -2
- package/framework/components/chui_notification/styles_update.css +3 -3
- package/framework/components/chui_org_chart/org_chart.js +101 -62
- package/framework/components/chui_org_chart/styles.css +2 -2
- package/framework/components/chui_pagination/pagination.js +65 -30
- package/framework/components/chui_pagination/styles.css +1 -1
- package/framework/components/chui_paragraph/paragraph.js +2 -2
- package/framework/components/chui_paragraph/styles.css +3 -3
- package/framework/components/chui_popover/popover.js +77 -50
- package/framework/components/chui_popover/styles.css +1 -1
- package/framework/components/chui_popups/popups.js +210 -181
- package/framework/components/chui_popups/styles.css +7 -7
- package/framework/components/chui_print_button/print_button.js +48 -33
- package/framework/components/chui_progress_bar/progress_bar.js +49 -19
- package/framework/components/chui_progress_bar/styles.css +6 -6
- package/framework/components/chui_progress_ring/progress_ring.js +32 -30
- package/framework/components/chui_progress_ring/styles.css +1 -1
- package/framework/components/chui_qrcode/qrcode.js +85 -41
- package/framework/components/chui_query_builder/query_builder.js +263 -170
- package/framework/components/chui_query_builder/styles.css +4 -4
- package/framework/components/chui_radio_group/radio_group.js +36 -26
- package/framework/components/chui_radio_group/styles.css +2 -2
- package/framework/components/chui_result/result.js +41 -31
- package/framework/components/chui_result/styles.css +3 -3
- package/framework/components/chui_scheduler/scheduler.js +126 -104
- package/framework/components/chui_scheduler/styles.css +11 -7
- package/framework/components/chui_screen_spinner/screen_spinner.js +167 -0
- package/framework/components/chui_screen_spinner/styles.css +49 -0
- package/framework/components/chui_segmented_control/segmented_control.js +90 -27
- package/framework/components/chui_segmented_control/styles.css +32 -6
- package/framework/components/chui_settings/settings.js +160 -87
- package/framework/components/chui_settings/styles.css +4 -4
- package/framework/components/chui_shortcut_help/shortcut_help.js +82 -61
- package/framework/components/chui_sidebar_nav/sidebar_nav.js +132 -53
- package/framework/components/chui_sidebar_nav/styles.css +9 -3
- package/framework/components/chui_skeleton/skeleton.js +29 -24
- package/framework/components/chui_slideshow/slideshow.js +122 -103
- package/framework/components/chui_slideshow/styles.css +22 -16
- package/framework/components/chui_spinner/spinner.js +17 -17
- package/framework/components/chui_spinner/styles.css +0 -1
- package/framework/components/chui_split_button/split_button.js +53 -30
- package/framework/components/chui_split_button/styles.css +22 -6
- package/framework/components/chui_splitter/splitter.js +46 -39
- package/framework/components/chui_splitter/styles.css +2 -2
- package/framework/components/chui_statistic/statistic.js +111 -84
- package/framework/components/chui_status_bar/status_bar.js +11 -9
- package/framework/components/chui_status_bar/styles.css +2 -2
- package/framework/components/chui_stepper/stepper.js +230 -54
- package/framework/components/chui_stepper/styles.css +79 -14
- package/framework/components/chui_sticky_bar/sticky_bar.js +53 -17
- package/framework/components/chui_sticky_bar/styles.css +11 -7
- package/framework/components/chui_tabs/chui_tabs.js +100 -46
- package/framework/components/chui_tabs/styles.css +43 -15
- package/framework/components/chui_text_editor/styles.css +24 -23
- package/framework/components/chui_text_editor/text_editor.js +103 -79
- package/framework/components/chui_text_editor/text_editor_panel.js +428 -367
- package/framework/components/chui_theme_toggle/theme_toggle.js +46 -25
- package/framework/components/chui_timeline/styles.css +3 -1
- package/framework/components/chui_timeline/timeline.js +14 -12
- package/framework/components/chui_toast_queue/styles.css +11 -11
- package/framework/components/chui_toast_queue/toast_queue.js +82 -73
- package/framework/components/chui_toolbar/styles.css +2 -2
- package/framework/components/chui_toolbar/toolbar.js +20 -13
- package/framework/components/chui_tooltip/styles.css +2 -2
- package/framework/components/chui_tooltip/tooltip.js +40 -27
- package/framework/components/chui_tour/styles.css +12 -7
- package/framework/components/chui_tour/tour.js +132 -98
- package/framework/components/chui_transfer/styles.css +8 -7
- package/framework/components/chui_transfer/transfer.js +143 -123
- package/framework/components/chui_tree_table/styles.css +4 -4
- package/framework/components/chui_tree_table/tree_table.js +88 -74
- package/framework/components/chui_tree_view/styles.css +14 -10
- package/framework/components/chui_tree_view/tree_view.js +298 -253
- package/framework/components/chui_user_bar/styles.css +145 -0
- package/framework/components/chui_user_bar/user_bar.js +402 -0
- package/framework/components/chui_user_list_bar/styles.css +173 -0
- package/framework/components/chui_user_list_bar/user_list_bar.js +485 -0
- package/framework/components/chui_watermark/watermark.js +41 -33
- package/framework/components/chui_webview/styles.css +2 -2
- package/framework/components/chui_webview/webview.js +64 -52
- package/framework/components/chui_write_bar/styles.css +172 -0
- package/framework/components/chui_write_bar/write_bar.js +320 -0
- package/framework/main_window.js +1234 -0
- package/framework/modules/chui_a11y/chui_a11y.js +153 -123
- package/framework/modules/chui_animations/animations.js +105 -43
- package/framework/modules/chui_animations/motion.js +120 -0
- package/framework/modules/chui_animations/styles.css +37 -4
- package/framework/modules/chui_bridge/preload.js +36 -25
- package/framework/modules/chui_functions.js +69 -63
- package/framework/modules/chui_highlight/chui_highlight.js +25 -22
- package/framework/modules/chui_highlight/styles.css +13 -10
- package/framework/modules/chui_i18n/chui_i18n.js +12 -10
- package/framework/modules/chui_i18n/locales/a11y.js +5 -5
- package/framework/modules/chui_i18n/locales/app_layout.js +5 -5
- package/framework/modules/chui_i18n/locales/calendar.js +3 -3
- package/framework/modules/chui_i18n/locales/common.js +3 -3
- package/framework/modules/chui_i18n/locales/data.js +36 -26
- package/framework/modules/chui_i18n/locales/editors.js +40 -13
- package/framework/modules/chui_i18n/locales/feedback.js +65 -3
- package/framework/modules/chui_i18n/locales/forms.js +8 -8
- package/framework/modules/chui_i18n/locales/graphics.js +8 -8
- package/framework/modules/chui_i18n/locales/media.js +4 -4
- package/framework/modules/chui_i18n/locales/navigation.js +12 -8
- package/framework/modules/chui_i18n/locales/validate.js +3 -3
- package/framework/modules/chui_json/chui_json.js +11 -11
- package/framework/modules/chui_layout/chui_layout.js +12 -10
- package/framework/modules/chui_logger/chui_logger.js +47 -28
- package/framework/modules/chui_page/page.js +39 -33
- package/framework/modules/chui_palette/palette.js +61 -0
- package/framework/modules/chui_qr/chui_qr.js +179 -88
- package/framework/modules/chui_scrollbar/chui_scrollbar.js +79 -68
- package/framework/modules/chui_scrollbar/styles.css +4 -2
- package/framework/modules/chui_services/chui_channels.js +27 -13
- package/framework/modules/chui_services/chui_services.js +47 -39
- package/framework/modules/chui_services/desktop.js +108 -101
- package/framework/modules/chui_sortable/chui_sortable.js +33 -28
- package/framework/modules/chui_validate/chui_validate.js +10 -7
- package/framework/tray_bar/chui_menu_items.js +136 -46
- package/index.d.ts +5046 -0
- package/index.js +199 -1254
- package/package.json +81 -68
- package/framework/components/telegram_bot/chui_telegram_bot.js +0 -184
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const { Icon, Icons } = require("../chui_icons/icons");
|
|
2
|
-
const {Label} = require(
|
|
3
|
-
const {makeKeyboardButton} = require("../../modules/chui_a11y/chui_a11y");
|
|
4
|
-
const {Log} = require("../../modules/chui_logger/chui_logger");
|
|
5
|
-
const {I18n} = require("../../modules/chui_i18n/chui_i18n");
|
|
6
|
-
const {setStyles, optionOr} = require("../../modules/chui_functions");
|
|
2
|
+
const { Label } = require("../chui_label/label");
|
|
3
|
+
const { makeKeyboardButton } = require("../../modules/chui_a11y/chui_a11y");
|
|
4
|
+
const { Log } = require("../../modules/chui_logger/chui_logger");
|
|
5
|
+
const { I18n } = require("../../modules/chui_i18n/chui_i18n");
|
|
6
|
+
const { setStyles, optionOr } = require("../../modules/chui_functions");
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Видеоплеер: кадр и плавающая полоса управления внутри кадра.
|
|
@@ -17,18 +17,18 @@ const {setStyles, optionOr} = require("../../modules/chui_functions");
|
|
|
17
17
|
* а события — через `addEventListener()`.
|
|
18
18
|
*/
|
|
19
19
|
class Video {
|
|
20
|
-
#
|
|
21
|
-
#
|
|
20
|
+
#chuiVpMain = document.createElement("chui_vp_main");
|
|
21
|
+
#chuiVt = document.createElement("video");
|
|
22
22
|
// Плавающая полоса управления
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
#
|
|
23
|
+
#chuiVpPanel = document.createElement("chui_vp_panel");
|
|
24
|
+
#chuiVpPlayPause = document.createElement("chui_vp_play_pause");
|
|
25
|
+
#chuiVpTime = undefined;
|
|
26
|
+
#chuiVpProgress = document.createElement("chui_vp_progress");
|
|
27
|
+
#chuiVpSeek = document.createElement("input");
|
|
28
|
+
#chuiVpSeekBuf = document.createElement("chui_vp_seek_buf");
|
|
29
|
+
#chuiVpVolumeIcon = document.createElement("chui_vp_volume_icon");
|
|
30
|
+
#chuiVpVolume = document.createElement("input");
|
|
31
|
+
#chuiVpFullMode = document.createElement("chui_vp_full_mode");
|
|
32
32
|
// Состояние
|
|
33
33
|
#controls = true;
|
|
34
34
|
#destroyed = false;
|
|
@@ -36,58 +36,71 @@ class Video {
|
|
|
36
36
|
#onPlay = () => this.#renderPlayState(true);
|
|
37
37
|
#onPause = () => this.#renderPlayState(false);
|
|
38
38
|
#onTimeUpdate = () => this.#renderProgress();
|
|
39
|
-
#onDurationChange = () => {
|
|
39
|
+
#onDurationChange = () => {
|
|
40
|
+
this.#setSliderMax();
|
|
41
|
+
this.#renderProgress();
|
|
42
|
+
};
|
|
40
43
|
#onBuffered = () => this.#displayBufferedAmount();
|
|
41
44
|
#onEnter = () => this.#openPanel();
|
|
42
45
|
#onLeave = () => this.#closePanel();
|
|
43
|
-
constructor(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
constructor(
|
|
47
|
+
options = {
|
|
48
|
+
src: String(),
|
|
49
|
+
autoplay: Boolean(),
|
|
50
|
+
controls: Boolean(),
|
|
51
|
+
loop: Boolean(),
|
|
52
|
+
muted: Boolean(),
|
|
53
|
+
volume: Number(),
|
|
54
|
+
poster: String(),
|
|
55
|
+
width: String(),
|
|
56
|
+
height: String(),
|
|
57
|
+
label: String(),
|
|
58
|
+
}
|
|
59
|
+
) {
|
|
60
|
+
setStyles(__dirname + "/video_styles.css", "chUiJS_Video");
|
|
48
61
|
// Плеер — именованная группа: своих ролей у панели нет, а без имени скринридер
|
|
49
62
|
// читает подряд безымянные кнопки без контекста
|
|
50
|
-
this.#
|
|
51
|
-
this.#
|
|
52
|
-
this.#
|
|
53
|
-
this.#
|
|
54
|
-
if (options.src !== undefined) this.#
|
|
55
|
-
if (options.poster !== undefined) this.#
|
|
56
|
-
if (options.autoplay !== undefined) this.#
|
|
57
|
-
if (options.loop !== undefined) this.#
|
|
58
|
-
if (options.muted !== undefined) this.#
|
|
59
|
-
this.#
|
|
63
|
+
this.#chuiVpMain.setAttribute("role", "group");
|
|
64
|
+
this.#chuiVpMain.setAttribute("aria-label", optionOr(options.label, I18n.t("media.videoPlayer")));
|
|
65
|
+
this.#chuiVt.preload = "metadata";
|
|
66
|
+
this.#chuiVt.controls = false;
|
|
67
|
+
if (options.src !== undefined) this.#chuiVt.setAttribute("src", options.src);
|
|
68
|
+
if (options.poster !== undefined) this.#chuiVt.setAttribute("poster", options.poster);
|
|
69
|
+
if (options.autoplay !== undefined) this.#chuiVt.autoplay = options.autoplay === true;
|
|
70
|
+
if (options.loop !== undefined) this.#chuiVt.loop = options.loop === true;
|
|
71
|
+
if (options.muted !== undefined) this.#chuiVt.muted = options.muted === true;
|
|
72
|
+
this.#chuiVt.volume = options.volume === undefined ? 0.5 : Math.min(1, Math.max(0, Number(options.volume)));
|
|
60
73
|
// Размеры кадра — стилем: опции принимают и проценты, и `-webkit-fill-available`
|
|
61
|
-
if (options.width !== undefined) this.#
|
|
62
|
-
if (options.height !== undefined) this.#
|
|
63
|
-
this.#
|
|
74
|
+
if (options.width !== undefined) this.#chuiVt.style.width = options.width;
|
|
75
|
+
if (options.height !== undefined) this.#chuiVt.style.height = options.height;
|
|
76
|
+
this.#chuiVpMain.appendChild(this.#chuiVt);
|
|
64
77
|
this.#buildPanel();
|
|
65
|
-
this.#
|
|
78
|
+
this.#chuiVpMain.appendChild(this.#chuiVpPanel);
|
|
66
79
|
// О смене состояния и ошибках сообщает скрытый live-регион
|
|
67
80
|
this.#status.classList.add("chui_visually_hidden");
|
|
68
81
|
this.#status.setAttribute("role", "status");
|
|
69
82
|
this.#status.setAttribute("aria-live", "polite");
|
|
70
|
-
this.#
|
|
83
|
+
this.#chuiVpMain.appendChild(this.#status);
|
|
71
84
|
// СОБЫТИЯ
|
|
72
|
-
this.#
|
|
73
|
-
this.#
|
|
74
|
-
this.#
|
|
75
|
-
this.#
|
|
76
|
-
this.#
|
|
77
|
-
this.#
|
|
78
|
-
this.#
|
|
79
|
-
this.#
|
|
85
|
+
this.#chuiVt.addEventListener("play", this.#onPlay);
|
|
86
|
+
this.#chuiVt.addEventListener("pause", this.#onPause);
|
|
87
|
+
this.#chuiVt.addEventListener("timeupdate", this.#onTimeUpdate);
|
|
88
|
+
this.#chuiVt.addEventListener("durationchange", this.#onDurationChange);
|
|
89
|
+
this.#chuiVt.addEventListener("loadedmetadata", this.#onDurationChange);
|
|
90
|
+
this.#chuiVt.addEventListener("progress", this.#onBuffered);
|
|
91
|
+
this.#chuiVt.addEventListener("volumechange", () => this.#renderVolume());
|
|
92
|
+
this.#chuiVt.addEventListener("error", () => {
|
|
80
93
|
Log.error(`[Video] не удалось прочитать дорожку: ${this.getSrc()}`);
|
|
81
|
-
this.#setStatus(I18n.t("media.videoNotPlaying", {reason: I18n.t("media.error.sourceFailed")}));
|
|
94
|
+
this.#setStatus(I18n.t("media.videoNotPlaying", { reason: I18n.t("media.error.sourceFailed") }));
|
|
82
95
|
});
|
|
83
|
-
this.#
|
|
84
|
-
this.#
|
|
96
|
+
this.#chuiVpMain.addEventListener("mouseenter", this.#onEnter);
|
|
97
|
+
this.#chuiVpMain.addEventListener("mouseleave", this.#onLeave);
|
|
85
98
|
// Панель не должна прятаться, пока в ней стоит клавиатурный фокус
|
|
86
|
-
this.#
|
|
87
|
-
this.#
|
|
88
|
-
this.#
|
|
89
|
-
this.#
|
|
90
|
-
this.#
|
|
99
|
+
this.#chuiVpMain.addEventListener("focusin", this.#onEnter);
|
|
100
|
+
this.#chuiVpMain.addEventListener("focusout", this.#onLeave);
|
|
101
|
+
this.#chuiVpPlayPause.addEventListener("click", () => this.#playPause());
|
|
102
|
+
this.#chuiVpVolumeIcon.addEventListener("click", () => this.setMuted(!this.getMuted()));
|
|
103
|
+
this.#chuiVpFullMode.addEventListener("click", () => this.#toggleFullscreen());
|
|
91
104
|
this.#setSliderMax();
|
|
92
105
|
this.setControls(options.controls === undefined ? true : options.controls === true);
|
|
93
106
|
this.#renderPlayState(false);
|
|
@@ -95,117 +108,123 @@ class Video {
|
|
|
95
108
|
}
|
|
96
109
|
/** Полоса управления: кнопки, полоса прогресса, время, громкость, полный экран */
|
|
97
110
|
#buildPanel() {
|
|
98
|
-
this.#setButton(this.#
|
|
99
|
-
this.#setButton(this.#
|
|
100
|
-
this.#setButton(this.#
|
|
101
|
-
this.#
|
|
102
|
-
this.#
|
|
103
|
-
this.#
|
|
104
|
-
this.#
|
|
105
|
-
this.#
|
|
106
|
-
this.#
|
|
107
|
-
this.#
|
|
108
|
-
this.#
|
|
111
|
+
this.#setButton(this.#chuiVpPlayPause, I18n.t("media.play"), Icons.AUDIO_VIDEO.PLAY_ARROW);
|
|
112
|
+
this.#setButton(this.#chuiVpVolumeIcon, I18n.t("media.mute"), Icons.AUDIO_VIDEO.VOLUME_UP);
|
|
113
|
+
this.#setButton(this.#chuiVpFullMode, I18n.t("media.fullscreen"), Icons.NAVIGATION.FULLSCREEN);
|
|
114
|
+
this.#chuiVpTime = new Label({ text: this.#calculateTime(0) });
|
|
115
|
+
this.#chuiVpSeek.type = "range";
|
|
116
|
+
this.#chuiVpSeek.id = "chui_vp_seek";
|
|
117
|
+
this.#chuiVpSeek.max = "0";
|
|
118
|
+
this.#chuiVpSeek.value = "0";
|
|
119
|
+
this.#chuiVpSeek.setAttribute("aria-label", I18n.t("media.position"));
|
|
120
|
+
this.#chuiVpSeek.addEventListener("input", () => {
|
|
121
|
+
this.#chuiVt.currentTime = Number(this.#chuiVpSeek.value);
|
|
109
122
|
this.#renderProgress();
|
|
110
123
|
});
|
|
111
|
-
this.#
|
|
112
|
-
this.#
|
|
113
|
-
this.#
|
|
114
|
-
this.#
|
|
115
|
-
this.#
|
|
116
|
-
this.#
|
|
117
|
-
this.#
|
|
118
|
-
this.#
|
|
119
|
-
this.#
|
|
120
|
-
this.#
|
|
124
|
+
this.#chuiVpProgress.appendChild(this.#chuiVpSeek);
|
|
125
|
+
this.#chuiVpProgress.appendChild(this.#chuiVpSeekBuf);
|
|
126
|
+
this.#chuiVpVolume.type = "range";
|
|
127
|
+
this.#chuiVpVolume.id = "chui_vp_volume";
|
|
128
|
+
this.#chuiVpVolume.max = "100";
|
|
129
|
+
this.#chuiVpVolume.value = String(Math.round(this.#chuiVt.volume * 100));
|
|
130
|
+
this.#chuiVpVolume.setAttribute("aria-label", I18n.t("media.volume"));
|
|
131
|
+
this.#chuiVpVolume.addEventListener("input", () => {
|
|
132
|
+
this.#chuiVt.volume = Number(this.#chuiVpVolume.value) / 100;
|
|
133
|
+
this.#chuiVt.muted = false;
|
|
121
134
|
});
|
|
122
135
|
//
|
|
123
|
-
this.#
|
|
124
|
-
this.#
|
|
125
|
-
this.#
|
|
126
|
-
this.#
|
|
127
|
-
this.#
|
|
128
|
-
this.#
|
|
136
|
+
this.#chuiVpPanel.appendChild(this.#chuiVpPlayPause);
|
|
137
|
+
this.#chuiVpPanel.appendChild(this.#chuiVpProgress);
|
|
138
|
+
this.#chuiVpPanel.appendChild(this.#chuiVpTime.set());
|
|
139
|
+
this.#chuiVpPanel.appendChild(this.#chuiVpVolumeIcon);
|
|
140
|
+
this.#chuiVpPanel.appendChild(this.#chuiVpVolume);
|
|
141
|
+
this.#chuiVpPanel.appendChild(this.#chuiVpFullMode);
|
|
129
142
|
}
|
|
130
143
|
// === ПАНЕЛЬ И ПОЛОСЫ ===
|
|
131
144
|
/** Полоса показывается, пока курсор над плеером или фокус в нём (состояние — класс) */
|
|
132
145
|
#openPanel() {
|
|
133
146
|
if (!this.#controls) return;
|
|
134
|
-
this.#
|
|
147
|
+
this.#chuiVpMain.classList.add("vp_panel_open");
|
|
148
|
+
}
|
|
149
|
+
#closePanel() {
|
|
150
|
+
this.#chuiVpMain.classList.remove("vp_panel_open");
|
|
135
151
|
}
|
|
136
|
-
#closePanel() { this.#chui_vp_main.classList.remove("vp_panel_open"); }
|
|
137
152
|
#playPause = async () => {
|
|
138
153
|
if (this.getPaused()) await this.play();
|
|
139
154
|
else this.pause();
|
|
140
|
-
}
|
|
155
|
+
};
|
|
141
156
|
#toggleFullscreen = async () => {
|
|
142
157
|
if (document.fullscreenElement === null) await this.requestFullscreen();
|
|
143
158
|
else await this.exitFullscreen();
|
|
144
|
-
}
|
|
159
|
+
};
|
|
145
160
|
#renderPlayState(playing) {
|
|
146
|
-
this.#setIcon(this.#
|
|
147
|
-
this.#setLabel(this.#
|
|
161
|
+
this.#setIcon(this.#chuiVpPlayPause, playing ? Icons.AUDIO_VIDEO.PAUSE : Icons.AUDIO_VIDEO.PLAY_ARROW);
|
|
162
|
+
this.#setLabel(this.#chuiVpPlayPause, playing ? I18n.t("media.pause") : I18n.t("media.play"));
|
|
148
163
|
}
|
|
149
164
|
#renderVolume = () => {
|
|
150
|
-
const доля = Math.min(100, Math.max(0, Math.round(this.#
|
|
151
|
-
this.#
|
|
152
|
-
this.#
|
|
153
|
-
this.#
|
|
154
|
-
this.#setIcon(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
165
|
+
const доля = Math.min(100, Math.max(0, Math.round(this.#chuiVt.volume * 100)));
|
|
166
|
+
this.#chuiVpVolume.value = String(доля);
|
|
167
|
+
this.#chuiVpVolume.disabled = this.getMuted();
|
|
168
|
+
this.#chuiVpMain.style.setProperty("--volume_before_width", `${доля}%`);
|
|
169
|
+
this.#setIcon(
|
|
170
|
+
this.#chuiVpVolumeIcon,
|
|
171
|
+
this.getMuted() || this.#chuiVt.volume === 0 ? Icons.AUDIO_VIDEO.VOLUME_OFF : Icons.AUDIO_VIDEO.VOLUME_UP
|
|
172
|
+
);
|
|
173
|
+
this.#chuiVpVolumeIcon.setAttribute("aria-label", I18n.t(this.getMuted() ? "media.unmute" : "media.mute"));
|
|
174
|
+
};
|
|
158
175
|
#displayBufferedAmount = () => {
|
|
159
|
-
const max = Number(this.#
|
|
176
|
+
const max = Number(this.#chuiVpSeek.max);
|
|
160
177
|
if (!(max > 0)) return;
|
|
161
178
|
try {
|
|
162
|
-
const end = Math.floor(this.#
|
|
163
|
-
this.#
|
|
179
|
+
const end = Math.floor((this.#chuiVt.buffered.end(0) / max) * 100);
|
|
180
|
+
this.#chuiVpSeekBuf.style.width = `${Math.min(100, Math.max(0, end))}%`;
|
|
164
181
|
} catch (_error) {
|
|
165
182
|
// Буфер ещё пуст — рисовать нечего
|
|
166
183
|
}
|
|
167
|
-
}
|
|
184
|
+
};
|
|
168
185
|
// Длительность приходит с метаданными: без неё полоса прокрутки делила бы на ноль,
|
|
169
186
|
// а у живого потока её нет вовсе (duration = Infinity)
|
|
170
187
|
#setSliderMax = () => {
|
|
171
188
|
const duration = this.getDuration();
|
|
172
189
|
const known = Number.isFinite(duration) && duration > 0;
|
|
173
|
-
this.#
|
|
190
|
+
this.#chuiVpSeek.max = known ? String(Math.floor(duration)) : "0";
|
|
174
191
|
// Без известной длительности ползунок бессмысленен: перетаскивание отправляло бы плеер в начало
|
|
175
|
-
this.#
|
|
176
|
-
}
|
|
192
|
+
this.#chuiVpSeek.disabled = !known;
|
|
193
|
+
};
|
|
177
194
|
#renderProgress = () => {
|
|
178
|
-
const max = Number(this.#
|
|
195
|
+
const max = Number(this.#chuiVpSeek.max);
|
|
179
196
|
const position = this.getCurrentTime();
|
|
180
197
|
const duration = this.getDuration();
|
|
181
198
|
if (!(max > 0)) {
|
|
182
199
|
// «0:07 / 0:00» читалось бы как поломка: у источника без длительности показываем только прошедшее
|
|
183
|
-
this.#
|
|
184
|
-
this.#
|
|
200
|
+
this.#chuiVpTime.setText(this.#calculateTime(position));
|
|
201
|
+
this.#chuiVpMain.style.setProperty("--seek_before_width", "0%");
|
|
185
202
|
return;
|
|
186
203
|
}
|
|
187
|
-
this.#
|
|
188
|
-
this.#
|
|
204
|
+
this.#chuiVpTime.setText(`${this.#calculateTime(position)} / ${this.#calculateTime(duration)}`);
|
|
205
|
+
this.#chuiVpSeek.value = String(Math.floor(position));
|
|
189
206
|
// Доля ограничена сотней: `max` — округлённая длительность, а позиция идёт дальше,
|
|
190
207
|
// и без ограничения полоса целиком заливалась акцентом
|
|
191
|
-
const доля = Math.min(100, Math.max(0, Math.floor(position / max * 100)));
|
|
192
|
-
this.#
|
|
193
|
-
}
|
|
208
|
+
const доля = Math.min(100, Math.max(0, Math.floor((position / max) * 100)));
|
|
209
|
+
this.#chuiVpMain.style.setProperty("--seek_before_width", `${доля}%`);
|
|
210
|
+
};
|
|
194
211
|
#calculateTime = (secs) => {
|
|
195
212
|
const seconds = Number.isFinite(Number(secs)) ? Number(secs) : 0;
|
|
196
213
|
const minutes = Math.floor(seconds / 60);
|
|
197
214
|
const rest = Math.floor(seconds % 60);
|
|
198
215
|
const returnedSeconds = rest < 10 ? `0${rest}` : `${rest}`;
|
|
199
216
|
return `${minutes}:${returnedSeconds}`;
|
|
217
|
+
};
|
|
218
|
+
#setStatus(text) {
|
|
219
|
+
this.#status.innerText = text;
|
|
200
220
|
}
|
|
201
|
-
#setStatus(text) { this.#status.innerText = text; }
|
|
202
221
|
#setButton(node, label, icon) {
|
|
203
|
-
node.innerHTML = new Icon(icon
|
|
222
|
+
node.innerHTML = new Icon(icon).getHTML();
|
|
204
223
|
node.setAttribute("aria-label", label);
|
|
205
224
|
makeKeyboardButton(node);
|
|
206
225
|
}
|
|
207
|
-
#setIcon(node, icon
|
|
208
|
-
const glyph = new Icon(icon
|
|
226
|
+
#setIcon(node, icon) {
|
|
227
|
+
const glyph = new Icon(icon).getHTML();
|
|
209
228
|
if (node.innerHTML !== glyph) node.innerHTML = glyph;
|
|
210
229
|
}
|
|
211
230
|
#setLabel(node, label) {
|
|
@@ -216,87 +235,161 @@ class Video {
|
|
|
216
235
|
/** Полоса управления: `false` — панели нет вовсе, остаётся только кадр */
|
|
217
236
|
setControls(boolean = Boolean()) {
|
|
218
237
|
this.#controls = boolean === true;
|
|
219
|
-
this.#
|
|
238
|
+
this.#chuiVpMain.classList.toggle("vp_controls_off", !this.#controls);
|
|
220
239
|
if (!this.#controls) this.#closePanel();
|
|
221
240
|
return this;
|
|
222
241
|
}
|
|
223
|
-
getControls() {
|
|
242
|
+
getControls() {
|
|
243
|
+
return this.#controls;
|
|
244
|
+
}
|
|
224
245
|
// === СТАНДАРТНЫЕ ВОЗМОЖНОСТИ `<video>` ===
|
|
225
246
|
/** Сам элемент: для всего, чего нет в списке ниже */
|
|
226
|
-
getVideo() {
|
|
247
|
+
getVideo() {
|
|
248
|
+
return this.#chuiVt;
|
|
249
|
+
}
|
|
227
250
|
/** Воспроизведение: промис, как у `<video>` (разрешается, когда воспроизведение началось) */
|
|
228
|
-
play() {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
251
|
+
play() {
|
|
252
|
+
return this.#chuiVt.play();
|
|
253
|
+
}
|
|
254
|
+
pause() {
|
|
255
|
+
this.#chuiVt.pause();
|
|
256
|
+
return this;
|
|
257
|
+
}
|
|
258
|
+
load() {
|
|
259
|
+
this.#chuiVt.load();
|
|
260
|
+
return this;
|
|
261
|
+
}
|
|
262
|
+
canPlayType(type = String()) {
|
|
263
|
+
return this.#chuiVt.canPlayType(type);
|
|
264
|
+
}
|
|
265
|
+
getSrc() {
|
|
266
|
+
return this.#chuiVt.getAttribute("src") ?? "";
|
|
267
|
+
}
|
|
233
268
|
setSrc(url = String()) {
|
|
234
|
-
this.#
|
|
235
|
-
this.#
|
|
269
|
+
this.#chuiVt.setAttribute("src", url);
|
|
270
|
+
this.#chuiVt.load();
|
|
236
271
|
return this;
|
|
237
272
|
}
|
|
238
|
-
getSrcObject() {
|
|
273
|
+
getSrcObject() {
|
|
274
|
+
return this.#chuiVt.srcObject;
|
|
275
|
+
}
|
|
239
276
|
/** Живой поток (камера, `getUserMedia`) — штатное `srcObject`, а не путь */
|
|
240
277
|
setSrcObject(object) {
|
|
241
|
-
this.#
|
|
278
|
+
this.#chuiVt.srcObject = object;
|
|
242
279
|
return this;
|
|
243
280
|
}
|
|
244
|
-
getPoster() {
|
|
281
|
+
getPoster() {
|
|
282
|
+
return this.#chuiVt.getAttribute("poster") ?? "";
|
|
283
|
+
}
|
|
245
284
|
setPoster(url = String()) {
|
|
246
|
-
if (url === "") this.#
|
|
247
|
-
else this.#
|
|
285
|
+
if (url === "") this.#chuiVt.removeAttribute("poster");
|
|
286
|
+
else this.#chuiVt.setAttribute("poster", url);
|
|
248
287
|
return this;
|
|
249
288
|
}
|
|
250
|
-
getCurrentTime() {
|
|
289
|
+
getCurrentTime() {
|
|
290
|
+
return this.#chuiVt.currentTime;
|
|
291
|
+
}
|
|
251
292
|
setCurrentTime(seconds = Number()) {
|
|
252
|
-
this.#
|
|
293
|
+
this.#chuiVt.currentTime = Number(seconds);
|
|
253
294
|
// Подписи и заливка не ждут `timeupdate`: перемотка из кода видна сразу
|
|
254
295
|
this.#renderProgress();
|
|
255
296
|
return this;
|
|
256
297
|
}
|
|
257
|
-
getDuration() {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
298
|
+
getDuration() {
|
|
299
|
+
return this.#chuiVt.duration;
|
|
300
|
+
}
|
|
301
|
+
getBuffered() {
|
|
302
|
+
return this.#chuiVt.buffered;
|
|
303
|
+
}
|
|
304
|
+
getPaused() {
|
|
305
|
+
return this.#chuiVt.paused;
|
|
306
|
+
}
|
|
307
|
+
getEnded() {
|
|
308
|
+
return this.#chuiVt.ended;
|
|
309
|
+
}
|
|
310
|
+
getReadyState() {
|
|
311
|
+
return this.#chuiVt.readyState;
|
|
312
|
+
}
|
|
313
|
+
getVolume() {
|
|
314
|
+
return this.#chuiVt.volume;
|
|
315
|
+
}
|
|
263
316
|
setVolume(value = Number()) {
|
|
264
|
-
this.#
|
|
317
|
+
this.#chuiVt.volume = Math.min(1, Math.max(0, Number(value)));
|
|
265
318
|
return this;
|
|
266
319
|
}
|
|
267
|
-
getMuted() {
|
|
320
|
+
getMuted() {
|
|
321
|
+
return this.#chuiVt.muted;
|
|
322
|
+
}
|
|
268
323
|
setMuted(boolean = Boolean()) {
|
|
269
|
-
this.#
|
|
324
|
+
this.#chuiVt.muted = boolean === true;
|
|
270
325
|
return this;
|
|
271
326
|
}
|
|
272
|
-
getPlaybackRate() {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
327
|
+
getPlaybackRate() {
|
|
328
|
+
return this.#chuiVt.playbackRate;
|
|
329
|
+
}
|
|
330
|
+
setPlaybackRate(rate = Number()) {
|
|
331
|
+
this.#chuiVt.playbackRate = Number(rate);
|
|
332
|
+
return this;
|
|
333
|
+
}
|
|
334
|
+
getDefaultPlaybackRate() {
|
|
335
|
+
return this.#chuiVt.defaultPlaybackRate;
|
|
336
|
+
}
|
|
337
|
+
setDefaultPlaybackRate(rate = Number()) {
|
|
338
|
+
this.#chuiVt.defaultPlaybackRate = Number(rate);
|
|
339
|
+
return this;
|
|
340
|
+
}
|
|
341
|
+
getLoop() {
|
|
342
|
+
return this.#chuiVt.loop;
|
|
343
|
+
}
|
|
344
|
+
setLoop(boolean = Boolean()) {
|
|
345
|
+
this.#chuiVt.loop = boolean === true;
|
|
346
|
+
return this;
|
|
347
|
+
}
|
|
348
|
+
getAutoplay() {
|
|
349
|
+
return this.#chuiVt.autoplay;
|
|
350
|
+
}
|
|
351
|
+
setAutoplay(boolean = Boolean()) {
|
|
352
|
+
this.#chuiVt.autoplay = boolean === true;
|
|
353
|
+
return this;
|
|
354
|
+
}
|
|
355
|
+
getWidth() {
|
|
356
|
+
return getComputedStyle(this.#chuiVt).width;
|
|
357
|
+
}
|
|
358
|
+
setWidth(value = String()) {
|
|
359
|
+
this.#chuiVt.style.width = value;
|
|
360
|
+
return this;
|
|
361
|
+
}
|
|
362
|
+
getHeight() {
|
|
363
|
+
return getComputedStyle(this.#chuiVt).height;
|
|
364
|
+
}
|
|
365
|
+
setHeight(value = String()) {
|
|
366
|
+
this.#chuiVt.style.height = value;
|
|
367
|
+
return this;
|
|
368
|
+
}
|
|
369
|
+
getFullscreen() {
|
|
370
|
+
return this.#chuiVpMain === document.fullscreenElement;
|
|
371
|
+
}
|
|
285
372
|
/** Полный экран — на весь плеер, а не на кадр: иначе полоса управления осталась бы снаружи */
|
|
286
|
-
requestFullscreen() {
|
|
287
|
-
|
|
373
|
+
requestFullscreen() {
|
|
374
|
+
return this.#chuiVpMain.requestFullscreen({ navigationUI: "hide" });
|
|
375
|
+
}
|
|
376
|
+
exitFullscreen() {
|
|
377
|
+
return document.exitFullscreen();
|
|
378
|
+
}
|
|
288
379
|
addEventListener(type = String(), listener = () => {}) {
|
|
289
|
-
this.#
|
|
380
|
+
this.#chuiVt.addEventListener(type, listener);
|
|
290
381
|
return this;
|
|
291
382
|
}
|
|
292
383
|
removeEventListener(type = String(), listener = () => {}) {
|
|
293
|
-
this.#
|
|
384
|
+
this.#chuiVt.removeEventListener(type, listener);
|
|
294
385
|
return this;
|
|
295
386
|
}
|
|
296
|
-
set() {
|
|
387
|
+
set() {
|
|
388
|
+
return this.#chuiVpMain;
|
|
389
|
+
}
|
|
297
390
|
detach() {
|
|
298
391
|
this.pause();
|
|
299
|
-
this.#
|
|
392
|
+
this.#chuiVpMain.remove();
|
|
300
393
|
return this;
|
|
301
394
|
}
|
|
302
395
|
/** Остановить плеер и снять свои обработчики. Повторный вызов безопасен */
|
|
@@ -304,20 +397,20 @@ class Video {
|
|
|
304
397
|
if (this.#destroyed) return this;
|
|
305
398
|
this.#destroyed = true;
|
|
306
399
|
this.pause();
|
|
307
|
-
this.#
|
|
308
|
-
this.#
|
|
309
|
-
this.#
|
|
310
|
-
this.#
|
|
311
|
-
this.#
|
|
312
|
-
this.#
|
|
313
|
-
this.#
|
|
314
|
-
this.#
|
|
315
|
-
this.#
|
|
316
|
-
this.#
|
|
317
|
-
this.#
|
|
318
|
-
this.#
|
|
400
|
+
this.#chuiVt.removeEventListener("play", this.#onPlay);
|
|
401
|
+
this.#chuiVt.removeEventListener("pause", this.#onPause);
|
|
402
|
+
this.#chuiVt.removeEventListener("timeupdate", this.#onTimeUpdate);
|
|
403
|
+
this.#chuiVt.removeEventListener("durationchange", this.#onDurationChange);
|
|
404
|
+
this.#chuiVt.removeEventListener("loadedmetadata", this.#onDurationChange);
|
|
405
|
+
this.#chuiVt.removeEventListener("progress", this.#onBuffered);
|
|
406
|
+
this.#chuiVpMain.removeEventListener("mouseenter", this.#onEnter);
|
|
407
|
+
this.#chuiVpMain.removeEventListener("mouseleave", this.#onLeave);
|
|
408
|
+
this.#chuiVpMain.removeEventListener("focusin", this.#onEnter);
|
|
409
|
+
this.#chuiVpMain.removeEventListener("focusout", this.#onLeave);
|
|
410
|
+
this.#chuiVt.removeAttribute("src");
|
|
411
|
+
this.#chuiVt.load();
|
|
319
412
|
return this;
|
|
320
413
|
}
|
|
321
414
|
}
|
|
322
415
|
|
|
323
|
-
exports.Video = Video
|
|
416
|
+
exports.Video = Video;
|