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,60 +0,0 @@
|
|
|
1
|
-
import React, { PureComponent } from 'react';
|
|
2
|
-
import { CastButton } from 'react-native-google-cast';
|
|
3
|
-
import type { CastEvent } from 'react-native-theoplayer';
|
|
4
|
-
import { CastEventType, CastState, PlayerEventType } from 'react-native-theoplayer';
|
|
5
|
-
import { PlayerContext, UiContext } from '../util/PlayerContext';
|
|
6
|
-
import { DEFAULT_ACTION_BUTTON_STYLE } from './actionbutton/ActionButton';
|
|
7
|
-
|
|
8
|
-
interface CastButtonState {
|
|
9
|
-
connected: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function isConnected(state: CastState | undefined): boolean {
|
|
13
|
-
return state === 'connecting' || state === 'connected';
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The native button to enable Chromecast for the `react-native-theoplayer` UI.
|
|
18
|
-
* This component uses the button from `react-native-google-cast` and is not supported on web.
|
|
19
|
-
*/
|
|
20
|
-
export class ChromecastButton extends PureComponent<unknown, CastButtonState> {
|
|
21
|
-
private static initialState: CastButtonState = {
|
|
22
|
-
connected: false,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
constructor(props: unknown) {
|
|
26
|
-
super(props);
|
|
27
|
-
this.state = ChromecastButton.initialState;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
componentDidMount() {
|
|
31
|
-
const player = (this.context as UiContext).player;
|
|
32
|
-
player.addEventListener(PlayerEventType.CAST_EVENT, this.onCastStateChangeEvent);
|
|
33
|
-
this.setState({ connected: player.cast?.casting });
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
componentWillUnmount() {
|
|
37
|
-
const player = (this.context as UiContext).player;
|
|
38
|
-
player.removeEventListener(PlayerEventType.CAST_EVENT, this.onCastStateChangeEvent);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
private onCastStateChangeEvent = (event: CastEvent) => {
|
|
42
|
-
if (event.subType != CastEventType.CHROMECAST_STATE_CHANGE) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
this.setState({ connected: isConnected(event.state) });
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
render() {
|
|
49
|
-
const { connected } = this.state;
|
|
50
|
-
return (
|
|
51
|
-
<PlayerContext.Consumer>
|
|
52
|
-
{(context: UiContext) => (
|
|
53
|
-
<CastButton style={DEFAULT_ACTION_BUTTON_STYLE} tintColor={connected ? context.style.colors.iconSelected : context.style.colors.icon} />
|
|
54
|
-
)}
|
|
55
|
-
</PlayerContext.Consumer>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
ChromecastButton.contextType = PlayerContext;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { CastEvent, CastEventType, CastState, PlayerEventType } from './../../../api/barrel';
|
|
2
|
-
import React, { PureComponent } from 'react';
|
|
3
|
-
import { PlayerContext, UiContext } from '../util/PlayerContext';
|
|
4
|
-
import { ChromecastSvg } from './svg/ChromecastSvg';
|
|
5
|
-
import { Platform } from 'react-native';
|
|
6
|
-
import { ActionButton } from 'react-native-theoplayer';
|
|
7
|
-
|
|
8
|
-
interface CastButtonState {
|
|
9
|
-
castState: CastState;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function isConnected(state: CastState | undefined): boolean {
|
|
13
|
-
return state === 'connecting' || state === 'connected';
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The button to enable Chromecast for web for the `react-native-theoplayer` UI
|
|
18
|
-
*/
|
|
19
|
-
export class ChromecastButton extends PureComponent<unknown, CastButtonState> {
|
|
20
|
-
private static initialState: CastButtonState = {
|
|
21
|
-
castState: CastState.unavailable,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
constructor(props: unknown) {
|
|
25
|
-
super(props);
|
|
26
|
-
this.state = ChromecastButton.initialState;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
componentDidMount() {
|
|
30
|
-
const player = (this.context as UiContext).player;
|
|
31
|
-
player.addEventListener(PlayerEventType.CAST_EVENT, this.onCastStateChangeEvent);
|
|
32
|
-
this.setState({ castState: player.cast.chromecast?.state ?? CastState.unavailable });
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
componentWillUnmount() {
|
|
36
|
-
const player = (this.context as UiContext).player;
|
|
37
|
-
player.removeEventListener(PlayerEventType.CAST_EVENT, this.onCastStateChangeEvent);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
private onCastStateChangeEvent = (event: CastEvent) => {
|
|
41
|
-
if (event.subType != CastEventType.CHROMECAST_STATE_CHANGE) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
this.setState({ castState: event.state });
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
private onPress = () => {
|
|
48
|
-
const player = (this.context as UiContext).player;
|
|
49
|
-
if (isConnected(this.state.castState)) {
|
|
50
|
-
player.cast.chromecast?.stop();
|
|
51
|
-
} else {
|
|
52
|
-
player.cast.chromecast?.start();
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
render() {
|
|
57
|
-
const { castState } = this.state;
|
|
58
|
-
// TODO: state is reported as unavailable by Android bridge when it is available.
|
|
59
|
-
if (Platform.OS === 'web' && castState === CastState.unavailable) {
|
|
60
|
-
return <></>;
|
|
61
|
-
}
|
|
62
|
-
return <ActionButton svg={<ChromecastSvg />} touchable={true} onPress={this.onPress} highlighted={isConnected(castState)} />;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
ChromecastButton.contextType = PlayerContext;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import React, { PureComponent } from 'react';
|
|
2
|
-
import type { PresentationModeChangeEvent } from 'react-native-theoplayer';
|
|
3
|
-
import { PlayerEventType, PresentationMode } from 'react-native-theoplayer';
|
|
4
|
-
import { Platform } from 'react-native';
|
|
5
|
-
import { ActionButton } from './actionbutton/ActionButton';
|
|
6
|
-
import { PlayerContext, UiContext } from '../util/PlayerContext';
|
|
7
|
-
import { FullscreenExitSvg } from './svg/FullscreenExitSvg';
|
|
8
|
-
import { FullscreenEnterSvg } from './svg/FullscreenEnterSvg';
|
|
9
|
-
|
|
10
|
-
interface FullscreenButtonState {
|
|
11
|
-
presentationMode: PresentationMode;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* The button to enable/disable fullscreen for the `react-native-theoplayer` UI.
|
|
16
|
-
*/
|
|
17
|
-
export class FullscreenButton extends PureComponent<unknown, FullscreenButtonState> {
|
|
18
|
-
constructor(props: unknown) {
|
|
19
|
-
super(props);
|
|
20
|
-
this.state = { presentationMode: PresentationMode.inline };
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
componentDidMount() {
|
|
24
|
-
const player = (this.context as UiContext).player;
|
|
25
|
-
player.addEventListener(PlayerEventType.PRESENTATIONMODE_CHANGE, this.onPresentationModeChange);
|
|
26
|
-
this.setState({ presentationMode: player.presentationMode });
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
componentWillUnmount() {
|
|
30
|
-
const player = (this.context as UiContext).player;
|
|
31
|
-
player.removeEventListener(PlayerEventType.PRESENTATIONMODE_CHANGE, this.onPresentationModeChange);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
private readonly onPresentationModeChange = (event: PresentationModeChangeEvent) => {
|
|
35
|
-
this.setState({ presentationMode: event.presentationMode });
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
private toggleFullScreen = () => {
|
|
39
|
-
const player = (this.context as UiContext).player;
|
|
40
|
-
switch (player.presentationMode) {
|
|
41
|
-
case 'picture-in-picture':
|
|
42
|
-
case 'inline':
|
|
43
|
-
player.presentationMode = PresentationMode.fullscreen;
|
|
44
|
-
break;
|
|
45
|
-
case 'fullscreen':
|
|
46
|
-
player.presentationMode = PresentationMode.inline;
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
render() {
|
|
52
|
-
const { presentationMode } = this.state;
|
|
53
|
-
if (Platform.isTV) {
|
|
54
|
-
return <></>;
|
|
55
|
-
}
|
|
56
|
-
return <ActionButton svg={presentationMode === 'fullscreen' ? <FullscreenExitSvg /> : <FullscreenEnterSvg />} onPress={this.toggleFullScreen} />;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
FullscreenButton.contextType = PlayerContext;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ActionButton } from './actionbutton/ActionButton';
|
|
2
|
-
import React, { PureComponent } from 'react';
|
|
3
|
-
import { PlayerContext, UiContext } from '../util/PlayerContext';
|
|
4
|
-
import { PlayerEventType, VolumeChangeEvent } from 'react-native-theoplayer';
|
|
5
|
-
import { Platform } from 'react-native';
|
|
6
|
-
import { VolumeOffSvg } from './svg/VolumeOffSvg';
|
|
7
|
-
import { VolumeUpSvg } from './svg/VolumeUpSvg';
|
|
8
|
-
|
|
9
|
-
interface MuteButtonState {
|
|
10
|
-
muted: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The default mute button for the `react-native-theoplayer` UI.
|
|
15
|
-
*/
|
|
16
|
-
export class MuteButton extends PureComponent<unknown, MuteButtonState> {
|
|
17
|
-
constructor(props: unknown) {
|
|
18
|
-
super(props);
|
|
19
|
-
this.state = { muted: false };
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
componentDidMount() {
|
|
23
|
-
const player = (this.context as UiContext).player;
|
|
24
|
-
player.addEventListener(PlayerEventType.VOLUME_CHANGE, this.onVolumeChange);
|
|
25
|
-
this.setState({ muted: player.muted });
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
componentWillUnmount() {
|
|
29
|
-
const player = (this.context as UiContext).player;
|
|
30
|
-
player.removeEventListener(PlayerEventType.VOLUME_CHANGE, this.onVolumeChange);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
private onVolumeChange = (_: VolumeChangeEvent) => {
|
|
34
|
-
const player = (this.context as UiContext).player;
|
|
35
|
-
this.setState({ muted: player.muted });
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
private toggleMuted = () => {
|
|
39
|
-
const player = (this.context as UiContext).player;
|
|
40
|
-
player.muted = !player.muted;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
render() {
|
|
44
|
-
const { muted } = this.state;
|
|
45
|
-
if (Platform.isTV) {
|
|
46
|
-
return <></>;
|
|
47
|
-
}
|
|
48
|
-
return <ActionButton svg={muted ? <VolumeOffSvg /> : <VolumeUpSvg />} onPress={this.toggleMuted} touchable={true} />;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
MuteButton.contextType = PlayerContext;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React, { PureComponent } from 'react';
|
|
2
|
-
import type { PresentationModeChangeEvent } from 'react-native-theoplayer';
|
|
3
|
-
import { PlayerEventType, PresentationMode } from 'react-native-theoplayer';
|
|
4
|
-
import { Platform } from 'react-native';
|
|
5
|
-
import { ActionButton } from './actionbutton/ActionButton';
|
|
6
|
-
import { PlayerContext, UiContext } from '../util/PlayerContext';
|
|
7
|
-
import { PipExitSvg } from './svg/PipExitSvg';
|
|
8
|
-
import { PipEnterSvg } from './svg/PipEnterSvg';
|
|
9
|
-
|
|
10
|
-
interface PipButtonState {
|
|
11
|
-
presentationMode: PresentationMode;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* The default button to enable picture-in-picture for the `react-native-theoplayer` UI.
|
|
16
|
-
*/
|
|
17
|
-
export class PipButton extends PureComponent<unknown, PipButtonState> {
|
|
18
|
-
constructor(props: unknown) {
|
|
19
|
-
super(props);
|
|
20
|
-
this.state = { presentationMode: PresentationMode.inline };
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
componentDidMount() {
|
|
24
|
-
const player = (this.context as UiContext).player;
|
|
25
|
-
player.addEventListener(PlayerEventType.PRESENTATIONMODE_CHANGE, this.onPresentationModeChange);
|
|
26
|
-
this.setState({ presentationMode: player.presentationMode });
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
componentWillUnmount() {
|
|
30
|
-
const player = (this.context as UiContext).player;
|
|
31
|
-
player.removeEventListener(PlayerEventType.PRESENTATIONMODE_CHANGE, this.onPresentationModeChange);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
private readonly onPresentationModeChange = (event: PresentationModeChangeEvent) => {
|
|
35
|
-
this.setState({ presentationMode: event.presentationMode });
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
private togglePip = () => {
|
|
39
|
-
const player = (this.context as UiContext).player;
|
|
40
|
-
switch (player.presentationMode) {
|
|
41
|
-
case 'inline':
|
|
42
|
-
case 'fullscreen':
|
|
43
|
-
player.presentationMode = PresentationMode.pip;
|
|
44
|
-
break;
|
|
45
|
-
case 'picture-in-picture':
|
|
46
|
-
player.presentationMode = PresentationMode.inline;
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
render() {
|
|
52
|
-
if (Platform.isTV) {
|
|
53
|
-
return <></>;
|
|
54
|
-
}
|
|
55
|
-
const { presentationMode } = this.state;
|
|
56
|
-
|
|
57
|
-
return <ActionButton svg={presentationMode === 'picture-in-picture' ? <PipExitSvg /> : <PipEnterSvg />} onPress={this.togglePip} />;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
PipButton.contextType = PlayerContext;
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { ActionButton } from './actionbutton/ActionButton';
|
|
2
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import React, { PureComponent } from 'react';
|
|
4
|
-
import { PlayerEventType } from 'react-native-theoplayer';
|
|
5
|
-
import { PlayerContext, UiContext } from '../util/PlayerContext';
|
|
6
|
-
import { PlaySvg } from './svg/PlaySvg';
|
|
7
|
-
|
|
8
|
-
import { PauseSvg } from './svg/PauseSvg';
|
|
9
|
-
import { ReplaySvg } from './svg/ReplaySvg';
|
|
10
|
-
|
|
11
|
-
interface PlayButtonProps {
|
|
12
|
-
/**
|
|
13
|
-
* The style overrides for the play/pause button.
|
|
14
|
-
*/
|
|
15
|
-
style?: StyleProp<ViewStyle>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface PlayButtonState {
|
|
19
|
-
paused: boolean;
|
|
20
|
-
ended: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The default play/pause button for the `react-native-theoplayer` UI.
|
|
25
|
-
*/
|
|
26
|
-
export class PlayButton extends PureComponent<PlayButtonProps, PlayButtonState> {
|
|
27
|
-
constructor(props: PlayButtonProps) {
|
|
28
|
-
super(props);
|
|
29
|
-
this.state = {
|
|
30
|
-
paused: true,
|
|
31
|
-
ended: false,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
componentDidMount() {
|
|
36
|
-
const context = this.context as UiContext;
|
|
37
|
-
context.player.addEventListener(PlayerEventType.PLAY, this.onPlay);
|
|
38
|
-
context.player.addEventListener(PlayerEventType.PLAYING, this.onPlay);
|
|
39
|
-
context.player.addEventListener(PlayerEventType.PAUSE, this.onPause);
|
|
40
|
-
context.player.addEventListener(PlayerEventType.SOURCE_CHANGE, this.onSourceChange);
|
|
41
|
-
context.player.addEventListener(PlayerEventType.ENDED, this.onEnded);
|
|
42
|
-
context.player.addEventListener(PlayerEventType.SEEKING, this.onSeeking);
|
|
43
|
-
this.setState({
|
|
44
|
-
paused: context.player.paused,
|
|
45
|
-
ended: context.player.currentTime === context.player.duration,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
componentWillUnmount() {
|
|
50
|
-
const context = this.context as UiContext;
|
|
51
|
-
context.player.removeEventListener(PlayerEventType.PLAY, this.onPlay);
|
|
52
|
-
context.player.removeEventListener(PlayerEventType.PLAYING, this.onPlay);
|
|
53
|
-
context.player.removeEventListener(PlayerEventType.PAUSE, this.onPause);
|
|
54
|
-
context.player.removeEventListener(PlayerEventType.SOURCE_CHANGE, this.onSourceChange);
|
|
55
|
-
context.player.removeEventListener(PlayerEventType.ENDED, this.onEnded);
|
|
56
|
-
context.player.removeEventListener(PlayerEventType.SEEKING, this.onSeeking);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
private onPlay = () => {
|
|
60
|
-
const player = (this.context as UiContext).player;
|
|
61
|
-
if (player.seeking) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
this.setState({ paused: false, ended: false });
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
private onPause = () => {
|
|
68
|
-
const player = (this.context as UiContext).player;
|
|
69
|
-
if (player.seeking) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
this.setState({ paused: true });
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
private onSourceChange = () => {
|
|
76
|
-
const player = (this.context as UiContext).player;
|
|
77
|
-
this.setState({ paused: player.paused });
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
private onEnded = () => {
|
|
81
|
-
this.setState({ ended: true });
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
private onSeeking = () => {
|
|
85
|
-
this.setState({ ended: false });
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
private togglePlayPause = () => {
|
|
89
|
-
const player = (this.context as UiContext).player;
|
|
90
|
-
if (player.paused) {
|
|
91
|
-
player.play();
|
|
92
|
-
} else {
|
|
93
|
-
player.pause();
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
render() {
|
|
98
|
-
const { paused, ended } = this.state;
|
|
99
|
-
const { style } = this.props;
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<ActionButton style={style} touchable={true} svg={ended ? <ReplaySvg /> : paused ? <PlaySvg /> : <PauseSvg />} onPress={this.togglePlayPause} />
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
PlayButton.contextType = PlayerContext;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { ActionButton } from './actionbutton/ActionButton';
|
|
2
|
-
import React, { PureComponent } from 'react';
|
|
3
|
-
import { PlayerContext, UiContext } from '../util/PlayerContext';
|
|
4
|
-
import { ForwardSvg } from './svg/ForwardSvg';
|
|
5
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
6
|
-
import { Animated, Easing, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
7
|
-
import { BackwardSvg } from './svg/BackwardSvg';
|
|
8
|
-
import { PlayerEventType, ProgressEvent } from 'react-native-theoplayer';
|
|
9
|
-
|
|
10
|
-
interface SkipButtonProps {
|
|
11
|
-
/**
|
|
12
|
-
* The style overrides for the skip button.
|
|
13
|
-
*/
|
|
14
|
-
style?: StyleProp<ViewStyle>;
|
|
15
|
-
/**
|
|
16
|
-
* The skip value for the skip button. This can be set to negative to skip backwards.
|
|
17
|
-
*/
|
|
18
|
-
skip: number;
|
|
19
|
-
/**
|
|
20
|
-
* Whether the skip button should do a rotation animation when pressed instead of fading.
|
|
21
|
-
*/
|
|
22
|
-
rotate?: boolean;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface SkipButtonState {
|
|
26
|
-
enabled: boolean;
|
|
27
|
-
spinValue: Animated.Value;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* The default skip button for the `react-native-theoplayer` UI.
|
|
32
|
-
*/
|
|
33
|
-
export class SkipButton extends PureComponent<SkipButtonProps, SkipButtonState> {
|
|
34
|
-
constructor(props: SkipButtonProps) {
|
|
35
|
-
super(props);
|
|
36
|
-
this.state = { enabled: false, spinValue: new Animated.Value(0) };
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
componentDidMount() {
|
|
40
|
-
const player = (this.context as UiContext).player;
|
|
41
|
-
player.addEventListener(PlayerEventType.PROGRESS, this.onTimeupdate);
|
|
42
|
-
this.setState({ enabled: player.seekable.length > 0 });
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
componentWillUnmount() {
|
|
46
|
-
const player = (this.context as UiContext).player;
|
|
47
|
-
player.removeEventListener(PlayerEventType.PROGRESS, this.onTimeupdate);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
private readonly onTimeupdate = (event: ProgressEvent) => {
|
|
51
|
-
this.setState({ enabled: event.seekable.length > 0 });
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
private readonly onPress = () => {
|
|
55
|
-
const { skip, rotate } = this.props;
|
|
56
|
-
const { spinValue } = this.state;
|
|
57
|
-
const player = (this.context as UiContext).player;
|
|
58
|
-
player.currentTime = player.currentTime + skip * 1e3;
|
|
59
|
-
|
|
60
|
-
if (rotate === true) {
|
|
61
|
-
Animated.timing(spinValue, {
|
|
62
|
-
toValue: 0.1,
|
|
63
|
-
duration: 100,
|
|
64
|
-
easing: Easing.linear,
|
|
65
|
-
useNativeDriver: true,
|
|
66
|
-
}).start(() => {
|
|
67
|
-
Animated.timing(spinValue, {
|
|
68
|
-
toValue: 0,
|
|
69
|
-
duration: 100,
|
|
70
|
-
easing: Easing.linear,
|
|
71
|
-
useNativeDriver: true,
|
|
72
|
-
}).start();
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
render() {
|
|
78
|
-
const { style, skip, rotate } = this.props;
|
|
79
|
-
const { enabled, spinValue } = this.state;
|
|
80
|
-
|
|
81
|
-
if (!enabled) {
|
|
82
|
-
return <></>;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const spin = spinValue.interpolate({
|
|
86
|
-
inputRange: [0, 1],
|
|
87
|
-
outputRange: skip >= 0 ? ['0deg', '360deg'] : ['360deg', '0deg'],
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
return (
|
|
91
|
-
<>
|
|
92
|
-
<PlayerContext.Consumer>
|
|
93
|
-
{(context: UiContext) => (
|
|
94
|
-
<Animated.View style={[{ height: '100%', aspectRatio: 1 }, style, { transform: [{ rotate: spin }] }]}>
|
|
95
|
-
<TouchableOpacity
|
|
96
|
-
activeOpacity={rotate === true ? 1 : 0.2}
|
|
97
|
-
style={[{ height: '100%', aspectRatio: 1, justifyContent: 'center' }, style]}
|
|
98
|
-
onPress={this.onPress}>
|
|
99
|
-
<ActionButton touchable={false} svg={skip < 0 ? <BackwardSvg /> : <ForwardSvg />} />
|
|
100
|
-
<View style={[StyleSheet.absoluteFill, { justifyContent: 'center' }]}>
|
|
101
|
-
<Text style={[context.style.text, { color: context.style.colors.text }]}>{Math.abs(skip)}</Text>
|
|
102
|
-
</View>
|
|
103
|
-
</TouchableOpacity>
|
|
104
|
-
</Animated.View>
|
|
105
|
-
)}
|
|
106
|
-
</PlayerContext.Consumer>
|
|
107
|
-
</>
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
SkipButton.contextType = PlayerContext;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { Image, ImageSourcePropType, Platform, StyleProp, TouchableOpacity, View, ViewStyle } from 'react-native';
|
|
2
|
-
import React, { ReactNode, useContext, useState } from 'react';
|
|
3
|
-
import { SvgContext } from '../svg/SvgUtils';
|
|
4
|
-
import { PlayerContext, UiContext } from '../../util/PlayerContext';
|
|
5
|
-
|
|
6
|
-
export interface ActionButtonProps {
|
|
7
|
-
/**
|
|
8
|
-
* The image to put in the button.
|
|
9
|
-
*/
|
|
10
|
-
icon?: ImageSourcePropType;
|
|
11
|
-
/**
|
|
12
|
-
* The SVG component to put in the button. Takes priority over images.
|
|
13
|
-
*/
|
|
14
|
-
svg?: ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* Whether the button should be touchable. This is `true` by default.
|
|
17
|
-
*/
|
|
18
|
-
touchable: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* The callback when the button is pressed.
|
|
21
|
-
*/
|
|
22
|
-
onPress?: () => void;
|
|
23
|
-
/**
|
|
24
|
-
* The styling overrides.
|
|
25
|
-
*/
|
|
26
|
-
style?: StyleProp<ViewStyle>;
|
|
27
|
-
/**
|
|
28
|
-
* Whether the button should be highlighted with `ColorTheme.iconSelected` color.
|
|
29
|
-
*/
|
|
30
|
-
highlighted?: boolean;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* The default style applied to the ActionButton
|
|
35
|
-
*/
|
|
36
|
-
export const DEFAULT_ACTION_BUTTON_STYLE: ViewStyle = {
|
|
37
|
-
height: '100%',
|
|
38
|
-
aspectRatio: 1,
|
|
39
|
-
padding: 5,
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The default button component that renders an image/svg source for the `react-native-theoplayer` UI.
|
|
44
|
-
*/
|
|
45
|
-
export const ActionButton = (props: ActionButtonProps) => {
|
|
46
|
-
const { icon, style, touchable, svg, onPress, highlighted } = props;
|
|
47
|
-
const [focused, setFocused] = useState<boolean>(false);
|
|
48
|
-
const context = useContext(PlayerContext);
|
|
49
|
-
|
|
50
|
-
const shouldChangeTintColor = highlighted || (focused && Platform.isTV);
|
|
51
|
-
|
|
52
|
-
if (!touchable) {
|
|
53
|
-
return <View style={[DEFAULT_ACTION_BUTTON_STYLE, style]}>{svg}</View>;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const onTouch = () => {
|
|
57
|
-
if (context.ui.buttonsEnabled_) {
|
|
58
|
-
onPress?.();
|
|
59
|
-
}
|
|
60
|
-
context.ui.onUserAction_();
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<PlayerContext.Consumer>
|
|
65
|
-
{(context: UiContext) => (
|
|
66
|
-
<TouchableOpacity
|
|
67
|
-
style={[DEFAULT_ACTION_BUTTON_STYLE, style]}
|
|
68
|
-
tvParallaxProperties={{ enabled: false }}
|
|
69
|
-
onPress={onTouch}
|
|
70
|
-
onFocus={() => {
|
|
71
|
-
context.ui.onUserAction_();
|
|
72
|
-
setFocused(true);
|
|
73
|
-
}}
|
|
74
|
-
onBlur={() => {
|
|
75
|
-
setFocused(false);
|
|
76
|
-
}}>
|
|
77
|
-
{/* Give priority to SVG over image sources.*/}
|
|
78
|
-
{svg && (
|
|
79
|
-
<SvgContext.Provider
|
|
80
|
-
value={{
|
|
81
|
-
fill: shouldChangeTintColor ? context.style.colors.iconSelected : context.style.colors.icon,
|
|
82
|
-
height: '100%',
|
|
83
|
-
width: '100%',
|
|
84
|
-
}}>
|
|
85
|
-
<View>{svg}</View>
|
|
86
|
-
</SvgContext.Provider>
|
|
87
|
-
)}
|
|
88
|
-
{svg === undefined && icon && (
|
|
89
|
-
<Image
|
|
90
|
-
style={[
|
|
91
|
-
{ height: '100%', width: '100%' },
|
|
92
|
-
{ tintColor: shouldChangeTintColor ? context.style.colors.iconSelected : context.style.colors.icon },
|
|
93
|
-
]}
|
|
94
|
-
source={icon}
|
|
95
|
-
/>
|
|
96
|
-
)}
|
|
97
|
-
</TouchableOpacity>
|
|
98
|
-
)}
|
|
99
|
-
</PlayerContext.Consumer>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
ActionButton.defaultProps = {
|
|
104
|
-
touchable: true,
|
|
105
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './actionbutton/ActionButton';
|
|
2
|
-
export * from './svg/barrel';
|
|
3
|
-
export * from './AirplayButton';
|
|
4
|
-
export * from './ChromecastButton';
|
|
5
|
-
export * from './FullscreenButton';
|
|
6
|
-
export * from './MuteButton';
|
|
7
|
-
export * from './PipButton';
|
|
8
|
-
export * from './PlayButton';
|
|
9
|
-
export * from './SkipButton';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { SvgProps } from 'react-native-svg';
|
|
2
|
-
import Svg, { Path } from 'react-native-svg';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { SvgContext } from './SvgUtils';
|
|
5
|
-
|
|
6
|
-
export const AirplaySvg = (props: SvgProps) => {
|
|
7
|
-
return (
|
|
8
|
-
<SvgContext.Consumer>
|
|
9
|
-
{(context) => (
|
|
10
|
-
<>
|
|
11
|
-
<Svg viewBox={'0 96 960 960'} {...context} {...props}>
|
|
12
|
-
<Path d="m273 936 207-206 206 206H273Zm-133-80q-24 0-42-18t-18-42V276q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H631v-60h189V276H140v520h189v60H140Zm340-290Z" />
|
|
13
|
-
</Svg>
|
|
14
|
-
</>
|
|
15
|
-
)}
|
|
16
|
-
</SvgContext.Consumer>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { SvgProps } from 'react-native-svg';
|
|
2
|
-
import Svg, { Path } from 'react-native-svg';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { SvgContext } from './SvgUtils';
|
|
5
|
-
|
|
6
|
-
export const ArrowForwardSvg = (props: SvgProps) => {
|
|
7
|
-
return (
|
|
8
|
-
<SvgContext.Consumer>
|
|
9
|
-
{(context) => (
|
|
10
|
-
<>
|
|
11
|
-
<Svg viewBox={'0 0 24 24'} {...context} {...props}>
|
|
12
|
-
<Path d="M6.925 21.325q-.45-.45-.45-1.113 0-.662.45-1.112l7.1-7.1L6.9 4.875q-.45-.45-.462-1.1-.013-.65.462-1.125.475-.45 1.125-.45t1.1.45l8.425 8.425q.2.2.287.437.088.238.088.488t-.088.488q-.087.237-.287.437L9.125 21.35q-.45.45-1.087.45-.638 0-1.113-.475Z" />
|
|
13
|
-
</Svg>
|
|
14
|
-
</>
|
|
15
|
-
)}
|
|
16
|
-
</SvgContext.Consumer>
|
|
17
|
-
);
|
|
18
|
-
};
|