react-native-theoplayer 2.8.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 +49 -13
- package/README.md +16 -2
- package/android/src/main/java/com/theoplayer/media/MediaNotificationBuilder.kt +5 -0
- package/android/src/main/java/com/theoplayer/media/MediaPlaybackService.kt +31 -8
- package/ios/contentprotection/THEOplayerRCTProxyContentProtectionIntegration.swift +19 -29
- package/lib/commonjs/api/cast/Chromecast.js.map +1 -1
- package/lib/commonjs/index.js +0 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/api/cast/Chromecast.js.map +1 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/api/cast/Chromecast.d.ts +1 -1
- package/lib/typescript/index.d.ts +0 -1
- package/package.json +2 -8
- package/react-native-theoplayer.podspec +1 -1
- package/src/api/cast/Chromecast.ts +1 -1
- package/src/index.tsx +0 -1
- 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 -10
- 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/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 -4
- 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/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 -8
- 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/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 -3
- 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
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ChromecastButton = void 0;
|
|
7
|
-
exports.isConnected = isConnected;
|
|
8
|
-
var _barrel = require("./../../../api/barrel");
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _PlayerContext = require("../util/PlayerContext");
|
|
11
|
-
var _ChromecastSvg = require("./svg/ChromecastSvg");
|
|
12
|
-
var _reactNative = require("react-native");
|
|
13
|
-
var _reactNativeTheoplayer = require("react-native-theoplayer");
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
18
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
19
|
-
function isConnected(state) {
|
|
20
|
-
return state === 'connecting' || state === 'connected';
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The button to enable Chromecast for web for the `react-native-theoplayer` UI
|
|
25
|
-
*/
|
|
26
|
-
class ChromecastButton extends _react.PureComponent {
|
|
27
|
-
constructor(props) {
|
|
28
|
-
super(props);
|
|
29
|
-
_defineProperty(this, "onCastStateChangeEvent", event => {
|
|
30
|
-
if (event.subType != _barrel.CastEventType.CHROMECAST_STATE_CHANGE) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
this.setState({
|
|
34
|
-
castState: event.state
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
_defineProperty(this, "onPress", () => {
|
|
38
|
-
const player = this.context.player;
|
|
39
|
-
if (isConnected(this.state.castState)) {
|
|
40
|
-
var _player$cast$chromeca;
|
|
41
|
-
(_player$cast$chromeca = player.cast.chromecast) === null || _player$cast$chromeca === void 0 ? void 0 : _player$cast$chromeca.stop();
|
|
42
|
-
} else {
|
|
43
|
-
var _player$cast$chromeca2;
|
|
44
|
-
(_player$cast$chromeca2 = player.cast.chromecast) === null || _player$cast$chromeca2 === void 0 ? void 0 : _player$cast$chromeca2.start();
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
this.state = ChromecastButton.initialState;
|
|
48
|
-
}
|
|
49
|
-
componentDidMount() {
|
|
50
|
-
var _player$cast$chromeca3;
|
|
51
|
-
const player = this.context.player;
|
|
52
|
-
player.addEventListener(_barrel.PlayerEventType.CAST_EVENT, this.onCastStateChangeEvent);
|
|
53
|
-
this.setState({
|
|
54
|
-
castState: ((_player$cast$chromeca3 = player.cast.chromecast) === null || _player$cast$chromeca3 === void 0 ? void 0 : _player$cast$chromeca3.state) ?? _barrel.CastState.unavailable
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
componentWillUnmount() {
|
|
58
|
-
const player = this.context.player;
|
|
59
|
-
player.removeEventListener(_barrel.PlayerEventType.CAST_EVENT, this.onCastStateChangeEvent);
|
|
60
|
-
}
|
|
61
|
-
render() {
|
|
62
|
-
const {
|
|
63
|
-
castState
|
|
64
|
-
} = this.state;
|
|
65
|
-
// TODO: state is reported as unavailable by Android bridge when it is available.
|
|
66
|
-
if (_reactNative.Platform.OS === 'web' && castState === _barrel.CastState.unavailable) {
|
|
67
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
68
|
-
}
|
|
69
|
-
return /*#__PURE__*/_react.default.createElement(_reactNativeTheoplayer.ActionButton, {
|
|
70
|
-
svg: /*#__PURE__*/_react.default.createElement(_ChromecastSvg.ChromecastSvg, null),
|
|
71
|
-
touchable: true,
|
|
72
|
-
onPress: this.onPress,
|
|
73
|
-
highlighted: isConnected(castState)
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.ChromecastButton = ChromecastButton;
|
|
78
|
-
_defineProperty(ChromecastButton, "initialState", {
|
|
79
|
-
castState: _barrel.CastState.unavailable
|
|
80
|
-
});
|
|
81
|
-
ChromecastButton.contextType = _PlayerContext.PlayerContext;
|
|
82
|
-
//# sourceMappingURL=ChromecastButton.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_barrel","require","_react","_interopRequireWildcard","_PlayerContext","_ChromecastSvg","_reactNative","_reactNativeTheoplayer","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_defineProperty","value","_toPropertyKey","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","isConnected","state","ChromecastButton","PureComponent","constructor","props","event","subType","CastEventType","CHROMECAST_STATE_CHANGE","setState","castState","player","context","_player$cast$chromeca","cast","chromecast","stop","_player$cast$chromeca2","start","initialState","componentDidMount","_player$cast$chromeca3","addEventListener","PlayerEventType","CAST_EVENT","onCastStateChangeEvent","CastState","unavailable","componentWillUnmount","removeEventListener","render","Platform","OS","createElement","Fragment","ActionButton","svg","ChromecastSvg","touchable","onPress","highlighted","exports","contextType","PlayerContext"],"sources":["ChromecastButton.web.tsx"],"sourcesContent":["import { CastEvent, CastEventType, CastState, PlayerEventType } from './../../../api/barrel';\nimport React, { PureComponent } from 'react';\nimport { PlayerContext, UiContext } from '../util/PlayerContext';\nimport { ChromecastSvg } from './svg/ChromecastSvg';\nimport { Platform } from 'react-native';\nimport { ActionButton } from 'react-native-theoplayer';\n\ninterface CastButtonState {\n castState: CastState;\n}\n\nexport function isConnected(state: CastState | undefined): boolean {\n return state === 'connecting' || state === 'connected';\n}\n\n/**\n * The button to enable Chromecast for web for the `react-native-theoplayer` UI\n */\nexport class ChromecastButton extends PureComponent<unknown, CastButtonState> {\n private static initialState: CastButtonState = {\n castState: CastState.unavailable,\n };\n\n constructor(props: unknown) {\n super(props);\n this.state = ChromecastButton.initialState;\n }\n\n componentDidMount() {\n const player = (this.context as UiContext).player;\n player.addEventListener(PlayerEventType.CAST_EVENT, this.onCastStateChangeEvent);\n this.setState({ castState: player.cast.chromecast?.state ?? CastState.unavailable });\n }\n\n componentWillUnmount() {\n const player = (this.context as UiContext).player;\n player.removeEventListener(PlayerEventType.CAST_EVENT, this.onCastStateChangeEvent);\n }\n\n private onCastStateChangeEvent = (event: CastEvent) => {\n if (event.subType != CastEventType.CHROMECAST_STATE_CHANGE) {\n return;\n }\n this.setState({ castState: event.state });\n };\n\n private onPress = () => {\n const player = (this.context as UiContext).player;\n if (isConnected(this.state.castState)) {\n player.cast.chromecast?.stop();\n } else {\n player.cast.chromecast?.start();\n }\n };\n\n render() {\n const { castState } = this.state;\n // TODO: state is reported as unavailable by Android bridge when it is available.\n if (Platform.OS === 'web' && castState === CastState.unavailable) {\n return <></>;\n }\n return <ActionButton svg={<ChromecastSvg />} touchable={true} onPress={this.onPress} highlighted={isConnected(castState)} />;\n }\n}\n\nChromecastButton.contextType = PlayerContext;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,sBAAA,GAAAN,OAAA;AAAuD,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAA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,CAACkB,mBAAmB,CAACN,uBAAe,CAACC,UAAU,EAAE,IAAI,CAACC,sBAAsB,CAAC;EACrF;EAkBAK,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEpB;IAAU,CAAC,GAAG,IAAI,CAACV,KAAK;IAChC;IACA,IAAI+B,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAItB,SAAS,KAAKgB,iBAAS,CAACC,WAAW,EAAE;MAChE,oBAAO1E,MAAA,CAAAa,OAAA,CAAAmE,aAAA,CAAAhF,MAAA,CAAAa,OAAA,CAAAoE,QAAA,OAAK;IACd;IACA,oBAAOjF,MAAA,CAAAa,OAAA,CAAAmE,aAAA,CAAC3E,sBAAA,CAAA6E,YAAY;MAACC,GAAG,eAAEnF,MAAA,CAAAa,OAAA,CAAAmE,aAAA,CAAC7E,cAAA,CAAAiF,aAAa,OAAI;MAACC,SAAS,EAAE,IAAK;MAACC,OAAO,EAAE,IAAI,CAACA,OAAQ;MAACC,WAAW,EAAEzC,WAAW,CAACW,SAAS;IAAE,EAAG;EAC9H;AACF;AAAC+B,OAAA,CAAAxC,gBAAA,GAAAA,gBAAA;AAAApB,eAAA,CA7CYoB,gBAAgB,kBACoB;EAC7CS,SAAS,EAAEgB,iBAAS,CAACC;AACvB,CAAC;AA4CH1B,gBAAgB,CAACyC,WAAW,GAAGC,4BAAa"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.FullscreenButton = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNativeTheoplayer = require("react-native-theoplayer");
|
|
9
|
-
var _reactNative = require("react-native");
|
|
10
|
-
var _ActionButton = require("./actionbutton/ActionButton");
|
|
11
|
-
var _PlayerContext = require("../util/PlayerContext");
|
|
12
|
-
var _FullscreenExitSvg = require("./svg/FullscreenExitSvg");
|
|
13
|
-
var _FullscreenEnterSvg = require("./svg/FullscreenEnterSvg");
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
18
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
19
|
-
/**
|
|
20
|
-
* The button to enable/disable fullscreen for the `react-native-theoplayer` UI.
|
|
21
|
-
*/
|
|
22
|
-
class FullscreenButton extends _react.PureComponent {
|
|
23
|
-
constructor(props) {
|
|
24
|
-
super(props);
|
|
25
|
-
_defineProperty(this, "onPresentationModeChange", event => {
|
|
26
|
-
this.setState({
|
|
27
|
-
presentationMode: event.presentationMode
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
_defineProperty(this, "toggleFullScreen", () => {
|
|
31
|
-
const player = this.context.player;
|
|
32
|
-
switch (player.presentationMode) {
|
|
33
|
-
case 'picture-in-picture':
|
|
34
|
-
case 'inline':
|
|
35
|
-
player.presentationMode = _reactNativeTheoplayer.PresentationMode.fullscreen;
|
|
36
|
-
break;
|
|
37
|
-
case 'fullscreen':
|
|
38
|
-
player.presentationMode = _reactNativeTheoplayer.PresentationMode.inline;
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
this.state = {
|
|
43
|
-
presentationMode: _reactNativeTheoplayer.PresentationMode.inline
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
componentDidMount() {
|
|
47
|
-
const player = this.context.player;
|
|
48
|
-
player.addEventListener(_reactNativeTheoplayer.PlayerEventType.PRESENTATIONMODE_CHANGE, this.onPresentationModeChange);
|
|
49
|
-
this.setState({
|
|
50
|
-
presentationMode: player.presentationMode
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
componentWillUnmount() {
|
|
54
|
-
const player = this.context.player;
|
|
55
|
-
player.removeEventListener(_reactNativeTheoplayer.PlayerEventType.PRESENTATIONMODE_CHANGE, this.onPresentationModeChange);
|
|
56
|
-
}
|
|
57
|
-
render() {
|
|
58
|
-
const {
|
|
59
|
-
presentationMode
|
|
60
|
-
} = this.state;
|
|
61
|
-
if (_reactNative.Platform.isTV) {
|
|
62
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
63
|
-
}
|
|
64
|
-
return /*#__PURE__*/_react.default.createElement(_ActionButton.ActionButton, {
|
|
65
|
-
svg: presentationMode === 'fullscreen' ? /*#__PURE__*/_react.default.createElement(_FullscreenExitSvg.FullscreenExitSvg, null) : /*#__PURE__*/_react.default.createElement(_FullscreenEnterSvg.FullscreenEnterSvg, null),
|
|
66
|
-
onPress: this.toggleFullScreen
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.FullscreenButton = FullscreenButton;
|
|
71
|
-
FullscreenButton.contextType = _PlayerContext.PlayerContext;
|
|
72
|
-
//# sourceMappingURL=FullscreenButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeTheoplayer","_reactNative","_ActionButton","_PlayerContext","_FullscreenExitSvg","_FullscreenEnterSvg","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_defineProperty","value","_toPropertyKey","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","FullscreenButton","PureComponent","constructor","props","event","setState","presentationMode","player","context","PresentationMode","fullscreen","inline","state","componentDidMount","addEventListener","PlayerEventType","PRESENTATIONMODE_CHANGE","onPresentationModeChange","componentWillUnmount","removeEventListener","render","Platform","isTV","createElement","Fragment","ActionButton","svg","FullscreenExitSvg","FullscreenEnterSvg","onPress","toggleFullScreen","exports","contextType","PlayerContext"],"sources":["FullscreenButton.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport type { PresentationModeChangeEvent } from 'react-native-theoplayer';\nimport { PlayerEventType, PresentationMode } from 'react-native-theoplayer';\nimport { Platform } from 'react-native';\nimport { ActionButton } from './actionbutton/ActionButton';\nimport { PlayerContext, UiContext } from '../util/PlayerContext';\nimport { FullscreenExitSvg } from './svg/FullscreenExitSvg';\nimport { FullscreenEnterSvg } from './svg/FullscreenEnterSvg';\n\ninterface FullscreenButtonState {\n presentationMode: PresentationMode;\n}\n\n/**\n * The button to enable/disable fullscreen for the `react-native-theoplayer` UI.\n */\nexport class FullscreenButton extends PureComponent<unknown, FullscreenButtonState> {\n constructor(props: unknown) {\n super(props);\n this.state = { presentationMode: PresentationMode.inline };\n }\n\n componentDidMount() {\n const player = (this.context as UiContext).player;\n player.addEventListener(PlayerEventType.PRESENTATIONMODE_CHANGE, this.onPresentationModeChange);\n this.setState({ presentationMode: player.presentationMode });\n }\n\n componentWillUnmount() {\n const player = (this.context as UiContext).player;\n player.removeEventListener(PlayerEventType.PRESENTATIONMODE_CHANGE, this.onPresentationModeChange);\n }\n\n private readonly onPresentationModeChange = (event: PresentationModeChangeEvent) => {\n this.setState({ presentationMode: event.presentationMode });\n };\n\n private toggleFullScreen = () => {\n const player = (this.context as UiContext).player;\n switch (player.presentationMode) {\n case 'picture-in-picture':\n case 'inline':\n player.presentationMode = PresentationMode.fullscreen;\n break;\n case 'fullscreen':\n player.presentationMode = PresentationMode.inline;\n break;\n }\n };\n\n render() {\n const { presentationMode } = this.state;\n if (Platform.isTV) {\n return <></>;\n }\n return <ActionButton svg={presentationMode === 'fullscreen' ? <FullscreenExitSvg /> : <FullscreenEnterSvg />} onPress={this.toggleFullScreen} />;\n }\n}\n\nFullscreenButton.contextType = PlayerContext;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AAA8D,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAa,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,I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BAAgB,EAAEC,MAAM,CAACD;IAAiB,CAAC,CAAC;EAC9D;EAEAY,oBAAoBA,CAAA,EAAG;IACrB,MAAMX,MAAM,GAAI,IAAI,CAACC,OAAO,CAAeD,MAAM;IACjDA,MAAM,CAACY,mBAAmB,CAACJ,sCAAe,CAACC,uBAAuB,EAAE,IAAI,CAACC,wBAAwB,CAAC;EACpG;EAmBAG,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEd;IAAiB,CAAC,GAAG,IAAI,CAACM,KAAK;IACvC,IAAIS,qBAAQ,CAACC,IAAI,EAAE;MACjB,oBAAOvE,MAAA,CAAAgB,OAAA,CAAAwD,aAAA,CAAAxE,MAAA,CAAAgB,OAAA,CAAAyD,QAAA,OAAK;IACd;IACA,oBAAOzE,MAAA,CAAAgB,OAAA,CAAAwD,aAAA,CAACnE,aAAA,CAAAqE,YAAY;MAACC,GAAG,EAAEpB,gBAAgB,KAAK,YAAY,gBAAGvD,MAAA,CAAAgB,OAAA,CAAAwD,aAAA,CAACjE,kBAAA,CAAAqE,iBAAiB,OAAG,gBAAG5E,MAAA,CAAAgB,OAAA,CAAAwD,aAAA,CAAChE,mBAAA,CAAAqE,kBAAkB,OAAI;MAACC,OAAO,EAAE,IAAI,CAACC;IAAiB,EAAG;EAClJ;AACF;AAACC,OAAA,CAAA/B,gBAAA,GAAAA,gBAAA;AAEDA,gBAAgB,CAACgC,WAAW,GAAGC,4BAAa"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MuteButton = void 0;
|
|
7
|
-
var _ActionButton = require("./actionbutton/ActionButton");
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _PlayerContext = require("../util/PlayerContext");
|
|
10
|
-
var _reactNativeTheoplayer = require("react-native-theoplayer");
|
|
11
|
-
var _reactNative = require("react-native");
|
|
12
|
-
var _VolumeOffSvg = require("./svg/VolumeOffSvg");
|
|
13
|
-
var _VolumeUpSvg = require("./svg/VolumeUpSvg");
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
18
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
19
|
-
/**
|
|
20
|
-
* The default mute button for the `react-native-theoplayer` UI.
|
|
21
|
-
*/
|
|
22
|
-
class MuteButton extends _react.PureComponent {
|
|
23
|
-
constructor(props) {
|
|
24
|
-
super(props);
|
|
25
|
-
_defineProperty(this, "onVolumeChange", _ => {
|
|
26
|
-
const player = this.context.player;
|
|
27
|
-
this.setState({
|
|
28
|
-
muted: player.muted
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
_defineProperty(this, "toggleMuted", () => {
|
|
32
|
-
const player = this.context.player;
|
|
33
|
-
player.muted = !player.muted;
|
|
34
|
-
});
|
|
35
|
-
this.state = {
|
|
36
|
-
muted: false
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
componentDidMount() {
|
|
40
|
-
const player = this.context.player;
|
|
41
|
-
player.addEventListener(_reactNativeTheoplayer.PlayerEventType.VOLUME_CHANGE, this.onVolumeChange);
|
|
42
|
-
this.setState({
|
|
43
|
-
muted: player.muted
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
componentWillUnmount() {
|
|
47
|
-
const player = this.context.player;
|
|
48
|
-
player.removeEventListener(_reactNativeTheoplayer.PlayerEventType.VOLUME_CHANGE, this.onVolumeChange);
|
|
49
|
-
}
|
|
50
|
-
render() {
|
|
51
|
-
const {
|
|
52
|
-
muted
|
|
53
|
-
} = this.state;
|
|
54
|
-
if (_reactNative.Platform.isTV) {
|
|
55
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
56
|
-
}
|
|
57
|
-
return /*#__PURE__*/_react.default.createElement(_ActionButton.ActionButton, {
|
|
58
|
-
svg: muted ? /*#__PURE__*/_react.default.createElement(_VolumeOffSvg.VolumeOffSvg, null) : /*#__PURE__*/_react.default.createElement(_VolumeUpSvg.VolumeUpSvg, null),
|
|
59
|
-
onPress: this.toggleMuted,
|
|
60
|
-
touchable: true
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.MuteButton = MuteButton;
|
|
65
|
-
MuteButton.contextType = _PlayerContext.PlayerContext;
|
|
66
|
-
//# sourceMappingURL=MuteButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_ActionButton","require","_react","_interopRequireWildcard","_PlayerContext","_reactNativeTheoplayer","_reactNative","_VolumeOffSvg","_VolumeUpSvg","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_defineProperty","value","_toPropertyKey","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","MuteButton","PureComponent","constructor","props","_","player","context","setState","muted","state","componentDidMount","addEventListener","PlayerEventType","VOLUME_CHANGE","onVolumeChange","componentWillUnmount","removeEventListener","render","Platform","isTV","createElement","Fragment","ActionButton","svg","VolumeOffSvg","VolumeUpSvg","onPress","toggleMuted","touchable","exports","contextType","PlayerContext"],"sources":["MuteButton.tsx"],"sourcesContent":["import { ActionButton } from './actionbutton/ActionButton';\nimport React, { PureComponent } from 'react';\nimport { PlayerContext, UiContext } from '../util/PlayerContext';\nimport { PlayerEventType, VolumeChangeEvent } from 'react-native-theoplayer';\nimport { Platform } from 'react-native';\nimport { VolumeOffSvg } from './svg/VolumeOffSvg';\nimport { VolumeUpSvg } from './svg/VolumeUpSvg';\n\ninterface MuteButtonState {\n muted: boolean;\n}\n\n/**\n * The default mute button for the `react-native-theoplayer` UI.\n */\nexport class MuteButton extends PureComponent<unknown, MuteButtonState> {\n constructor(props: unknown) {\n super(props);\n this.state = { muted: false };\n }\n\n componentDidMount() {\n const player = (this.context as UiContext).player;\n player.addEventListener(PlayerEventType.VOLUME_CHANGE, this.onVolumeChange);\n this.setState({ muted: player.muted });\n }\n\n componentWillUnmount() {\n const player = (this.context as UiContext).player;\n player.removeEventListener(PlayerEventType.VOLUME_CHANGE, this.onVolumeChange);\n }\n\n private onVolumeChange = (_: VolumeChangeEvent) => {\n const player = (this.context as UiContext).player;\n this.setState({ muted: player.muted });\n };\n\n private toggleMuted = () => {\n const player = (this.context as UiContext).player;\n player.muted = !player.muted;\n };\n\n render() {\n const { muted } = this.state;\n if (Platform.isTV) {\n return <></>;\n }\n return <ActionButton svg={muted ? <VolumeOffSvg /> : <VolumeUpSvg />} onPress={this.toggleMuted} touchable={true} />;\n }\n}\n\nMuteButton.contextType = PlayerContext;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAAgD,SAAAQ,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAW,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GA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AAA,CAAC7D,YAAA,CAAAkE,WAAW,OAAI;MAACC,OAAO,EAAE,IAAI,CAACC,WAAY;MAACC,SAAS,EAAE;IAAK,EAAG;EACtH;AACF;AAACC,OAAA,CAAA7B,UAAA,GAAAA,UAAA;AAEDA,UAAU,CAAC8B,WAAW,GAAGC,4BAAa"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PipButton = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNativeTheoplayer = require("react-native-theoplayer");
|
|
9
|
-
var _reactNative = require("react-native");
|
|
10
|
-
var _ActionButton = require("./actionbutton/ActionButton");
|
|
11
|
-
var _PlayerContext = require("../util/PlayerContext");
|
|
12
|
-
var _PipExitSvg = require("./svg/PipExitSvg");
|
|
13
|
-
var _PipEnterSvg = require("./svg/PipEnterSvg");
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
18
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
19
|
-
/**
|
|
20
|
-
* The default button to enable picture-in-picture for the `react-native-theoplayer` UI.
|
|
21
|
-
*/
|
|
22
|
-
class PipButton extends _react.PureComponent {
|
|
23
|
-
constructor(props) {
|
|
24
|
-
super(props);
|
|
25
|
-
_defineProperty(this, "onPresentationModeChange", event => {
|
|
26
|
-
this.setState({
|
|
27
|
-
presentationMode: event.presentationMode
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
_defineProperty(this, "togglePip", () => {
|
|
31
|
-
const player = this.context.player;
|
|
32
|
-
switch (player.presentationMode) {
|
|
33
|
-
case 'inline':
|
|
34
|
-
case 'fullscreen':
|
|
35
|
-
player.presentationMode = _reactNativeTheoplayer.PresentationMode.pip;
|
|
36
|
-
break;
|
|
37
|
-
case 'picture-in-picture':
|
|
38
|
-
player.presentationMode = _reactNativeTheoplayer.PresentationMode.inline;
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
this.state = {
|
|
43
|
-
presentationMode: _reactNativeTheoplayer.PresentationMode.inline
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
componentDidMount() {
|
|
47
|
-
const player = this.context.player;
|
|
48
|
-
player.addEventListener(_reactNativeTheoplayer.PlayerEventType.PRESENTATIONMODE_CHANGE, this.onPresentationModeChange);
|
|
49
|
-
this.setState({
|
|
50
|
-
presentationMode: player.presentationMode
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
componentWillUnmount() {
|
|
54
|
-
const player = this.context.player;
|
|
55
|
-
player.removeEventListener(_reactNativeTheoplayer.PlayerEventType.PRESENTATIONMODE_CHANGE, this.onPresentationModeChange);
|
|
56
|
-
}
|
|
57
|
-
render() {
|
|
58
|
-
if (_reactNative.Platform.isTV) {
|
|
59
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
60
|
-
}
|
|
61
|
-
const {
|
|
62
|
-
presentationMode
|
|
63
|
-
} = this.state;
|
|
64
|
-
return /*#__PURE__*/_react.default.createElement(_ActionButton.ActionButton, {
|
|
65
|
-
svg: presentationMode === 'picture-in-picture' ? /*#__PURE__*/_react.default.createElement(_PipExitSvg.PipExitSvg, null) : /*#__PURE__*/_react.default.createElement(_PipEnterSvg.PipEnterSvg, null),
|
|
66
|
-
onPress: this.togglePip
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.PipButton = PipButton;
|
|
71
|
-
PipButton.contextType = _PlayerContext.PlayerContext;
|
|
72
|
-
//# sourceMappingURL=PipButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeTheoplayer","_reactNative","_ActionButton","_PlayerContext","_PipExitSvg","_PipEnterSvg","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_defineProperty","value","_toPropertyKey","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","PipButton","PureComponent","constructor","props","event","setState","presentationMode","player","context","PresentationMode","pip","inline","state","componentDidMount","addEventListener","PlayerEventType","PRESENTATIONMODE_CHANGE","onPresentationModeChange","componentWillUnmount","removeEventListener","render","Platform","isTV","createElement","Fragment","ActionButton","svg","PipExitSvg","PipEnterSvg","onPress","togglePip","exports","contextType","PlayerContext"],"sources":["PipButton.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport type { PresentationModeChangeEvent } from 'react-native-theoplayer';\nimport { PlayerEventType, PresentationMode } from 'react-native-theoplayer';\nimport { Platform } from 'react-native';\nimport { ActionButton } from './actionbutton/ActionButton';\nimport { PlayerContext, UiContext } from '../util/PlayerContext';\nimport { PipExitSvg } from './svg/PipExitSvg';\nimport { PipEnterSvg } from './svg/PipEnterSvg';\n\ninterface PipButtonState {\n presentationMode: PresentationMode;\n}\n\n/**\n * The default button to enable picture-in-picture for the `react-native-theoplayer` UI.\n */\nexport class PipButton extends PureComponent<unknown, PipButtonState> {\n constructor(props: unknown) {\n super(props);\n this.state = { presentationMode: PresentationMode.inline };\n }\n\n componentDidMount() {\n const player = (this.context as UiContext).player;\n player.addEventListener(PlayerEventType.PRESENTATIONMODE_CHANGE, this.onPresentationModeChange);\n this.setState({ presentationMode: player.presentationMode });\n }\n\n componentWillUnmount() {\n const player = (this.context as UiContext).player;\n player.removeEventListener(PlayerEventType.PRESENTATIONMODE_CHANGE, this.onPresentationModeChange);\n }\n\n private readonly onPresentationModeChange = (event: PresentationModeChangeEvent) => {\n this.setState({ presentationMode: event.presentationMode });\n };\n\n private togglePip = () => {\n const player = (this.context as UiContext).player;\n switch (player.presentationMode) {\n case 'inline':\n case 'fullscreen':\n player.presentationMode = PresentationMode.pip;\n break;\n case 'picture-in-picture':\n player.presentationMode = PresentationMode.inline;\n break;\n }\n };\n\n render() {\n if (Platform.isTV) {\n return <></>;\n }\n const { presentationMode } = this.state;\n\n return <ActionButton svg={presentationMode === 'picture-in-picture' ? <PipExitSvg /> : <PipEnterSvg />} onPress={this.togglePip} />;\n }\n}\n\nPipButton.contextType = PlayerContext;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAA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EAAG;EACrI;AACF;AAACC,OAAA,CAAA/B,SAAA,GAAAA,SAAA;AAEDA,SAAS,CAACgC,WAAW,GAAGC,4BAAa"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PlayButton = void 0;
|
|
7
|
-
var _ActionButton = require("./actionbutton/ActionButton");
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _reactNativeTheoplayer = require("react-native-theoplayer");
|
|
10
|
-
var _PlayerContext = require("../util/PlayerContext");
|
|
11
|
-
var _PlaySvg = require("./svg/PlaySvg");
|
|
12
|
-
var _PauseSvg = require("./svg/PauseSvg");
|
|
13
|
-
var _ReplaySvg = require("./svg/ReplaySvg");
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
18
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
19
|
-
/**
|
|
20
|
-
* The default play/pause button for the `react-native-theoplayer` UI.
|
|
21
|
-
*/
|
|
22
|
-
class PlayButton extends _react.PureComponent {
|
|
23
|
-
constructor(props) {
|
|
24
|
-
super(props);
|
|
25
|
-
_defineProperty(this, "onPlay", () => {
|
|
26
|
-
const player = this.context.player;
|
|
27
|
-
if (player.seeking) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
this.setState({
|
|
31
|
-
paused: false,
|
|
32
|
-
ended: false
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
_defineProperty(this, "onPause", () => {
|
|
36
|
-
const player = this.context.player;
|
|
37
|
-
if (player.seeking) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
this.setState({
|
|
41
|
-
paused: true
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
_defineProperty(this, "onSourceChange", () => {
|
|
45
|
-
const player = this.context.player;
|
|
46
|
-
this.setState({
|
|
47
|
-
paused: player.paused
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
_defineProperty(this, "onEnded", () => {
|
|
51
|
-
this.setState({
|
|
52
|
-
ended: true
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
_defineProperty(this, "onSeeking", () => {
|
|
56
|
-
this.setState({
|
|
57
|
-
ended: false
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
_defineProperty(this, "togglePlayPause", () => {
|
|
61
|
-
const player = this.context.player;
|
|
62
|
-
if (player.paused) {
|
|
63
|
-
player.play();
|
|
64
|
-
} else {
|
|
65
|
-
player.pause();
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
this.state = {
|
|
69
|
-
paused: true,
|
|
70
|
-
ended: false
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
componentDidMount() {
|
|
74
|
-
const context = this.context;
|
|
75
|
-
context.player.addEventListener(_reactNativeTheoplayer.PlayerEventType.PLAY, this.onPlay);
|
|
76
|
-
context.player.addEventListener(_reactNativeTheoplayer.PlayerEventType.PLAYING, this.onPlay);
|
|
77
|
-
context.player.addEventListener(_reactNativeTheoplayer.PlayerEventType.PAUSE, this.onPause);
|
|
78
|
-
context.player.addEventListener(_reactNativeTheoplayer.PlayerEventType.SOURCE_CHANGE, this.onSourceChange);
|
|
79
|
-
context.player.addEventListener(_reactNativeTheoplayer.PlayerEventType.ENDED, this.onEnded);
|
|
80
|
-
context.player.addEventListener(_reactNativeTheoplayer.PlayerEventType.SEEKING, this.onSeeking);
|
|
81
|
-
this.setState({
|
|
82
|
-
paused: context.player.paused,
|
|
83
|
-
ended: context.player.currentTime === context.player.duration
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
componentWillUnmount() {
|
|
87
|
-
const context = this.context;
|
|
88
|
-
context.player.removeEventListener(_reactNativeTheoplayer.PlayerEventType.PLAY, this.onPlay);
|
|
89
|
-
context.player.removeEventListener(_reactNativeTheoplayer.PlayerEventType.PLAYING, this.onPlay);
|
|
90
|
-
context.player.removeEventListener(_reactNativeTheoplayer.PlayerEventType.PAUSE, this.onPause);
|
|
91
|
-
context.player.removeEventListener(_reactNativeTheoplayer.PlayerEventType.SOURCE_CHANGE, this.onSourceChange);
|
|
92
|
-
context.player.removeEventListener(_reactNativeTheoplayer.PlayerEventType.ENDED, this.onEnded);
|
|
93
|
-
context.player.removeEventListener(_reactNativeTheoplayer.PlayerEventType.SEEKING, this.onSeeking);
|
|
94
|
-
}
|
|
95
|
-
render() {
|
|
96
|
-
const {
|
|
97
|
-
paused,
|
|
98
|
-
ended
|
|
99
|
-
} = this.state;
|
|
100
|
-
const {
|
|
101
|
-
style
|
|
102
|
-
} = this.props;
|
|
103
|
-
return /*#__PURE__*/_react.default.createElement(_ActionButton.ActionButton, {
|
|
104
|
-
style: style,
|
|
105
|
-
touchable: true,
|
|
106
|
-
svg: ended ? /*#__PURE__*/_react.default.createElement(_ReplaySvg.ReplaySvg, null) : paused ? /*#__PURE__*/_react.default.createElement(_PlaySvg.PlaySvg, null) : /*#__PURE__*/_react.default.createElement(_PauseSvg.PauseSvg, null),
|
|
107
|
-
onPress: this.togglePlayPause
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
exports.PlayButton = PlayButton;
|
|
112
|
-
PlayButton.contextType = _PlayerContext.PlayerContext;
|
|
113
|
-
//# sourceMappingURL=PlayButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_ActionButton","require","_react","_interopRequireWildcard","_reactNativeTheoplayer","_PlayerContext","_PlaySvg","_PauseSvg","_ReplaySvg","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_defineProperty","value","_toPropertyKey","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","PlayButton","PureComponent","constructor","props","player","context","seeking","setState","paused","ended","play","pause","state","componentDidMount","addEventListener","PlayerEventType","PLAY","onPlay","PLAYING","PAUSE","onPause","SOURCE_CHANGE","onSourceChange","ENDED","onEnded","SEEKING","onSeeking","currentTime","duration","componentWillUnmount","removeEventListener","render","style","createElement","ActionButton","touchable","svg","ReplaySvg","PlaySvg","PauseSvg","onPress","togglePlayPause","exports","contextType","PlayerContext"],"sources":["PlayButton.tsx"],"sourcesContent":["import { ActionButton } from './actionbutton/ActionButton';\nimport type { StyleProp, ViewStyle } from 'react-native';\nimport React, { PureComponent } from 'react';\nimport { PlayerEventType } from 'react-native-theoplayer';\nimport { PlayerContext, UiContext } from '../util/PlayerContext';\nimport { PlaySvg } from './svg/PlaySvg';\n\nimport { PauseSvg } from './svg/PauseSvg';\nimport { ReplaySvg } from './svg/ReplaySvg';\n\ninterface PlayButtonProps {\n /**\n * The style overrides for the play/pause button.\n */\n style?: StyleProp<ViewStyle>;\n}\n\ninterface PlayButtonState {\n paused: boolean;\n ended: boolean;\n}\n\n/**\n * The default play/pause button for the `react-native-theoplayer` UI.\n */\nexport class PlayButton extends PureComponent<PlayButtonProps, PlayButtonState> {\n constructor(props: PlayButtonProps) {\n super(props);\n this.state = {\n paused: true,\n ended: false,\n };\n }\n\n componentDidMount() {\n const context = this.context as UiContext;\n context.player.addEventListener(PlayerEventType.PLAY, this.onPlay);\n context.player.addEventListener(PlayerEventType.PLAYING, this.onPlay);\n context.player.addEventListener(PlayerEventType.PAUSE, this.onPause);\n context.player.addEventListener(PlayerEventType.SOURCE_CHANGE, this.onSourceChange);\n context.player.addEventListener(PlayerEventType.ENDED, this.onEnded);\n context.player.addEventListener(PlayerEventType.SEEKING, this.onSeeking);\n this.setState({\n paused: context.player.paused,\n ended: context.player.currentTime === context.player.duration,\n });\n }\n\n componentWillUnmount() {\n const context = this.context as UiContext;\n context.player.removeEventListener(PlayerEventType.PLAY, this.onPlay);\n context.player.removeEventListener(PlayerEventType.PLAYING, this.onPlay);\n context.player.removeEventListener(PlayerEventType.PAUSE, this.onPause);\n context.player.removeEventListener(PlayerEventType.SOURCE_CHANGE, this.onSourceChange);\n context.player.removeEventListener(PlayerEventType.ENDED, this.onEnded);\n context.player.removeEventListener(PlayerEventType.SEEKING, this.onSeeking);\n }\n\n private onPlay = () => {\n const player = (this.context as UiContext).player;\n if (player.seeking) {\n return;\n }\n this.setState({ paused: false, ended: false });\n };\n\n private onPause = () => {\n const player = (this.context as UiContext).player;\n if (player.seeking) {\n return;\n }\n this.setState({ paused: true });\n };\n\n private onSourceChange = () => {\n const player = (this.context as UiContext).player;\n this.setState({ paused: player.paused });\n };\n\n private onEnded = () => {\n this.setState({ ended: true });\n };\n\n private onSeeking = () => {\n this.setState({ ended: false });\n };\n\n private togglePlayPause = () => {\n const player = (this.context as UiContext).player;\n if (player.paused) {\n player.play();\n } else {\n player.pause();\n }\n };\n\n render() {\n const { paused, ended } = this.state;\n const { style } = this.props;\n\n return (\n <ActionButton style={style} touchable={true} svg={ended ? <ReplaySvg /> : paused ? <PlaySvg /> : <PauseSvg />} onPress={this.togglePlayPause} />\n );\n }\n}\n\nPlayButton.contextType = PlayerContext;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAEA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAA4C,SAAAQ,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAW,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,M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
-
});
|
|
6
|
-
exports.SkipButton = void 0;
|
|
7
|
-
var _ActionButton = require("./actionbutton/ActionButton");
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _PlayerContext = require("../util/PlayerContext");
|
|
10
|
-
var _ForwardSvg = require("./svg/ForwardSvg");
|
|
11
|
-
var _reactNative = require("react-native");
|
|
12
|
-
var _BackwardSvg = require("./svg/BackwardSvg");
|
|
13
|
-
var _reactNativeTheoplayer = require("react-native-theoplayer");
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
18
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
19
|
-
/**
|
|
20
|
-
* The default skip button for the `react-native-theoplayer` UI.
|
|
21
|
-
*/
|
|
22
|
-
class SkipButton extends _react.PureComponent {
|
|
23
|
-
constructor(props) {
|
|
24
|
-
super(props);
|
|
25
|
-
_defineProperty(this, "onTimeupdate", event => {
|
|
26
|
-
this.setState({
|
|
27
|
-
enabled: event.seekable.length > 0
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
_defineProperty(this, "onPress", () => {
|
|
31
|
-
const {
|
|
32
|
-
skip,
|
|
33
|
-
rotate
|
|
34
|
-
} = this.props;
|
|
35
|
-
const {
|
|
36
|
-
spinValue
|
|
37
|
-
} = this.state;
|
|
38
|
-
const player = this.context.player;
|
|
39
|
-
player.currentTime = player.currentTime + skip * 1e3;
|
|
40
|
-
if (rotate === true) {
|
|
41
|
-
_reactNative.Animated.timing(spinValue, {
|
|
42
|
-
toValue: 0.1,
|
|
43
|
-
duration: 100,
|
|
44
|
-
easing: _reactNative.Easing.linear,
|
|
45
|
-
useNativeDriver: true
|
|
46
|
-
}).start(() => {
|
|
47
|
-
_reactNative.Animated.timing(spinValue, {
|
|
48
|
-
toValue: 0,
|
|
49
|
-
duration: 100,
|
|
50
|
-
easing: _reactNative.Easing.linear,
|
|
51
|
-
useNativeDriver: true
|
|
52
|
-
}).start();
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
this.state = {
|
|
57
|
-
enabled: false,
|
|
58
|
-
spinValue: new _reactNative.Animated.Value(0)
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
componentDidMount() {
|
|
62
|
-
const player = this.context.player;
|
|
63
|
-
player.addEventListener(_reactNativeTheoplayer.PlayerEventType.PROGRESS, this.onTimeupdate);
|
|
64
|
-
this.setState({
|
|
65
|
-
enabled: player.seekable.length > 0
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
componentWillUnmount() {
|
|
69
|
-
const player = this.context.player;
|
|
70
|
-
player.removeEventListener(_reactNativeTheoplayer.PlayerEventType.PROGRESS, this.onTimeupdate);
|
|
71
|
-
}
|
|
72
|
-
render() {
|
|
73
|
-
const {
|
|
74
|
-
style,
|
|
75
|
-
skip,
|
|
76
|
-
rotate
|
|
77
|
-
} = this.props;
|
|
78
|
-
const {
|
|
79
|
-
enabled,
|
|
80
|
-
spinValue
|
|
81
|
-
} = this.state;
|
|
82
|
-
if (!enabled) {
|
|
83
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
84
|
-
}
|
|
85
|
-
const spin = spinValue.interpolate({
|
|
86
|
-
inputRange: [0, 1],
|
|
87
|
-
outputRange: skip >= 0 ? ['0deg', '360deg'] : ['360deg', '0deg']
|
|
88
|
-
});
|
|
89
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_PlayerContext.PlayerContext.Consumer, null, context => /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
90
|
-
style: [{
|
|
91
|
-
height: '100%',
|
|
92
|
-
aspectRatio: 1
|
|
93
|
-
}, style, {
|
|
94
|
-
transform: [{
|
|
95
|
-
rotate: spin
|
|
96
|
-
}]
|
|
97
|
-
}]
|
|
98
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
99
|
-
activeOpacity: rotate === true ? 1 : 0.2,
|
|
100
|
-
style: [{
|
|
101
|
-
height: '100%',
|
|
102
|
-
aspectRatio: 1,
|
|
103
|
-
justifyContent: 'center'
|
|
104
|
-
}, style],
|
|
105
|
-
onPress: this.onPress
|
|
106
|
-
}, /*#__PURE__*/_react.default.createElement(_ActionButton.ActionButton, {
|
|
107
|
-
touchable: false,
|
|
108
|
-
svg: skip < 0 ? /*#__PURE__*/_react.default.createElement(_BackwardSvg.BackwardSvg, null) : /*#__PURE__*/_react.default.createElement(_ForwardSvg.ForwardSvg, null)
|
|
109
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
110
|
-
style: [_reactNative.StyleSheet.absoluteFill, {
|
|
111
|
-
justifyContent: 'center'
|
|
112
|
-
}]
|
|
113
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
114
|
-
style: [context.style.text, {
|
|
115
|
-
color: context.style.colors.text
|
|
116
|
-
}]
|
|
117
|
-
}, Math.abs(skip)))))));
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
exports.SkipButton = SkipButton;
|
|
121
|
-
SkipButton.contextType = _PlayerContext.PlayerContext;
|
|
122
|
-
//# sourceMappingURL=SkipButton.js.map
|