react-native-theoplayer 2.7.0 → 2.9.0
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 +76 -13
- package/README.md +16 -2
- package/android/build.gradle +1 -1
- package/android/local/com/theoplayer/android-connector/mediasession/5.2.0-local/mediasession-5.2.0-local.aar +0 -0
- package/android/local/com/theoplayer/android-connector/mediasession/{4.12.0-local/mediasession-4.12.0-local.pom → 5.2.0-local/mediasession-5.2.0-local.pom} +1 -1
- package/android/local/com/theoplayer/android-connector/mediasession/maven-metadata-local.xml +4 -4
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/java/com/theoplayer/PlayerEventEmitter.kt +1 -1
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerContext.kt +36 -20
- package/android/src/main/java/com/theoplayer/media/CustomMediaButtonReceiver.kt +25 -0
- package/android/src/main/java/com/theoplayer/{audio → media}/MediaNotificationBuilder.kt +6 -1
- package/android/src/main/java/com/theoplayer/{audio → media}/MediaPlaybackService.kt +39 -11
- package/android/src/main/java/com/theoplayer/source/SourceAdapter.kt +12 -0
- package/android/src/main/java/com/theoplayer/track/TrackListAdapter.kt +17 -13
- package/ios/contentprotection/THEOplayerRCTProxyContentProtectionIntegration.swift +19 -29
- package/lib/commonjs/api/cast/Chromecast.js.map +1 -1
- package/lib/commonjs/api/source/dash/DashPlaybackConfiguration.js.map +1 -1
- package/lib/commonjs/api/track/TextTrack.js.map +1 -1
- package/lib/commonjs/index.js +0 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal/adapter/THEOplayerAdapter.js +17 -0
- package/lib/commonjs/internal/adapter/THEOplayerAdapter.js.map +1 -1
- package/lib/commonjs/internal/adapter/web/FullscreenAPI.js +41 -0
- package/lib/commonjs/internal/adapter/web/FullscreenAPI.js.map +1 -0
- package/lib/commonjs/internal/adapter/web/WebPresentationModeManager.js +45 -39
- package/lib/commonjs/internal/adapter/web/WebPresentationModeManager.js.map +1 -1
- package/lib/commonjs/internal/utils/CommonUtils.js +10 -0
- package/lib/commonjs/internal/utils/CommonUtils.js.map +1 -0
- package/lib/module/api/cast/Chromecast.js.map +1 -1
- package/lib/module/api/source/dash/DashPlaybackConfiguration.js.map +1 -1
- package/lib/module/api/track/TextTrack.js.map +1 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/adapter/THEOplayerAdapter.js +18 -1
- package/lib/module/internal/adapter/THEOplayerAdapter.js.map +1 -1
- package/lib/module/internal/adapter/web/FullscreenAPI.js +34 -0
- package/lib/module/internal/adapter/web/FullscreenAPI.js.map +1 -0
- package/lib/module/internal/adapter/web/WebPresentationModeManager.js +45 -39
- package/lib/module/internal/adapter/web/WebPresentationModeManager.js.map +1 -1
- package/lib/module/internal/utils/CommonUtils.js +4 -0
- package/lib/module/internal/utils/CommonUtils.js.map +1 -0
- package/lib/typescript/api/cast/Chromecast.d.ts +1 -1
- package/lib/typescript/api/source/dash/DashPlaybackConfiguration.d.ts +52 -0
- package/lib/typescript/api/track/TextTrack.d.ts +2 -2
- package/lib/typescript/index.d.ts +0 -1
- package/lib/typescript/internal/adapter/THEOplayerAdapter.d.ts +1 -0
- package/lib/typescript/internal/adapter/web/FullscreenAPI.d.ts +9 -0
- package/lib/typescript/internal/utils/CommonUtils.d.ts +1 -0
- package/package.json +2 -8
- package/react-native-theoplayer.podspec +1 -1
- package/src/api/cast/Chromecast.ts +1 -1
- package/src/api/source/dash/DashPlaybackConfiguration.ts +56 -0
- package/src/api/track/TextTrack.ts +2 -2
- package/src/index.tsx +0 -1
- package/src/internal/adapter/THEOplayerAdapter.ts +19 -0
- package/src/internal/adapter/web/FullscreenAPI.ts +59 -0
- package/src/internal/adapter/web/WebPresentationModeManager.ts +29 -22
- package/src/internal/utils/CommonUtils.ts +3 -0
- package/android/local/com/theoplayer/android-connector/mediasession/4.12.0-local/mediasession-4.12.0-local.aar +0 -0
- package/lib/commonjs/ui/THEOplayerDefaultUi.js +0 -82
- package/lib/commonjs/ui/THEOplayerDefaultUi.js.map +0 -1
- package/lib/commonjs/ui/THEOplayerTheme.js +0 -48
- package/lib/commonjs/ui/THEOplayerTheme.js.map +0 -1
- package/lib/commonjs/ui/barrel.js +0 -39
- package/lib/commonjs/ui/barrel.js.map +0 -1
- package/lib/commonjs/ui/components/activityindicator/CenteredDelayedActivityIndicator.js +0 -99
- package/lib/commonjs/ui/components/activityindicator/CenteredDelayedActivityIndicator.js.map +0 -1
- package/lib/commonjs/ui/components/activityindicator/DelayedActivityIndicator.js +0 -35
- package/lib/commonjs/ui/components/activityindicator/DelayedActivityIndicator.js.map +0 -1
- package/lib/commonjs/ui/components/activityindicator/barrel.js +0 -28
- package/lib/commonjs/ui/components/activityindicator/barrel.js.map +0 -1
- package/lib/commonjs/ui/components/barrel.js +0 -105
- package/lib/commonjs/ui/components/barrel.js.map +0 -1
- package/lib/commonjs/ui/components/button/AirplayButton.js +0 -81
- package/lib/commonjs/ui/components/button/AirplayButton.js.map +0 -1
- package/lib/commonjs/ui/components/button/ChromecastButton.js +0 -66
- package/lib/commonjs/ui/components/button/ChromecastButton.js.map +0 -1
- package/lib/commonjs/ui/components/button/ChromecastButton.web.js +0 -82
- package/lib/commonjs/ui/components/button/ChromecastButton.web.js.map +0 -1
- package/lib/commonjs/ui/components/button/FullscreenButton.js +0 -72
- package/lib/commonjs/ui/components/button/FullscreenButton.js.map +0 -1
- package/lib/commonjs/ui/components/button/MuteButton.js +0 -66
- package/lib/commonjs/ui/components/button/MuteButton.js.map +0 -1
- package/lib/commonjs/ui/components/button/PipButton.js +0 -72
- package/lib/commonjs/ui/components/button/PipButton.js.map +0 -1
- package/lib/commonjs/ui/components/button/PlayButton.js +0 -113
- package/lib/commonjs/ui/components/button/PlayButton.js.map +0 -1
- package/lib/commonjs/ui/components/button/SkipButton.js +0 -122
- package/lib/commonjs/ui/components/button/SkipButton.js.map +0 -1
- package/lib/commonjs/ui/components/button/actionbutton/ActionButton.js +0 -82
- package/lib/commonjs/ui/components/button/actionbutton/ActionButton.js.map +0 -1
- package/lib/commonjs/ui/components/button/barrel.js +0 -105
- package/lib/commonjs/ui/components/button/barrel.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/AirplaySvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/AirplaySvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/ArrowForwardSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/ArrowForwardSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/BackSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/BackSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/BackwardSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/BackwardSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/ChromecastSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/ChromecastSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/ErrorSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/ErrorSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/ForwardSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/ForwardSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/FullscreenEnterSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/FullscreenEnterSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/FullscreenExitSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/FullscreenExitSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/LanguageSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/LanguageSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/ListSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/ListSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/PauseSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/PauseSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/PipEnterSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/PipEnterSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/PipExitSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/PipExitSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/PlaySvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/PlaySvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/ReplaySvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/ReplaySvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/SettingsSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/SettingsSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/SvgUtils.js +0 -13
- package/lib/commonjs/ui/components/button/svg/SvgUtils.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/VolumeOffSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/VolumeOffSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/VolumeUpSvg.js +0 -22
- package/lib/commonjs/ui/components/button/svg/VolumeUpSvg.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/barrel.js +0 -226
- package/lib/commonjs/ui/components/button/svg/barrel.js.map +0 -1
- package/lib/commonjs/ui/components/button/svg/res/AirPlayButton.html +0 -6
- package/lib/commonjs/ui/components/button/svg/res/Airplay.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/ChromecastButton.html +0 -25
- package/lib/commonjs/ui/components/button/svg/res/arrow_forward.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/back.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/backward.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/chromecast-48px.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/close.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/error.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/forward.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/fullscreen-enter.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/fullscreen-exit.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/language.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/list.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/live.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/pause.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/pip_enter.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/pip_exit.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/play.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/replay.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/settings.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/skip-next.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/volume-high.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/volume-low.svg +0 -1
- package/lib/commonjs/ui/components/button/svg/res/volume-off.svg +0 -1
- package/lib/commonjs/ui/components/controlbar/ControlBar.js +0 -61
- package/lib/commonjs/ui/components/controlbar/ControlBar.js.map +0 -1
- package/lib/commonjs/ui/components/controlbar/Spacer.js +0 -21
- package/lib/commonjs/ui/components/controlbar/Spacer.js.map +0 -1
- package/lib/commonjs/ui/components/controlbar/barrel.js +0 -28
- package/lib/commonjs/ui/components/controlbar/barrel.js.map +0 -1
- package/lib/commonjs/ui/components/menu/LanguageMenuButton.js +0 -175
- package/lib/commonjs/ui/components/menu/LanguageMenuButton.js.map +0 -1
- package/lib/commonjs/ui/components/menu/PlaybackRateSubMenu.js +0 -91
- package/lib/commonjs/ui/components/menu/PlaybackRateSubMenu.js.map +0 -1
- package/lib/commonjs/ui/components/menu/QualitySubMenu.js +0 -145
- package/lib/commonjs/ui/components/menu/QualitySubMenu.js.map +0 -1
- package/lib/commonjs/ui/components/menu/SettingsMenuButton.js +0 -36
- package/lib/commonjs/ui/components/menu/SettingsMenuButton.js.map +0 -1
- package/lib/commonjs/ui/components/menu/barrel.js +0 -61
- package/lib/commonjs/ui/components/menu/barrel.js.map +0 -1
- package/lib/commonjs/ui/components/menu/common/MenuButton.js +0 -34
- package/lib/commonjs/ui/components/menu/common/MenuButton.js.map +0 -1
- package/lib/commonjs/ui/components/menu/common/MenuRadioButton.js +0 -47
- package/lib/commonjs/ui/components/menu/common/MenuRadioButton.js.map +0 -1
- package/lib/commonjs/ui/components/menu/common/MenuTitle.js +0 -38
- package/lib/commonjs/ui/components/menu/common/MenuTitle.js.map +0 -1
- package/lib/commonjs/ui/components/menu/common/MenuView.js +0 -75
- package/lib/commonjs/ui/components/menu/common/MenuView.js.map +0 -1
- package/lib/commonjs/ui/components/menu/common/ScrollableMenu.js +0 -45
- package/lib/commonjs/ui/components/menu/common/ScrollableMenu.js.map +0 -1
- package/lib/commonjs/ui/components/menu/common/SubMenuWithButton.js +0 -65
- package/lib/commonjs/ui/components/menu/common/SubMenuWithButton.js.map +0 -1
- package/lib/commonjs/ui/components/menu/common/barrel.js +0 -72
- package/lib/commonjs/ui/components/menu/common/barrel.js.map +0 -1
- package/lib/commonjs/ui/components/message/CastMessage.js +0 -79
- package/lib/commonjs/ui/components/message/CastMessage.js.map +0 -1
- package/lib/commonjs/ui/components/message/ErrorDisplay.js +0 -53
- package/lib/commonjs/ui/components/message/ErrorDisplay.js.map +0 -1
- package/lib/commonjs/ui/components/message/barrel.js +0 -28
- package/lib/commonjs/ui/components/message/barrel.js.map +0 -1
- package/lib/commonjs/ui/components/seekbar/SeekBar.js +0 -194
- package/lib/commonjs/ui/components/seekbar/SeekBar.js.map +0 -1
- package/lib/commonjs/ui/components/seekbar/barrel.js +0 -28
- package/lib/commonjs/ui/components/seekbar/barrel.js.map +0 -1
- package/lib/commonjs/ui/components/seekbar/thumbnail/SingleThumbnailView.js +0 -45
- package/lib/commonjs/ui/components/seekbar/thumbnail/SingleThumbnailView.js.map +0 -1
- package/lib/commonjs/ui/components/seekbar/thumbnail/Thumbnail.js +0 -18
- package/lib/commonjs/ui/components/seekbar/thumbnail/Thumbnail.js.map +0 -1
- package/lib/commonjs/ui/components/seekbar/thumbnail/ThumbnailView.js +0 -256
- package/lib/commonjs/ui/components/seekbar/thumbnail/ThumbnailView.js.map +0 -1
- package/lib/commonjs/ui/components/seekbar/thumbnail/Urlpolyfill.js +0 -17
- package/lib/commonjs/ui/components/seekbar/thumbnail/Urlpolyfill.js.map +0 -1
- package/lib/commonjs/ui/components/seekbar/thumbnail/Urlpolyfill.web.js +0 -17
- package/lib/commonjs/ui/components/seekbar/thumbnail/Urlpolyfill.web.js.map +0 -1
- package/lib/commonjs/ui/components/seekbar/thumbnail/barrel.js +0 -28
- package/lib/commonjs/ui/components/seekbar/thumbnail/barrel.js.map +0 -1
- package/lib/commonjs/ui/components/timelabel/StaticTimeLabel.js +0 -55
- package/lib/commonjs/ui/components/timelabel/StaticTimeLabel.js.map +0 -1
- package/lib/commonjs/ui/components/timelabel/TimeLabel.js +0 -88
- package/lib/commonjs/ui/components/timelabel/TimeLabel.js.map +0 -1
- package/lib/commonjs/ui/components/timelabel/barrel.js +0 -28
- package/lib/commonjs/ui/components/timelabel/barrel.js.map +0 -1
- package/lib/commonjs/ui/components/uicontroller/UiContainer.js +0 -350
- package/lib/commonjs/ui/components/uicontroller/UiContainer.js.map +0 -1
- package/lib/commonjs/ui/components/uicontroller/UiControls.js +0 -6
- package/lib/commonjs/ui/components/uicontroller/UiControls.js.map +0 -1
- package/lib/commonjs/ui/components/uicontroller/barrel.js +0 -28
- package/lib/commonjs/ui/components/uicontroller/barrel.js.map +0 -1
- package/lib/commonjs/ui/components/util/PlayerContext.js +0 -19
- package/lib/commonjs/ui/components/util/PlayerContext.js.map +0 -1
- package/lib/commonjs/ui/components/util/TrackUtils.js +0 -69
- package/lib/commonjs/ui/components/util/TrackUtils.js.map +0 -1
- package/lib/commonjs/ui/components/util/barrel.js +0 -17
- package/lib/commonjs/ui/components/util/barrel.js.map +0 -1
- package/lib/commonjs/ui/utils/ArrayUtils.js +0 -19
- package/lib/commonjs/ui/utils/ArrayUtils.js.map +0 -1
- package/lib/commonjs/ui/utils/language/Language.js +0 -38
- package/lib/commonjs/ui/utils/language/Language.js.map +0 -1
- package/lib/commonjs/ui/utils/language/languages.json +0 -1658
- package/lib/commonjs/web/platform/BrowserDetection.js +0 -34
- package/lib/commonjs/web/platform/BrowserDetection.js.map +0 -1
- package/lib/module/ui/THEOplayerDefaultUi.js +0 -74
- package/lib/module/ui/THEOplayerDefaultUi.js.map +0 -1
- package/lib/module/ui/THEOplayerTheme.js +0 -41
- package/lib/module/ui/THEOplayerTheme.js.map +0 -1
- package/lib/module/ui/barrel.js +0 -4
- package/lib/module/ui/barrel.js.map +0 -1
- package/lib/module/ui/components/activityindicator/CenteredDelayedActivityIndicator.js +0 -90
- package/lib/module/ui/components/activityindicator/CenteredDelayedActivityIndicator.js.map +0 -1
- package/lib/module/ui/components/activityindicator/DelayedActivityIndicator.js +0 -26
- package/lib/module/ui/components/activityindicator/DelayedActivityIndicator.js.map +0 -1
- package/lib/module/ui/components/activityindicator/barrel.js +0 -3
- package/lib/module/ui/components/activityindicator/barrel.js.map +0 -1
- package/lib/module/ui/components/barrel.js +0 -10
- package/lib/module/ui/components/barrel.js.map +0 -1
- package/lib/module/ui/components/button/AirplayButton.js +0 -72
- package/lib/module/ui/components/button/AirplayButton.js.map +0 -1
- package/lib/module/ui/components/button/ChromecastButton.js +0 -56
- package/lib/module/ui/components/button/ChromecastButton.js.map +0 -1
- package/lib/module/ui/components/button/ChromecastButton.web.js +0 -72
- package/lib/module/ui/components/button/ChromecastButton.web.js.map +0 -1
- package/lib/module/ui/components/button/FullscreenButton.js +0 -63
- package/lib/module/ui/components/button/FullscreenButton.js.map +0 -1
- package/lib/module/ui/components/button/MuteButton.js +0 -57
- package/lib/module/ui/components/button/MuteButton.js.map +0 -1
- package/lib/module/ui/components/button/PipButton.js +0 -63
- package/lib/module/ui/components/button/PipButton.js.map +0 -1
- package/lib/module/ui/components/button/PlayButton.js +0 -104
- package/lib/module/ui/components/button/PlayButton.js.map +0 -1
- package/lib/module/ui/components/button/SkipButton.js +0 -113
- package/lib/module/ui/components/button/SkipButton.js.map +0 -1
- package/lib/module/ui/components/button/actionbutton/ActionButton.js +0 -72
- package/lib/module/ui/components/button/actionbutton/ActionButton.js.map +0 -1
- package/lib/module/ui/components/button/barrel.js +0 -10
- package/lib/module/ui/components/button/barrel.js.map +0 -1
- package/lib/module/ui/components/button/svg/AirplaySvg.js +0 -12
- package/lib/module/ui/components/button/svg/AirplaySvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/ArrowForwardSvg.js +0 -12
- package/lib/module/ui/components/button/svg/ArrowForwardSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/BackSvg.js +0 -12
- package/lib/module/ui/components/button/svg/BackSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/BackwardSvg.js +0 -12
- package/lib/module/ui/components/button/svg/BackwardSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/ChromecastSvg.js +0 -12
- package/lib/module/ui/components/button/svg/ChromecastSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/ErrorSvg.js +0 -12
- package/lib/module/ui/components/button/svg/ErrorSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/ForwardSvg.js +0 -12
- package/lib/module/ui/components/button/svg/ForwardSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/FullscreenEnterSvg.js +0 -12
- package/lib/module/ui/components/button/svg/FullscreenEnterSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/FullscreenExitSvg.js +0 -12
- package/lib/module/ui/components/button/svg/FullscreenExitSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/LanguageSvg.js +0 -12
- package/lib/module/ui/components/button/svg/LanguageSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/ListSvg.js +0 -12
- package/lib/module/ui/components/button/svg/ListSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/PauseSvg.js +0 -12
- package/lib/module/ui/components/button/svg/PauseSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/PipEnterSvg.js +0 -12
- package/lib/module/ui/components/button/svg/PipEnterSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/PipExitSvg.js +0 -12
- package/lib/module/ui/components/button/svg/PipExitSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/PlaySvg.js +0 -12
- package/lib/module/ui/components/button/svg/PlaySvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/ReplaySvg.js +0 -12
- package/lib/module/ui/components/button/svg/ReplaySvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/SettingsSvg.js +0 -12
- package/lib/module/ui/components/button/svg/SettingsSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/SvgUtils.js +0 -5
- package/lib/module/ui/components/button/svg/SvgUtils.js.map +0 -1
- package/lib/module/ui/components/button/svg/VolumeOffSvg.js +0 -12
- package/lib/module/ui/components/button/svg/VolumeOffSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/VolumeUpSvg.js +0 -12
- package/lib/module/ui/components/button/svg/VolumeUpSvg.js.map +0 -1
- package/lib/module/ui/components/button/svg/barrel.js +0 -21
- package/lib/module/ui/components/button/svg/barrel.js.map +0 -1
- package/lib/module/ui/components/button/svg/res/AirPlayButton.html +0 -6
- package/lib/module/ui/components/button/svg/res/Airplay.svg +0 -1
- package/lib/module/ui/components/button/svg/res/ChromecastButton.html +0 -25
- package/lib/module/ui/components/button/svg/res/arrow_forward.svg +0 -1
- package/lib/module/ui/components/button/svg/res/back.svg +0 -1
- package/lib/module/ui/components/button/svg/res/backward.svg +0 -1
- package/lib/module/ui/components/button/svg/res/chromecast-48px.svg +0 -1
- package/lib/module/ui/components/button/svg/res/close.svg +0 -1
- package/lib/module/ui/components/button/svg/res/error.svg +0 -1
- package/lib/module/ui/components/button/svg/res/forward.svg +0 -1
- package/lib/module/ui/components/button/svg/res/fullscreen-enter.svg +0 -1
- package/lib/module/ui/components/button/svg/res/fullscreen-exit.svg +0 -1
- package/lib/module/ui/components/button/svg/res/language.svg +0 -1
- package/lib/module/ui/components/button/svg/res/list.svg +0 -1
- package/lib/module/ui/components/button/svg/res/live.svg +0 -1
- package/lib/module/ui/components/button/svg/res/pause.svg +0 -1
- package/lib/module/ui/components/button/svg/res/pip_enter.svg +0 -1
- package/lib/module/ui/components/button/svg/res/pip_exit.svg +0 -1
- package/lib/module/ui/components/button/svg/res/play.svg +0 -1
- package/lib/module/ui/components/button/svg/res/replay.svg +0 -1
- package/lib/module/ui/components/button/svg/res/settings.svg +0 -1
- package/lib/module/ui/components/button/svg/res/skip-next.svg +0 -1
- package/lib/module/ui/components/button/svg/res/volume-high.svg +0 -1
- package/lib/module/ui/components/button/svg/res/volume-low.svg +0 -1
- package/lib/module/ui/components/button/svg/res/volume-off.svg +0 -1
- package/lib/module/ui/components/controlbar/ControlBar.js +0 -52
- package/lib/module/ui/components/controlbar/ControlBar.js.map +0 -1
- package/lib/module/ui/components/controlbar/Spacer.js +0 -14
- package/lib/module/ui/components/controlbar/Spacer.js.map +0 -1
- package/lib/module/ui/components/controlbar/barrel.js +0 -3
- package/lib/module/ui/components/controlbar/barrel.js.map +0 -1
- package/lib/module/ui/components/menu/LanguageMenuButton.js +0 -165
- package/lib/module/ui/components/menu/LanguageMenuButton.js.map +0 -1
- package/lib/module/ui/components/menu/PlaybackRateSubMenu.js +0 -80
- package/lib/module/ui/components/menu/PlaybackRateSubMenu.js.map +0 -1
- package/lib/module/ui/components/menu/QualitySubMenu.js +0 -135
- package/lib/module/ui/components/menu/QualitySubMenu.js.map +0 -1
- package/lib/module/ui/components/menu/SettingsMenuButton.js +0 -28
- package/lib/module/ui/components/menu/SettingsMenuButton.js.map +0 -1
- package/lib/module/ui/components/menu/barrel.js +0 -6
- package/lib/module/ui/components/menu/barrel.js.map +0 -1
- package/lib/module/ui/components/menu/common/MenuButton.js +0 -26
- package/lib/module/ui/components/menu/common/MenuButton.js.map +0 -1
- package/lib/module/ui/components/menu/common/MenuRadioButton.js +0 -38
- package/lib/module/ui/components/menu/common/MenuRadioButton.js.map +0 -1
- package/lib/module/ui/components/menu/common/MenuTitle.js +0 -29
- package/lib/module/ui/components/menu/common/MenuTitle.js.map +0 -1
- package/lib/module/ui/components/menu/common/MenuView.js +0 -65
- package/lib/module/ui/components/menu/common/MenuView.js.map +0 -1
- package/lib/module/ui/components/menu/common/ScrollableMenu.js +0 -36
- package/lib/module/ui/components/menu/common/ScrollableMenu.js.map +0 -1
- package/lib/module/ui/components/menu/common/SubMenuWithButton.js +0 -56
- package/lib/module/ui/components/menu/common/SubMenuWithButton.js.map +0 -1
- package/lib/module/ui/components/menu/common/barrel.js +0 -7
- package/lib/module/ui/components/menu/common/barrel.js.map +0 -1
- package/lib/module/ui/components/message/CastMessage.js +0 -70
- package/lib/module/ui/components/message/CastMessage.js.map +0 -1
- package/lib/module/ui/components/message/ErrorDisplay.js +0 -46
- package/lib/module/ui/components/message/ErrorDisplay.js.map +0 -1
- package/lib/module/ui/components/message/barrel.js +0 -3
- package/lib/module/ui/components/message/barrel.js.map +0 -1
- package/lib/module/ui/components/seekbar/SeekBar.js +0 -184
- package/lib/module/ui/components/seekbar/SeekBar.js.map +0 -1
- package/lib/module/ui/components/seekbar/barrel.js +0 -3
- package/lib/module/ui/components/seekbar/barrel.js.map +0 -1
- package/lib/module/ui/components/seekbar/thumbnail/SingleThumbnailView.js +0 -37
- package/lib/module/ui/components/seekbar/thumbnail/SingleThumbnailView.js.map +0 -1
- package/lib/module/ui/components/seekbar/thumbnail/Thumbnail.js +0 -11
- package/lib/module/ui/components/seekbar/thumbnail/Thumbnail.js.map +0 -1
- package/lib/module/ui/components/seekbar/thumbnail/ThumbnailView.js +0 -246
- package/lib/module/ui/components/seekbar/thumbnail/ThumbnailView.js.map +0 -1
- package/lib/module/ui/components/seekbar/thumbnail/Urlpolyfill.js +0 -2
- package/lib/module/ui/components/seekbar/thumbnail/Urlpolyfill.js.map +0 -1
- package/lib/module/ui/components/seekbar/thumbnail/Urlpolyfill.web.js +0 -3
- package/lib/module/ui/components/seekbar/thumbnail/Urlpolyfill.web.js.map +0 -1
- package/lib/module/ui/components/seekbar/thumbnail/barrel.js +0 -3
- package/lib/module/ui/components/seekbar/thumbnail/barrel.js.map +0 -1
- package/lib/module/ui/components/timelabel/StaticTimeLabel.js +0 -48
- package/lib/module/ui/components/timelabel/StaticTimeLabel.js.map +0 -1
- package/lib/module/ui/components/timelabel/TimeLabel.js +0 -78
- package/lib/module/ui/components/timelabel/TimeLabel.js.map +0 -1
- package/lib/module/ui/components/timelabel/barrel.js +0 -3
- package/lib/module/ui/components/timelabel/barrel.js.map +0 -1
- package/lib/module/ui/components/uicontroller/UiContainer.js +0 -336
- package/lib/module/ui/components/uicontroller/UiContainer.js.map +0 -1
- package/lib/module/ui/components/uicontroller/UiControls.js +0 -2
- package/lib/module/ui/components/uicontroller/UiControls.js.map +0 -1
- package/lib/module/ui/components/uicontroller/barrel.js +0 -3
- package/lib/module/ui/components/uicontroller/barrel.js.map +0 -1
- package/lib/module/ui/components/util/PlayerContext.js +0 -11
- package/lib/module/ui/components/util/PlayerContext.js.map +0 -1
- package/lib/module/ui/components/util/TrackUtils.js +0 -60
- package/lib/module/ui/components/util/TrackUtils.js.map +0 -1
- package/lib/module/ui/components/util/barrel.js +0 -2
- package/lib/module/ui/components/util/barrel.js.map +0 -1
- package/lib/module/ui/utils/ArrayUtils.js +0 -12
- package/lib/module/ui/utils/ArrayUtils.js.map +0 -1
- package/lib/module/ui/utils/language/Language.js +0 -27
- package/lib/module/ui/utils/language/Language.js.map +0 -1
- package/lib/module/ui/utils/language/languages.json +0 -1658
- package/lib/module/web/platform/BrowserDetection.js +0 -27
- package/lib/module/web/platform/BrowserDetection.js.map +0 -1
- package/lib/typescript/ui/THEOplayerDefaultUi.d.ts +0 -35
- package/lib/typescript/ui/THEOplayerTheme.d.ts +0 -84
- package/lib/typescript/ui/barrel.d.ts +0 -3
- package/lib/typescript/ui/components/activityindicator/CenteredDelayedActivityIndicator.d.ts +0 -25
- package/lib/typescript/ui/components/activityindicator/DelayedActivityIndicator.d.ts +0 -9
- package/lib/typescript/ui/components/activityindicator/barrel.d.ts +0 -2
- package/lib/typescript/ui/components/barrel.d.ts +0 -9
- package/lib/typescript/ui/components/button/AirplayButton.d.ts +0 -18
- package/lib/typescript/ui/components/button/ChromecastButton.d.ts +0 -19
- package/lib/typescript/ui/components/button/ChromecastButton.web.d.ts +0 -19
- package/lib/typescript/ui/components/button/FullscreenButton.d.ts +0 -17
- package/lib/typescript/ui/components/button/MuteButton.d.ts +0 -16
- package/lib/typescript/ui/components/button/PipButton.d.ts +0 -17
- package/lib/typescript/ui/components/button/PlayButton.d.ts +0 -28
- package/lib/typescript/ui/components/button/SkipButton.d.ts +0 -33
- package/lib/typescript/ui/components/button/actionbutton/ActionButton.d.ts +0 -41
- package/lib/typescript/ui/components/button/barrel.d.ts +0 -9
- package/lib/typescript/ui/components/button/svg/AirplaySvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/ArrowForwardSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/BackSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/BackwardSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/ChromecastSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/ErrorSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/ForwardSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/FullscreenEnterSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/FullscreenExitSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/LanguageSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/ListSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/PauseSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/PipEnterSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/PipExitSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/PlaySvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/ReplaySvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/SettingsSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/SvgUtils.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/VolumeOffSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/VolumeUpSvg.d.ts +0 -3
- package/lib/typescript/ui/components/button/svg/barrel.d.ts +0 -20
- package/lib/typescript/ui/components/controlbar/ControlBar.d.ts +0 -39
- package/lib/typescript/ui/components/controlbar/Spacer.d.ts +0 -5
- package/lib/typescript/ui/components/controlbar/barrel.d.ts +0 -2
- package/lib/typescript/ui/components/menu/LanguageMenuButton.d.ts +0 -40
- package/lib/typescript/ui/components/menu/PlaybackRateSubMenu.d.ts +0 -36
- package/lib/typescript/ui/components/menu/QualitySubMenu.d.ts +0 -29
- package/lib/typescript/ui/components/menu/SettingsMenuButton.d.ts +0 -12
- package/lib/typescript/ui/components/menu/barrel.d.ts +0 -5
- package/lib/typescript/ui/components/menu/common/MenuButton.d.ts +0 -25
- package/lib/typescript/ui/components/menu/common/MenuRadioButton.d.ts +0 -33
- package/lib/typescript/ui/components/menu/common/MenuTitle.d.ts +0 -20
- package/lib/typescript/ui/components/menu/common/MenuView.d.ts +0 -21
- package/lib/typescript/ui/components/menu/common/ScrollableMenu.d.ts +0 -23
- package/lib/typescript/ui/components/menu/common/SubMenuWithButton.d.ts +0 -29
- package/lib/typescript/ui/components/menu/common/barrel.d.ts +0 -6
- package/lib/typescript/ui/components/message/CastMessage.d.ts +0 -16
- package/lib/typescript/ui/components/message/ErrorDisplay.d.ts +0 -12
- package/lib/typescript/ui/components/message/barrel.d.ts +0 -2
- package/lib/typescript/ui/components/seekbar/SeekBar.d.ts +0 -41
- package/lib/typescript/ui/components/seekbar/barrel.d.ts +0 -2
- package/lib/typescript/ui/components/seekbar/thumbnail/SingleThumbnailView.d.ts +0 -8
- package/lib/typescript/ui/components/seekbar/thumbnail/Thumbnail.d.ts +0 -56
- package/lib/typescript/ui/components/seekbar/thumbnail/ThumbnailView.d.ts +0 -60
- package/lib/typescript/ui/components/seekbar/thumbnail/Urlpolyfill.d.ts +0 -1
- package/lib/typescript/ui/components/seekbar/thumbnail/Urlpolyfill.web.d.ts +0 -1
- package/lib/typescript/ui/components/seekbar/thumbnail/barrel.d.ts +0 -2
- package/lib/typescript/ui/components/timelabel/StaticTimeLabel.d.ts +0 -24
- package/lib/typescript/ui/components/timelabel/TimeLabel.d.ts +0 -32
- package/lib/typescript/ui/components/timelabel/barrel.d.ts +0 -2
- package/lib/typescript/ui/components/uicontroller/UiContainer.d.ts +0 -115
- package/lib/typescript/ui/components/uicontroller/UiControls.d.ts +0 -14
- package/lib/typescript/ui/components/uicontroller/barrel.d.ts +0 -2
- package/lib/typescript/ui/components/util/PlayerContext.d.ts +0 -22
- package/lib/typescript/ui/components/util/TrackUtils.d.ts +0 -10
- package/lib/typescript/ui/components/util/barrel.d.ts +0 -1
- package/lib/typescript/ui/utils/ArrayUtils.d.ts +0 -2
- package/lib/typescript/ui/utils/language/Language.d.ts +0 -19
- package/lib/typescript/web/platform/BrowserDetection.d.ts +0 -23
- package/src/ui/THEOplayerDefaultUi.tsx +0 -108
- package/src/ui/THEOplayerTheme.ts +0 -112
- package/src/ui/barrel.ts +0 -3
- package/src/ui/components/activityindicator/CenteredDelayedActivityIndicator.tsx +0 -96
- package/src/ui/components/activityindicator/DelayedActivityIndicator.tsx +0 -32
- package/src/ui/components/activityindicator/barrel.ts +0 -2
- package/src/ui/components/barrel.ts +0 -9
- package/src/ui/components/button/AirplayButton.tsx +0 -64
- package/src/ui/components/button/ChromecastButton.tsx +0 -60
- package/src/ui/components/button/ChromecastButton.web.tsx +0 -66
- package/src/ui/components/button/FullscreenButton.tsx +0 -60
- package/src/ui/components/button/MuteButton.tsx +0 -52
- package/src/ui/components/button/PipButton.tsx +0 -61
- package/src/ui/components/button/PlayButton.tsx +0 -107
- package/src/ui/components/button/SkipButton.tsx +0 -112
- package/src/ui/components/button/actionbutton/ActionButton.tsx +0 -105
- package/src/ui/components/button/barrel.ts +0 -9
- package/src/ui/components/button/svg/AirplaySvg.tsx +0 -18
- package/src/ui/components/button/svg/ArrowForwardSvg.tsx +0 -18
- package/src/ui/components/button/svg/BackSvg.tsx +0 -18
- package/src/ui/components/button/svg/BackwardSvg.tsx +0 -18
- package/src/ui/components/button/svg/ChromecastSvg.tsx +0 -18
- package/src/ui/components/button/svg/ErrorSvg.tsx +0 -18
- package/src/ui/components/button/svg/ForwardSvg.tsx +0 -18
- package/src/ui/components/button/svg/FullscreenEnterSvg.tsx +0 -18
- package/src/ui/components/button/svg/FullscreenExitSvg.tsx +0 -18
- package/src/ui/components/button/svg/LanguageSvg.tsx +0 -18
- package/src/ui/components/button/svg/ListSvg.tsx +0 -18
- package/src/ui/components/button/svg/PauseSvg.tsx +0 -18
- package/src/ui/components/button/svg/PipEnterSvg.tsx +0 -18
- package/src/ui/components/button/svg/PipExitSvg.tsx +0 -18
- package/src/ui/components/button/svg/PlaySvg.tsx +0 -18
- package/src/ui/components/button/svg/ReplaySvg.tsx +0 -18
- package/src/ui/components/button/svg/SettingsSvg.tsx +0 -18
- package/src/ui/components/button/svg/SvgUtils.ts +0 -4
- package/src/ui/components/button/svg/VolumeOffSvg.tsx +0 -18
- package/src/ui/components/button/svg/VolumeUpSvg.tsx +0 -18
- package/src/ui/components/button/svg/barrel.ts +0 -20
- package/src/ui/components/button/svg/res/AirPlayButton.html +0 -6
- package/src/ui/components/button/svg/res/Airplay.svg +0 -1
- package/src/ui/components/button/svg/res/ChromecastButton.html +0 -25
- package/src/ui/components/button/svg/res/arrow_forward.svg +0 -1
- package/src/ui/components/button/svg/res/back.svg +0 -1
- package/src/ui/components/button/svg/res/backward.svg +0 -1
- package/src/ui/components/button/svg/res/chromecast-48px.svg +0 -1
- package/src/ui/components/button/svg/res/close.svg +0 -1
- package/src/ui/components/button/svg/res/error.svg +0 -1
- package/src/ui/components/button/svg/res/forward.svg +0 -1
- package/src/ui/components/button/svg/res/fullscreen-enter.svg +0 -1
- package/src/ui/components/button/svg/res/fullscreen-exit.svg +0 -1
- package/src/ui/components/button/svg/res/language.svg +0 -1
- package/src/ui/components/button/svg/res/list.svg +0 -1
- package/src/ui/components/button/svg/res/live.svg +0 -1
- package/src/ui/components/button/svg/res/pause.svg +0 -1
- package/src/ui/components/button/svg/res/pip_enter.svg +0 -1
- package/src/ui/components/button/svg/res/pip_exit.svg +0 -1
- package/src/ui/components/button/svg/res/play.svg +0 -1
- package/src/ui/components/button/svg/res/replay.svg +0 -1
- package/src/ui/components/button/svg/res/settings.svg +0 -1
- package/src/ui/components/button/svg/res/skip-next.svg +0 -1
- package/src/ui/components/button/svg/res/volume-high.svg +0 -1
- package/src/ui/components/button/svg/res/volume-low.svg +0 -1
- package/src/ui/components/button/svg/res/volume-off.svg +0 -1
- package/src/ui/components/controlbar/ControlBar.tsx +0 -69
- package/src/ui/components/controlbar/Spacer.tsx +0 -9
- package/src/ui/components/controlbar/barrel.ts +0 -2
- package/src/ui/components/menu/LanguageMenuButton.tsx +0 -192
- package/src/ui/components/menu/PlaybackRateSubMenu.tsx +0 -93
- package/src/ui/components/menu/QualitySubMenu.tsx +0 -148
- package/src/ui/components/menu/SettingsMenuButton.tsx +0 -25
- package/src/ui/components/menu/barrel.ts +0 -5
- package/src/ui/components/menu/common/MenuButton.tsx +0 -49
- package/src/ui/components/menu/common/MenuRadioButton.tsx +0 -65
- package/src/ui/components/menu/common/MenuTitle.tsx +0 -37
- package/src/ui/components/menu/common/MenuView.tsx +0 -62
- package/src/ui/components/menu/common/ScrollableMenu.tsx +0 -43
- package/src/ui/components/menu/common/SubMenuWithButton.tsx +0 -58
- package/src/ui/components/menu/common/barrel.ts +0 -6
- package/src/ui/components/message/CastMessage.tsx +0 -74
- package/src/ui/components/message/ErrorDisplay.tsx +0 -43
- package/src/ui/components/message/barrel.ts +0 -2
- package/src/ui/components/seekbar/SeekBar.tsx +0 -178
- package/src/ui/components/seekbar/barrel.ts +0 -2
- package/src/ui/components/seekbar/thumbnail/SingleThumbnailView.tsx +0 -38
- package/src/ui/components/seekbar/thumbnail/Thumbnail.ts +0 -72
- package/src/ui/components/seekbar/thumbnail/ThumbnailView.tsx +0 -266
- package/src/ui/components/seekbar/thumbnail/Urlpolyfill.ts +0 -1
- package/src/ui/components/seekbar/thumbnail/Urlpolyfill.web.ts +0 -2
- package/src/ui/components/seekbar/thumbnail/barrel.ts +0 -2
- package/src/ui/components/timelabel/StaticTimeLabel.tsx +0 -63
- package/src/ui/components/timelabel/TimeLabel.tsx +0 -79
- package/src/ui/components/timelabel/barrel.ts +0 -2
- package/src/ui/components/uicontroller/UiContainer.tsx +0 -355
- package/src/ui/components/uicontroller/UiControls.ts +0 -31
- package/src/ui/components/uicontroller/barrel.ts +0 -2
- package/src/ui/components/util/PlayerContext.ts +0 -29
- package/src/ui/components/util/TrackUtils.ts +0 -62
- package/src/ui/components/util/barrel.ts +0 -1
- package/src/ui/utils/ArrayUtils.ts +0 -12
- package/src/ui/utils/language/Language.ts +0 -38
- package/src/ui/utils/language/languages.json +0 -1658
- package/src/web/platform/BrowserDetection.ts +0 -38
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import React, { PureComponent } from 'react';
|
|
2
|
-
import type { MediaTrack } from 'react-native-theoplayer';
|
|
3
|
-
import { PlayerEventType, TextTrack } from 'react-native-theoplayer';
|
|
4
|
-
import { PlayerContext, UiContext } from '../util/PlayerContext';
|
|
5
|
-
import { LanguageSvg } from '../button/svg/LanguageSvg';
|
|
6
|
-
import { ScrollableMenu } from './common/ScrollableMenu';
|
|
7
|
-
import { MenuRadioButton } from './common/MenuRadioButton';
|
|
8
|
-
import { MenuButton } from './common/MenuButton';
|
|
9
|
-
import { filterRenderableTracks, getTrackLabel } from '../util/TrackUtils';
|
|
10
|
-
import { MenuView } from './common/MenuView';
|
|
11
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
12
|
-
|
|
13
|
-
export interface LanguageMenuButtonState {
|
|
14
|
-
audioTracks: MediaTrack[];
|
|
15
|
-
textTracks: TextTrack[];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface LanguageMenuButtonProps {
|
|
19
|
-
/**
|
|
20
|
-
* The style overrides.
|
|
21
|
-
*/
|
|
22
|
-
menuStyle?: StyleProp<ViewStyle>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* A button component that opens a language selection menu (audio/text) for the `react-native-theoplayer` UI.
|
|
27
|
-
*/
|
|
28
|
-
export class LanguageMenuButton extends PureComponent<LanguageMenuButtonProps, LanguageMenuButtonState> {
|
|
29
|
-
constructor(props: LanguageMenuButtonProps) {
|
|
30
|
-
super(props);
|
|
31
|
-
this.state = { audioTracks: [], textTracks: [] };
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
componentDidMount() {
|
|
35
|
-
const player = (this.context as UiContext).player;
|
|
36
|
-
player.addEventListener(PlayerEventType.MEDIA_TRACK_LIST, this._updateTrackLists);
|
|
37
|
-
player.addEventListener(PlayerEventType.TEXT_TRACK_LIST, this._updateTrackLists);
|
|
38
|
-
this._updateTrackLists();
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
componentWillUnmount() {
|
|
42
|
-
const player = (this.context as UiContext).player;
|
|
43
|
-
player.removeEventListener(PlayerEventType.MEDIA_TRACK_LIST, this._updateTrackLists);
|
|
44
|
-
player.removeEventListener(PlayerEventType.TEXT_TRACK_LIST, this._updateTrackLists);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
private _updateTrackLists = () => {
|
|
48
|
-
const player = (this.context as UiContext).player;
|
|
49
|
-
this.setState({
|
|
50
|
-
audioTracks: player.audioTracks,
|
|
51
|
-
textTracks: player.textTracks,
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
render() {
|
|
56
|
-
const { audioTracks, textTracks } = this.state;
|
|
57
|
-
const { menuStyle } = this.props;
|
|
58
|
-
|
|
59
|
-
const selectableTextTracks = filterRenderableTracks(textTracks);
|
|
60
|
-
|
|
61
|
-
if (audioTracks.length < 2 && selectableTextTracks.length === 0) {
|
|
62
|
-
return <></>;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const createMenu = () => {
|
|
66
|
-
return <LanguageMenuView style={menuStyle} />;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
return <MenuButton svg={<LanguageSvg />} menuConstructor={createMenu} />;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface LanguageMenuViewState extends LanguageMenuButtonState {
|
|
74
|
-
selectedAudioTrack: number | undefined;
|
|
75
|
-
selectedTextTrack: number | undefined;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface LanguageMenuViewProps {
|
|
79
|
-
style?: StyleProp<ViewStyle>;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export class LanguageMenuView extends PureComponent<LanguageMenuViewProps, LanguageMenuViewState> {
|
|
83
|
-
constructor(props: LanguageMenuViewProps) {
|
|
84
|
-
super(props);
|
|
85
|
-
this.state = {
|
|
86
|
-
audioTracks: [],
|
|
87
|
-
textTracks: [],
|
|
88
|
-
selectedAudioTrack: undefined,
|
|
89
|
-
selectedTextTrack: undefined,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
private _updateTrackLists = () => {
|
|
94
|
-
const player = (this.context as UiContext).player;
|
|
95
|
-
this.setState({
|
|
96
|
-
audioTracks: player.audioTracks,
|
|
97
|
-
textTracks: player.textTracks,
|
|
98
|
-
selectedAudioTrack: player.selectedAudioTrack,
|
|
99
|
-
selectedTextTrack: player.selectedTextTrack,
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
componentDidMount() {
|
|
104
|
-
const player = (this.context as UiContext).player;
|
|
105
|
-
// The track lists might change while the menu is open, so we need to monitor them.
|
|
106
|
-
player.addEventListener(PlayerEventType.MEDIA_TRACK_LIST, this._updateTrackLists);
|
|
107
|
-
player.addEventListener(PlayerEventType.TEXT_TRACK_LIST, this._updateTrackLists);
|
|
108
|
-
this._updateTrackLists();
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
componentWillUnmount() {
|
|
112
|
-
const player = (this.context as UiContext).player;
|
|
113
|
-
player.removeEventListener(PlayerEventType.MEDIA_TRACK_LIST, this._updateTrackLists);
|
|
114
|
-
player.removeEventListener(PlayerEventType.TEXT_TRACK_LIST, this._updateTrackLists);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
private onSelectTextTrack = (uid: number | undefined) => {
|
|
118
|
-
const { textTracks } = this.state;
|
|
119
|
-
const textTrack = textTracks.find((track) => track.uid === uid);
|
|
120
|
-
const context = this.context as UiContext;
|
|
121
|
-
context.player.selectedTextTrack = textTrack?.uid;
|
|
122
|
-
this.setState({ selectedTextTrack: textTrack?.uid });
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
private selectAudioTrack = (uid: number | undefined) => {
|
|
126
|
-
const { audioTracks } = this.state;
|
|
127
|
-
const audioTrack = audioTracks.find((track) => track.uid === uid);
|
|
128
|
-
if (audioTrack) {
|
|
129
|
-
const context = this.context as UiContext;
|
|
130
|
-
context.player.selectedAudioTrack = audioTrack.uid;
|
|
131
|
-
this.setState({ selectedAudioTrack: audioTrack.uid });
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
render() {
|
|
136
|
-
const { style } = this.props;
|
|
137
|
-
const { audioTracks, textTracks, selectedAudioTrack, selectedTextTrack } = this.state;
|
|
138
|
-
// The sort is needed because tracks are returned in different order on the native SDKs.
|
|
139
|
-
const selectableTextTracks = filterRenderableTracks(textTracks).sort((first, second) => first.uid - second.uid);
|
|
140
|
-
const selectableAudioTracks = audioTracks.sort((first, second) => first.uid - second.uid);
|
|
141
|
-
return (
|
|
142
|
-
<MenuView
|
|
143
|
-
style={style}
|
|
144
|
-
menu={
|
|
145
|
-
<>
|
|
146
|
-
{selectableAudioTracks.length > 1 && (
|
|
147
|
-
<ScrollableMenu
|
|
148
|
-
title={'Audio'}
|
|
149
|
-
items={selectableAudioTracks.map((track, id) => (
|
|
150
|
-
<MenuRadioButton
|
|
151
|
-
key={id}
|
|
152
|
-
label={getTrackLabel(track)}
|
|
153
|
-
uid={track.uid}
|
|
154
|
-
onSelect={this.selectAudioTrack}
|
|
155
|
-
selected={track.uid === selectedAudioTrack}></MenuRadioButton>
|
|
156
|
-
))}
|
|
157
|
-
/>
|
|
158
|
-
)}
|
|
159
|
-
{selectableTextTracks.length > 0 && (
|
|
160
|
-
<ScrollableMenu
|
|
161
|
-
title={'Subtitles'}
|
|
162
|
-
items={
|
|
163
|
-
<>
|
|
164
|
-
<MenuRadioButton
|
|
165
|
-
key={0}
|
|
166
|
-
label={'off'}
|
|
167
|
-
uid={undefined}
|
|
168
|
-
onSelect={this.onSelectTextTrack}
|
|
169
|
-
selected={selectedTextTrack === undefined}
|
|
170
|
-
/>
|
|
171
|
-
{selectableTextTracks.map((track, id) => (
|
|
172
|
-
<MenuRadioButton
|
|
173
|
-
key={id + 1}
|
|
174
|
-
label={getTrackLabel(track)}
|
|
175
|
-
uid={track.uid}
|
|
176
|
-
onSelect={this.onSelectTextTrack}
|
|
177
|
-
selected={track.uid === selectedTextTrack}
|
|
178
|
-
/>
|
|
179
|
-
))}
|
|
180
|
-
</>
|
|
181
|
-
}
|
|
182
|
-
/>
|
|
183
|
-
)}
|
|
184
|
-
</>
|
|
185
|
-
}
|
|
186
|
-
/>
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
LanguageMenuButton.contextType = PlayerContext;
|
|
192
|
-
LanguageMenuView.contextType = PlayerContext;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React, { useContext, useState } from 'react';
|
|
2
|
-
import { PlayerContext } from '../util/PlayerContext';
|
|
3
|
-
import { MenuView } from './common/MenuView';
|
|
4
|
-
import { ScrollableMenu } from './common/ScrollableMenu';
|
|
5
|
-
import { MenuRadioButton } from './common/MenuRadioButton';
|
|
6
|
-
import { SubMenuWithButton } from './common/SubMenuWithButton';
|
|
7
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
8
|
-
|
|
9
|
-
export interface PlaybackRateValue {
|
|
10
|
-
/**
|
|
11
|
-
* The playbackRate value.
|
|
12
|
-
*/
|
|
13
|
-
readonly value: number;
|
|
14
|
-
/**
|
|
15
|
-
* The label of the playbackRate value.
|
|
16
|
-
*/
|
|
17
|
-
readonly label: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The default playback rate values for the menu.
|
|
22
|
-
*/
|
|
23
|
-
export const DEFAULT_PLAYBACK_RATE_MENU_VALUES: PlaybackRateValue[] = [
|
|
24
|
-
{ value: 0.25, label: '0.25x' },
|
|
25
|
-
{ value: 0.5, label: '0.5x' },
|
|
26
|
-
{ value: 1, label: 'Normal' },
|
|
27
|
-
{ value: 1.25, label: '1.25x' },
|
|
28
|
-
{ value: 1.5, label: '1.5x' },
|
|
29
|
-
{ value: 2, label: '2x' },
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
interface PlaybackRateSubMenuProps {
|
|
33
|
-
/**
|
|
34
|
-
* Overrides for the default playbackRate values.
|
|
35
|
-
*/
|
|
36
|
-
values?: PlaybackRateValue[];
|
|
37
|
-
/**
|
|
38
|
-
* Overrides for the style of the menu.
|
|
39
|
-
*/
|
|
40
|
-
menuStyle?: StyleProp<ViewStyle>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* A button component that opens a playbackRate selection menu for the `react-native-theoplayer` UI.
|
|
45
|
-
*/
|
|
46
|
-
export const PlaybackRateSubMenu = (props: PlaybackRateSubMenuProps) => {
|
|
47
|
-
const { values, menuStyle } = props;
|
|
48
|
-
const selectedValues: PlaybackRateValue[] = values ?? DEFAULT_PLAYBACK_RATE_MENU_VALUES;
|
|
49
|
-
const player = useContext(PlayerContext).player;
|
|
50
|
-
|
|
51
|
-
const createMenu = () => {
|
|
52
|
-
return <PlaybackSelectionView values={selectedValues} menuStyle={menuStyle} />;
|
|
53
|
-
};
|
|
54
|
-
const preview = selectedValues.find((value) => value.value === player.playbackRate)?.label ?? player.playbackRate.toString() + 'x';
|
|
55
|
-
|
|
56
|
-
return <SubMenuWithButton menuConstructor={createMenu} label={'Speed'} preview={preview} />;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
interface PlaybackSelectionViewProps {
|
|
60
|
-
menuStyle?: StyleProp<ViewStyle>;
|
|
61
|
-
values: PlaybackRateValue[];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export const PlaybackSelectionView = (props: PlaybackSelectionViewProps) => {
|
|
65
|
-
const { values, menuStyle } = props;
|
|
66
|
-
const player = useContext(PlayerContext).player;
|
|
67
|
-
const [selectedPlaybackRate, setSelectedPlaybackRate] = useState(player.playbackRate);
|
|
68
|
-
const onChangePlaybackRate = (playbackRate: number | undefined) => {
|
|
69
|
-
if (playbackRate) {
|
|
70
|
-
player.playbackRate = playbackRate;
|
|
71
|
-
setSelectedPlaybackRate(playbackRate);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return (
|
|
76
|
-
<MenuView
|
|
77
|
-
style={menuStyle}
|
|
78
|
-
menu={
|
|
79
|
-
<ScrollableMenu
|
|
80
|
-
title={'Playback Rate'}
|
|
81
|
-
items={values.map((playbackRateValue, id) => (
|
|
82
|
-
<MenuRadioButton
|
|
83
|
-
key={id}
|
|
84
|
-
label={playbackRateValue.label}
|
|
85
|
-
uid={playbackRateValue.value}
|
|
86
|
-
onSelect={onChangePlaybackRate}
|
|
87
|
-
selected={selectedPlaybackRate === playbackRateValue.value}></MenuRadioButton>
|
|
88
|
-
))}
|
|
89
|
-
/>
|
|
90
|
-
}
|
|
91
|
-
/>
|
|
92
|
-
);
|
|
93
|
-
};
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import type { VideoQuality } from 'react-native-theoplayer';
|
|
2
|
-
import { findMediaTrackByUid, MediaTrack, PlayerEventType } from 'react-native-theoplayer';
|
|
3
|
-
import React, { PureComponent, useContext } from 'react';
|
|
4
|
-
import { Platform, StyleProp, ViewStyle } from 'react-native';
|
|
5
|
-
import { PlayerContext, UiContext } from '../util/PlayerContext';
|
|
6
|
-
import { getVideoQualityLabel } from '../util/TrackUtils';
|
|
7
|
-
import { MenuView } from './common/MenuView';
|
|
8
|
-
import { ScrollableMenu } from './common/ScrollableMenu';
|
|
9
|
-
import { MenuRadioButton } from './common/MenuRadioButton';
|
|
10
|
-
import { SubMenuWithButton } from './common/SubMenuWithButton';
|
|
11
|
-
|
|
12
|
-
export interface QualitySubMenuProps {
|
|
13
|
-
/**
|
|
14
|
-
* Overrides for the style of the menu.
|
|
15
|
-
*/
|
|
16
|
-
menuStyle?: StyleProp<ViewStyle>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* A button component that opens a playbackRate selection menu for the `react-native-theoplayer` UI.
|
|
21
|
-
*/
|
|
22
|
-
export const QualitySubMenu = (props: QualitySubMenuProps) => {
|
|
23
|
-
const { menuStyle } = props;
|
|
24
|
-
if (Platform.OS === 'ios') {
|
|
25
|
-
return <></>;
|
|
26
|
-
}
|
|
27
|
-
const createMenu = () => {
|
|
28
|
-
return <QualitySelectionView style={menuStyle} />;
|
|
29
|
-
};
|
|
30
|
-
const player = useContext(PlayerContext).player;
|
|
31
|
-
|
|
32
|
-
let selectedQualityLabel = 'auto';
|
|
33
|
-
if (player.targetVideoQuality !== undefined) {
|
|
34
|
-
let id: number | undefined;
|
|
35
|
-
if (typeof player.targetVideoQuality === 'number') {
|
|
36
|
-
id = player.targetVideoQuality;
|
|
37
|
-
} else {
|
|
38
|
-
id = player.targetVideoQuality.length > 0 ? player.targetVideoQuality[0] : undefined;
|
|
39
|
-
}
|
|
40
|
-
const selectedTrack = player.videoTracks.find((track) => track.uid === player.selectedVideoTrack);
|
|
41
|
-
const selectedQuality = selectedTrack !== undefined ? selectedTrack.qualities.find((quality) => quality.uid === id) : undefined;
|
|
42
|
-
selectedQualityLabel = getVideoQualityLabel(selectedQuality as VideoQuality, false);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return <SubMenuWithButton menuConstructor={createMenu} label={'Quality'} preview={selectedQualityLabel} />;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export interface QualitySelectionViewState {
|
|
49
|
-
videoTracks: MediaTrack[];
|
|
50
|
-
selectedVideoTrack: number | undefined;
|
|
51
|
-
targetVideoTrackQuality: number | number[] | undefined;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface QualitySelectionViewProps {
|
|
55
|
-
style?: StyleProp<ViewStyle>;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export class QualitySelectionView extends PureComponent<QualitySelectionViewProps, QualitySelectionViewState> {
|
|
59
|
-
constructor(props: QualitySelectionViewProps) {
|
|
60
|
-
super(props);
|
|
61
|
-
this.state = {
|
|
62
|
-
videoTracks: [],
|
|
63
|
-
selectedVideoTrack: undefined,
|
|
64
|
-
targetVideoTrackQuality: undefined,
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
componentDidMount() {
|
|
69
|
-
const player = (this.context as UiContext).player;
|
|
70
|
-
player.addEventListener(PlayerEventType.MEDIA_TRACK_LIST, this.onTrackListChanged);
|
|
71
|
-
this.setState({
|
|
72
|
-
videoTracks: player.videoTracks,
|
|
73
|
-
selectedVideoTrack: player.selectedVideoTrack,
|
|
74
|
-
targetVideoTrackQuality: player.targetVideoQuality,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
componentWillUnmount() {
|
|
79
|
-
const player = (this.context as UiContext).player;
|
|
80
|
-
player.removeEventListener(PlayerEventType.MEDIA_TRACK_LIST, this.onTrackListChanged);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
private onTrackListChanged = () => {
|
|
84
|
-
const player = (this.context as UiContext).player;
|
|
85
|
-
this.setState({
|
|
86
|
-
videoTracks: player.videoTracks,
|
|
87
|
-
selectedVideoTrack: player.selectedVideoTrack,
|
|
88
|
-
targetVideoTrackQuality: player.targetVideoQuality,
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
private selectTargetVideoQuality = (qualityIndex: number | undefined) => {
|
|
93
|
-
const { videoTracks, selectedVideoTrack } = this.state;
|
|
94
|
-
if (!videoTracks || !selectedVideoTrack) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const videoTrack = videoTracks.find((track) => track.uid === selectedVideoTrack);
|
|
98
|
-
const qualities = videoTrack?.qualities;
|
|
99
|
-
if (!qualities) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
let uid: number | undefined = undefined;
|
|
103
|
-
if (qualityIndex !== undefined && qualityIndex > 0) {
|
|
104
|
-
// The first quality in the list is "auto". The rest are selectable qualities.
|
|
105
|
-
uid = qualities[qualityIndex - 1].uid;
|
|
106
|
-
}
|
|
107
|
-
const player = (this.context as UiContext).player;
|
|
108
|
-
player.targetVideoQuality = uid;
|
|
109
|
-
this.setState({ targetVideoTrackQuality: uid });
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
render() {
|
|
113
|
-
const { style } = this.props;
|
|
114
|
-
const { videoTracks, selectedVideoTrack, targetVideoTrackQuality } = this.state;
|
|
115
|
-
const availableVideoQualities = findMediaTrackByUid(videoTracks, selectedVideoTrack)?.qualities || [];
|
|
116
|
-
availableVideoQualities.sort((q1, q2) => q2.bandwidth - q1.bandwidth);
|
|
117
|
-
|
|
118
|
-
let selectedTarget: number | undefined;
|
|
119
|
-
if (targetVideoTrackQuality === undefined || typeof targetVideoTrackQuality === 'number') {
|
|
120
|
-
selectedTarget = targetVideoTrackQuality;
|
|
121
|
-
} else {
|
|
122
|
-
selectedTarget = targetVideoTrackQuality.length > 0 ? targetVideoTrackQuality[0] : undefined;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return (
|
|
126
|
-
<MenuView
|
|
127
|
-
style={style}
|
|
128
|
-
menu={
|
|
129
|
-
<ScrollableMenu
|
|
130
|
-
title={'Video quality'}
|
|
131
|
-
items={[undefined, ...availableVideoQualities].map((track, id) => (
|
|
132
|
-
<MenuRadioButton
|
|
133
|
-
key={id}
|
|
134
|
-
label={getVideoQualityLabel(track as VideoQuality)}
|
|
135
|
-
uid={id}
|
|
136
|
-
onSelect={this.selectTargetVideoQuality}
|
|
137
|
-
selected={
|
|
138
|
-
(track === undefined && selectedTarget === undefined) || (track !== undefined && track.uid === selectedTarget)
|
|
139
|
-
}></MenuRadioButton>
|
|
140
|
-
))}
|
|
141
|
-
/>
|
|
142
|
-
}
|
|
143
|
-
/>
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
QualitySelectionView.contextType = PlayerContext;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MenuButton } from './common/MenuButton';
|
|
3
|
-
import { SettingsSvg } from '../button/svg/SettingsSvg';
|
|
4
|
-
import { MenuView } from './common/MenuView';
|
|
5
|
-
import { ScrollableMenu } from './common/ScrollableMenu';
|
|
6
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
7
|
-
|
|
8
|
-
export interface SettingsMenuButtonProps {
|
|
9
|
-
/**
|
|
10
|
-
* Overrides for the style of the menu.
|
|
11
|
-
*/
|
|
12
|
-
menuStyle?: StyleProp<ViewStyle>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A button component that opens a settings menu containing all children for the `react-native-theoplayer` UI.
|
|
17
|
-
*/
|
|
18
|
-
export const SettingsMenuButton = (props: React.PropsWithChildren<SettingsMenuButtonProps>) => {
|
|
19
|
-
const { children, menuStyle } = props;
|
|
20
|
-
const createMenu = () => {
|
|
21
|
-
return <MenuView style={menuStyle} menu={<ScrollableMenu title={'Settings'} items={children} />} />;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
return <MenuButton svg={<SettingsSvg />} menuConstructor={createMenu} />;
|
|
25
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ImageSourcePropType, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
-
import React, { ReactNode } from 'react';
|
|
3
|
-
import { ActionButton } from '../../button/actionbutton/ActionButton';
|
|
4
|
-
import { PlayerContext, UiContext } from '../../util/PlayerContext';
|
|
5
|
-
import type { MenuConstructor } from '../../uicontroller/UiControls';
|
|
6
|
-
|
|
7
|
-
export interface MenuButtonProps {
|
|
8
|
-
/**
|
|
9
|
-
* The image that will be used in the button.
|
|
10
|
-
*/
|
|
11
|
-
icon?: ImageSourcePropType;
|
|
12
|
-
/**
|
|
13
|
-
* The SVG that will be used in the button. Takes priority over images.
|
|
14
|
-
*/
|
|
15
|
-
svg?: ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* The style overrides for the menu button.
|
|
18
|
-
*/
|
|
19
|
-
style?: StyleProp<ViewStyle>;
|
|
20
|
-
/**
|
|
21
|
-
* The menu that will be constructed when the button is pressed.
|
|
22
|
-
*/
|
|
23
|
-
menuConstructor?: MenuConstructor;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* A menu button that opens a fullscreen menu for in the `react-native-theoplayer` UI.
|
|
28
|
-
*/
|
|
29
|
-
export const MenuButton = (props: MenuButtonProps) => {
|
|
30
|
-
const { icon, svg, style, menuConstructor } = props;
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<PlayerContext.Consumer>
|
|
34
|
-
{(context: UiContext) => (
|
|
35
|
-
<ActionButton
|
|
36
|
-
svg={svg}
|
|
37
|
-
icon={icon}
|
|
38
|
-
onPress={() => {
|
|
39
|
-
if (menuConstructor) {
|
|
40
|
-
context.ui.openMenu_(menuConstructor);
|
|
41
|
-
}
|
|
42
|
-
}}
|
|
43
|
-
style={style}
|
|
44
|
-
touchable={true}
|
|
45
|
-
/>
|
|
46
|
-
)}
|
|
47
|
-
</PlayerContext.Consumer>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { StyleProp, Text, TextStyle, TouchableOpacity } from 'react-native';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { PlayerContext, UiContext } from '../../util/PlayerContext';
|
|
4
|
-
|
|
5
|
-
export interface MenuRadioButtonProps {
|
|
6
|
-
/**
|
|
7
|
-
* The label for the button.
|
|
8
|
-
*/
|
|
9
|
-
label: string;
|
|
10
|
-
/**
|
|
11
|
-
* The uid used in the callback when the button is pressed.
|
|
12
|
-
*/
|
|
13
|
-
uid: number | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Whether the radio button is selected.
|
|
16
|
-
*/
|
|
17
|
-
selected?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* The callback that is called when the button is pressed.
|
|
20
|
-
* @param id The uid prop.
|
|
21
|
-
*/
|
|
22
|
-
onSelect: (id: number | undefined) => void;
|
|
23
|
-
/**
|
|
24
|
-
* The style overrides for the radio button.
|
|
25
|
-
*/
|
|
26
|
-
style?: StyleProp<TextStyle>;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* The default style for the menu button.
|
|
31
|
-
*/
|
|
32
|
-
export const DEFAULT_MENU_BUTTON_STYLE: TextStyle = {
|
|
33
|
-
fontSize: 16,
|
|
34
|
-
lineHeight: 24,
|
|
35
|
-
padding: 10,
|
|
36
|
-
textAlign: 'center',
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* The default radio button that can be used in menus for the `react-native-theoplayer` UI.
|
|
41
|
-
*/
|
|
42
|
-
export const MenuRadioButton = (props: MenuRadioButtonProps) => {
|
|
43
|
-
const { uid, onSelect, label, selected, style } = props;
|
|
44
|
-
return (
|
|
45
|
-
<TouchableOpacity
|
|
46
|
-
onPress={() => {
|
|
47
|
-
onSelect(uid);
|
|
48
|
-
}}>
|
|
49
|
-
<PlayerContext.Consumer>
|
|
50
|
-
{(context: UiContext) => (
|
|
51
|
-
<Text
|
|
52
|
-
style={[
|
|
53
|
-
DEFAULT_MENU_BUTTON_STYLE,
|
|
54
|
-
selected
|
|
55
|
-
? { color: context.style.colors.textSelected, backgroundColor: context.style.colors.textSelectedBackground }
|
|
56
|
-
: { color: context.style.colors.text },
|
|
57
|
-
style,
|
|
58
|
-
]}>
|
|
59
|
-
{label}
|
|
60
|
-
</Text>
|
|
61
|
-
)}
|
|
62
|
-
</PlayerContext.Consumer>
|
|
63
|
-
</TouchableOpacity>
|
|
64
|
-
);
|
|
65
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { StyleProp, Text, TextStyle } from 'react-native';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { PlayerContext, UiContext } from '../../util/PlayerContext';
|
|
4
|
-
|
|
5
|
-
export interface MenuTitleProps {
|
|
6
|
-
/**
|
|
7
|
-
* The label of the menu title component.
|
|
8
|
-
*/
|
|
9
|
-
label: string;
|
|
10
|
-
/**
|
|
11
|
-
* The style overrides.
|
|
12
|
-
*/
|
|
13
|
-
style?: StyleProp<TextStyle>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The default style for the menu title.
|
|
18
|
-
*/
|
|
19
|
-
export const DEFAULT_MENU_TITLE_STYLE: TextStyle = {
|
|
20
|
-
fontSize: 20,
|
|
21
|
-
lineHeight: 24,
|
|
22
|
-
padding: 10,
|
|
23
|
-
textAlign: 'center',
|
|
24
|
-
fontWeight: 'bold',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* The title placed at the top of the fullscreen menu.
|
|
29
|
-
*/
|
|
30
|
-
export const MenuTitle = (props: MenuTitleProps) => {
|
|
31
|
-
const { label, style } = props;
|
|
32
|
-
return (
|
|
33
|
-
<PlayerContext.Consumer>
|
|
34
|
-
{(context: UiContext) => <Text style={[DEFAULT_MENU_TITLE_STYLE, { color: context.style.colors.text }, style]}>{label}</Text>}
|
|
35
|
-
</PlayerContext.Consumer>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode, useContext } from 'react';
|
|
2
|
-
import { PlayerContext, UiContext } from '../../util/PlayerContext';
|
|
3
|
-
import { StyleProp, StyleSheet, Text, TouchableOpacity, View, ViewStyle } from 'react-native';
|
|
4
|
-
import { ControlBar } from '../../controlbar/ControlBar';
|
|
5
|
-
import { TOP_UI_CONTAINER_STYLE } from '../../uicontroller/UiContainer';
|
|
6
|
-
import { BackSvg } from '../../button/svg/BackSvg';
|
|
7
|
-
import { ActionButton } from '../../button/actionbutton/ActionButton';
|
|
8
|
-
|
|
9
|
-
interface MenuViewProps {
|
|
10
|
-
/**
|
|
11
|
-
* The menu to render inside the menu view.
|
|
12
|
-
*/
|
|
13
|
-
menu: ReactNode;
|
|
14
|
-
/**
|
|
15
|
-
* The style overrides for the menu view.
|
|
16
|
-
*/
|
|
17
|
-
style?: StyleProp<ViewStyle>;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The default style for the menu view.
|
|
22
|
-
*/
|
|
23
|
-
export const DEFAULT_MENU_VIEW_STYLE: ViewStyle = {
|
|
24
|
-
flex: 1,
|
|
25
|
-
flexDirection: 'row',
|
|
26
|
-
left: 0,
|
|
27
|
-
right: 0,
|
|
28
|
-
top: 0,
|
|
29
|
-
bottom: 0,
|
|
30
|
-
paddingVertical: 20,
|
|
31
|
-
paddingLeft: 50,
|
|
32
|
-
paddingRight: 40,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* A component to render a fullscreen menu with a title and back button for the `react-native-theoplayer` UI.
|
|
37
|
-
*/
|
|
38
|
-
export const MenuView = (props: MenuViewProps) => {
|
|
39
|
-
const { menu, style } = props;
|
|
40
|
-
const context = useContext(PlayerContext);
|
|
41
|
-
const onClose = () => {
|
|
42
|
-
context.ui.closeCurrentMenu_();
|
|
43
|
-
};
|
|
44
|
-
return (
|
|
45
|
-
<PlayerContext.Consumer>
|
|
46
|
-
{(context: UiContext) => (
|
|
47
|
-
<View style={StyleSheet.absoluteFill}>
|
|
48
|
-
<ControlBar style={TOP_UI_CONTAINER_STYLE}>
|
|
49
|
-
<View style={{ flexDirection: 'row' }}>
|
|
50
|
-
<TouchableOpacity style={{ flexDirection: 'row' }} onPress={onClose}>
|
|
51
|
-
<ActionButton touchable={false} svg={<BackSvg />} />
|
|
52
|
-
<Text style={{ color: context.style.colors.text, fontSize: 16, lineHeight: 30 }}>Back</Text>
|
|
53
|
-
</TouchableOpacity>
|
|
54
|
-
</View>
|
|
55
|
-
<View style={{ flexGrow: 1 }} />
|
|
56
|
-
</ControlBar>
|
|
57
|
-
<View style={[DEFAULT_MENU_VIEW_STYLE, style]}>{menu}</View>
|
|
58
|
-
</View>
|
|
59
|
-
)}
|
|
60
|
-
</PlayerContext.Consumer>
|
|
61
|
-
);
|
|
62
|
-
};
|