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 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["isTileMapThumbnail","thumbnail","tileX","undefined","tileY","tileWidth","tileHeight","isImageThumbnail"],"sources":["Thumbnail.ts"],"sourcesContent":["export function isTileMapThumbnail(thumbnail: Thumbnail): thumbnail is TileMapThumbnail {\n return thumbnail.tileX !== undefined && thumbnail.tileY !== undefined && thumbnail.tileWidth !== undefined && thumbnail.tileHeight !== undefined;\n}\n\nexport function isImageThumbnail(thumbnail: Thumbnail): thumbnail is ImageThumbnail {\n return !isTileMapThumbnail(thumbnail);\n}\n\n/**\n * Description of a thumbnail, which can be either a full image or part of a tile map.\n */\nexport interface Thumbnail {\n /**\n * The url of the thumbnail image.\n */\n url: string;\n\n /**\n * Horizontal offset within the tile map in case the thumbnail is part of tile map.\n */\n tileX?: number;\n\n /**\n * Vertical offset within the tile map in case the thumbnail is part of tile map.\n */\n tileY?: number;\n\n /**\n * Width of a tile in case the thumbnail is part of tile map.\n */\n tileWidth?: number;\n\n /**\n * Height of a tile in case the thumbnail is part of tile map.\n */\n tileHeight?: number;\n}\n\n/**\n * Description of a tile-map thumbnail.\n */\nexport interface TileMapThumbnail extends Thumbnail {\n /**\n * The url of the thumbnail image.\n */\n url: string;\n\n /**\n * Horizontal offset within the tile map in case the thumbnail is part of tile map.\n */\n tileX: number;\n\n /**\n * Vertical offset within the tile map in case the thumbnail is part of tile map.\n */\n tileY: number;\n\n /**\n * Width of a tile in case the thumbnail is part of tile map.\n */\n tileWidth: number;\n\n /**\n * Height of a tile in case the thumbnail is part of tile map.\n */\n tileHeight: number;\n}\n\n/**\n * Description of a tile-map thumbnail.\n */\nexport type ImageThumbnail = Thumbnail;\n"],"mappings":"AAAA,OAAO,SAASA,kBAAkBA,CAACC,SAAoB,EAAiC;EACtF,OAAOA,SAAS,CAACC,KAAK,KAAKC,SAAS,IAAIF,SAAS,CAACG,KAAK,KAAKD,SAAS,IAAIF,SAAS,CAACI,SAAS,KAAKF,SAAS,IAAIF,SAAS,CAACK,UAAU,KAAKH,SAAS;AAClJ;AAEA,OAAO,SAASI,gBAAgBA,CAACN,SAAoB,EAA+B;EAClF,OAAO,CAACD,kBAAkB,CAACC,SAAS,CAAC;AACvC;;AAEA;AACA;AACA"}
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
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; }
|
|
2
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
-
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); }
|
|
4
|
-
import React, { PureComponent } from 'react';
|
|
5
|
-
import { Image, View } from 'react-native';
|
|
6
|
-
import { isThumbnailTrack, StaticTimeLabel } from 'react-native-theoplayer';
|
|
7
|
-
import { isTileMapThumbnail } from './Thumbnail';
|
|
8
|
-
import { URL as URLPolyfill } from './Urlpolyfill';
|
|
9
|
-
const SPRITE_REGEX = /^([^#]*)#xywh=(\d+),(\d+),(\d+),(\d+)\s*$/;
|
|
10
|
-
const TAG = 'ThumbnailView';
|
|
11
|
-
export const DEFAULT_THUMBNAIL_VIEW_STYLE = {
|
|
12
|
-
containerThumbnail: {
|
|
13
|
-
alignItems: 'center',
|
|
14
|
-
flexDirection: 'row'
|
|
15
|
-
},
|
|
16
|
-
thumbnail: {
|
|
17
|
-
overflow: 'hidden',
|
|
18
|
-
backgroundColor: 'transparent'
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
export class ThumbnailView extends PureComponent {
|
|
22
|
-
constructor(props) {
|
|
23
|
-
super(props);
|
|
24
|
-
_defineProperty(this, "_ismounted", false);
|
|
25
|
-
_defineProperty(this, "onTileImageLoad", thumbnail => () => {
|
|
26
|
-
if (!this._ismounted) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const {
|
|
30
|
-
size
|
|
31
|
-
} = this.props;
|
|
32
|
-
const {
|
|
33
|
-
tileWidth,
|
|
34
|
-
tileHeight
|
|
35
|
-
} = thumbnail;
|
|
36
|
-
if (tileWidth && tileHeight) {
|
|
37
|
-
Image.getSize(thumbnail.url, (width, height) => {
|
|
38
|
-
this.setState({
|
|
39
|
-
imageWidth: width,
|
|
40
|
-
imageHeight: height,
|
|
41
|
-
renderWidth: size,
|
|
42
|
-
renderHeight: tileHeight * size / tileWidth
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
_defineProperty(this, "onImageLoadError", event => {
|
|
48
|
-
console.error(TAG, 'Failed to load thumbnail url:', event.nativeEvent.error);
|
|
49
|
-
});
|
|
50
|
-
_defineProperty(this, "onImageLoad", thumbnail => () => {
|
|
51
|
-
if (!this._ismounted) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const {
|
|
55
|
-
size
|
|
56
|
-
} = this.props;
|
|
57
|
-
Image.getSize(thumbnail.url, (width, height) => {
|
|
58
|
-
this.setState({
|
|
59
|
-
imageWidth: width,
|
|
60
|
-
imageHeight: height,
|
|
61
|
-
renderWidth: size,
|
|
62
|
-
renderHeight: height * size / width
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
_defineProperty(this, "renderThumbnail", (thumbnail, index) => {
|
|
67
|
-
const {
|
|
68
|
-
imageWidth,
|
|
69
|
-
imageHeight,
|
|
70
|
-
renderWidth,
|
|
71
|
-
renderHeight
|
|
72
|
-
} = this.state;
|
|
73
|
-
const {
|
|
74
|
-
size
|
|
75
|
-
} = this.props;
|
|
76
|
-
const scale = 1.0;
|
|
77
|
-
if (isTileMapThumbnail(thumbnail)) {
|
|
78
|
-
const ratio = thumbnail.tileWidth == 0 ? 0 : scale * size / thumbnail.tileWidth;
|
|
79
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
80
|
-
key: index,
|
|
81
|
-
style: [DEFAULT_THUMBNAIL_VIEW_STYLE.thumbnail, {
|
|
82
|
-
width: scale * renderWidth,
|
|
83
|
-
height: scale * renderHeight
|
|
84
|
-
}]
|
|
85
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
|
86
|
-
resizeMode: 'cover',
|
|
87
|
-
style: {
|
|
88
|
-
position: 'absolute',
|
|
89
|
-
top: -ratio * thumbnail.tileY,
|
|
90
|
-
left: -ratio * thumbnail.tileX,
|
|
91
|
-
width: ratio * imageWidth,
|
|
92
|
-
height: ratio * imageHeight
|
|
93
|
-
},
|
|
94
|
-
source: {
|
|
95
|
-
uri: thumbnail.url
|
|
96
|
-
},
|
|
97
|
-
onError: this.onImageLoadError,
|
|
98
|
-
onLoad: this.onTileImageLoad(thumbnail)
|
|
99
|
-
}));
|
|
100
|
-
} else {
|
|
101
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
102
|
-
key: index,
|
|
103
|
-
style: [DEFAULT_THUMBNAIL_VIEW_STYLE.thumbnail, {
|
|
104
|
-
width: scale * renderWidth,
|
|
105
|
-
height: scale * renderHeight
|
|
106
|
-
}]
|
|
107
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
|
108
|
-
resizeMode: 'contain',
|
|
109
|
-
style: {
|
|
110
|
-
width: scale * size,
|
|
111
|
-
height: scale * renderHeight
|
|
112
|
-
},
|
|
113
|
-
source: {
|
|
114
|
-
uri: thumbnail.url
|
|
115
|
-
},
|
|
116
|
-
onError: this.onImageLoadError,
|
|
117
|
-
onLoad: this.onImageLoad(thumbnail)
|
|
118
|
-
}));
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
const {
|
|
122
|
-
size: _size
|
|
123
|
-
} = props;
|
|
124
|
-
this.state = {
|
|
125
|
-
imageWidth: _size,
|
|
126
|
-
imageHeight: _size,
|
|
127
|
-
renderWidth: _size,
|
|
128
|
-
renderHeight: 1
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
componentDidMount() {
|
|
132
|
-
this._ismounted = true;
|
|
133
|
-
}
|
|
134
|
-
componentWillUnmount() {
|
|
135
|
-
this._ismounted = false;
|
|
136
|
-
}
|
|
137
|
-
getCueIndexAtTime(time) {
|
|
138
|
-
const {
|
|
139
|
-
thumbnailTrack
|
|
140
|
-
} = this.props;
|
|
141
|
-
|
|
142
|
-
// Ignore if it's an invalid track or not a thumbnail track.
|
|
143
|
-
if (!isThumbnailTrack(thumbnailTrack)) {
|
|
144
|
-
console.warn(TAG, 'Invalid thumbnail track');
|
|
145
|
-
return undefined;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// Ignore if the track does not have cues
|
|
149
|
-
if (thumbnailTrack.cues == null || thumbnailTrack.cues.length == 0) {
|
|
150
|
-
return undefined;
|
|
151
|
-
}
|
|
152
|
-
const cues = thumbnailTrack.cues;
|
|
153
|
-
let cueIndex = 0;
|
|
154
|
-
for (const [index, cue] of cues.entries()) {
|
|
155
|
-
if (cue.startTime <= time) {
|
|
156
|
-
cueIndex = index;
|
|
157
|
-
} else if (time >= cue.endTime) {
|
|
158
|
-
return cueIndex;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return cueIndex;
|
|
162
|
-
}
|
|
163
|
-
resolveThumbnailUrl(thumbnail) {
|
|
164
|
-
const {
|
|
165
|
-
thumbnailTrack
|
|
166
|
-
} = this.props;
|
|
167
|
-
// NOTE: TextTrack.src is supported in Android SDK as of 3.5+
|
|
168
|
-
if (thumbnailTrack && thumbnailTrack.src) {
|
|
169
|
-
return new URLPolyfill(thumbnail, thumbnailTrack.src).href;
|
|
170
|
-
} else {
|
|
171
|
-
return thumbnail;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
getThumbnailImageForCue(cue) {
|
|
175
|
-
const thumbnailContent = cue && cue.content;
|
|
176
|
-
if (!thumbnailContent) {
|
|
177
|
-
// Cue does not contain any thumbnail info.
|
|
178
|
-
return null;
|
|
179
|
-
}
|
|
180
|
-
const spriteMatch = thumbnailContent.match(SPRITE_REGEX);
|
|
181
|
-
if (spriteMatch) {
|
|
182
|
-
// The thumbnail is part of a tile.
|
|
183
|
-
const [, url, x, y, w, h] = spriteMatch;
|
|
184
|
-
return {
|
|
185
|
-
tileX: +x,
|
|
186
|
-
tileY: +y,
|
|
187
|
-
tileWidth: +w,
|
|
188
|
-
tileHeight: +h,
|
|
189
|
-
url: this.resolveThumbnailUrl(url)
|
|
190
|
-
};
|
|
191
|
-
} else {
|
|
192
|
-
// The thumbnail is a separate image.
|
|
193
|
-
return {
|
|
194
|
-
url: this.resolveThumbnailUrl(thumbnailContent)
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
render() {
|
|
199
|
-
const {
|
|
200
|
-
time,
|
|
201
|
-
duration,
|
|
202
|
-
thumbnailTrack,
|
|
203
|
-
showTimeLabel,
|
|
204
|
-
timeLabelStyle
|
|
205
|
-
} = this.props;
|
|
206
|
-
if (!thumbnailTrack || !thumbnailTrack.cues || thumbnailTrack.cues.length === 0) {
|
|
207
|
-
// No thumbnails to render.
|
|
208
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
209
|
-
}
|
|
210
|
-
const nowCueIndex = this.getCueIndexAtTime(time);
|
|
211
|
-
if (nowCueIndex === undefined) {
|
|
212
|
-
// No thumbnail for current time
|
|
213
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
214
|
-
}
|
|
215
|
-
const current = this.getThumbnailImageForCue(thumbnailTrack.cues[nowCueIndex]);
|
|
216
|
-
if (current === null) {
|
|
217
|
-
// No thumbnail for current time
|
|
218
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
219
|
-
}
|
|
220
|
-
const {
|
|
221
|
-
renderHeight
|
|
222
|
-
} = this.state;
|
|
223
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
224
|
-
style: {
|
|
225
|
-
flexDirection: 'column'
|
|
226
|
-
}
|
|
227
|
-
}, showTimeLabel && /*#__PURE__*/React.createElement(StaticTimeLabel, {
|
|
228
|
-
style: [{
|
|
229
|
-
marginLeft: 20,
|
|
230
|
-
height: 20,
|
|
231
|
-
alignSelf: 'center'
|
|
232
|
-
}, timeLabelStyle],
|
|
233
|
-
time: time,
|
|
234
|
-
duration: duration,
|
|
235
|
-
showDuration: false
|
|
236
|
-
}), /*#__PURE__*/React.createElement(View, {
|
|
237
|
-
style: [DEFAULT_THUMBNAIL_VIEW_STYLE.containerThumbnail, {
|
|
238
|
-
height: renderHeight
|
|
239
|
-
}]
|
|
240
|
-
}, this.renderThumbnail(current, 0)));
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
_defineProperty(ThumbnailView, "defaultProps", {
|
|
244
|
-
showTimeLabel: true
|
|
245
|
-
});
|
|
246
|
-
//# sourceMappingURL=ThumbnailView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","Image","View","isThumbnailTrack","StaticTimeLabel","isTileMapThumbnail","URL","URLPolyfill","SPRITE_REGEX","TAG","DEFAULT_THUMBNAIL_VIEW_STYLE","containerThumbnail","alignItems","flexDirection","thumbnail","overflow","backgroundColor","ThumbnailView","constructor","props","_defineProperty","_ismounted","size","tileWidth","tileHeight","getSize","url","width","height","setState","imageWidth","imageHeight","renderWidth","renderHeight","event","console","error","nativeEvent","index","state","scale","ratio","createElement","key","style","resizeMode","position","top","tileY","left","tileX","source","uri","onError","onImageLoadError","onLoad","onTileImageLoad","onImageLoad","componentDidMount","componentWillUnmount","getCueIndexAtTime","time","thumbnailTrack","warn","undefined","cues","length","cueIndex","cue","entries","startTime","endTime","resolveThumbnailUrl","src","href","getThumbnailImageForCue","thumbnailContent","content","spriteMatch","match","x","y","w","h","render","duration","showTimeLabel","timeLabelStyle","Fragment","nowCueIndex","current","marginLeft","alignSelf","showDuration","renderThumbnail"],"sources":["ThumbnailView.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { Image, StyleProp, View, ViewStyle } from 'react-native';\nimport type { TextTrackCue } from 'react-native-theoplayer';\nimport { isThumbnailTrack, StaticTimeLabel, TextTrack } from 'react-native-theoplayer';\nimport type { Thumbnail } from './Thumbnail';\nimport { isTileMapThumbnail } from './Thumbnail';\nimport { URL as URLPolyfill } from './Urlpolyfill';\n\nconst SPRITE_REGEX = /^([^#]*)#xywh=(\\d+),(\\d+),(\\d+),(\\d+)\\s*$/;\nconst TAG = 'ThumbnailView';\n\ninterface ThumbnailViewState {\n imageWidth: number;\n imageHeight: number;\n renderWidth: number;\n renderHeight: number;\n}\n\nexport interface ThumbnailViewProps {\n /**\n * Thumbnail track. A valid thumbnail track should have properties:\n * <br/> - `'kind'` equals `'metadata'`.\n * <br/> - `'label'` equals `'thumbnails'`.\n */\n thumbnailTrack: TextTrack;\n\n /**\n * Current time.\n */\n time: number;\n\n /**\n * Stream duration\n */\n duration: number;\n\n /**\n * Whether to show a time label.\n */\n showTimeLabel: boolean;\n\n /**\n * Used to set the width of the rendered thumbnail. The height will be calculated according to the image's aspect ratio.\n */\n size: number;\n\n /**\n * Optional style applied to the time label.\n */\n timeLabelStyle?: StyleProp<ViewStyle>;\n}\n\nexport const DEFAULT_THUMBNAIL_VIEW_STYLE: ThumbnailStyle = {\n containerThumbnail: {\n alignItems: 'center',\n flexDirection: 'row',\n },\n thumbnail: {\n overflow: 'hidden',\n backgroundColor: 'transparent',\n },\n};\n\nexport interface ThumbnailStyle {\n containerThumbnail: ViewStyle;\n thumbnail: ViewStyle;\n}\n\nexport class ThumbnailView extends PureComponent<ThumbnailViewProps, ThumbnailViewState> {\n static defaultProps = {\n showTimeLabel: true,\n };\n private _ismounted = false;\n\n constructor(props: ThumbnailViewProps) {\n super(props);\n const { size } = props;\n this.state = { imageWidth: size, imageHeight: size, renderWidth: size, renderHeight: 1 };\n }\n\n componentDidMount() {\n this._ismounted = true;\n }\n\n componentWillUnmount() {\n this._ismounted = false;\n }\n\n private getCueIndexAtTime(time: number): number | undefined {\n const { thumbnailTrack } = this.props;\n\n // Ignore if it's an invalid track or not a thumbnail track.\n if (!isThumbnailTrack(thumbnailTrack)) {\n console.warn(TAG, 'Invalid thumbnail track');\n return undefined;\n }\n\n // Ignore if the track does not have cues\n if (thumbnailTrack.cues == null || thumbnailTrack.cues.length == 0) {\n return undefined;\n }\n\n const cues = thumbnailTrack.cues;\n let cueIndex = 0;\n for (const [index, cue] of cues.entries()) {\n if (cue.startTime <= time) {\n cueIndex = index;\n } else if (time >= cue.endTime) {\n return cueIndex;\n }\n }\n return cueIndex;\n }\n\n private resolveThumbnailUrl(thumbnail: string): string {\n const { thumbnailTrack } = this.props;\n // NOTE: TextTrack.src is supported in Android SDK as of 3.5+\n if (thumbnailTrack && thumbnailTrack.src) {\n return new URLPolyfill(thumbnail, thumbnailTrack.src).href;\n } else {\n return thumbnail;\n }\n }\n\n private getThumbnailImageForCue(cue: TextTrackCue): Thumbnail | null {\n const thumbnailContent = cue && cue.content;\n if (!thumbnailContent) {\n // Cue does not contain any thumbnail info.\n return null;\n }\n const spriteMatch = thumbnailContent.match(SPRITE_REGEX);\n if (spriteMatch) {\n // The thumbnail is part of a tile.\n const [, url, x, y, w, h] = spriteMatch;\n return {\n tileX: +x,\n tileY: +y,\n tileWidth: +w,\n tileHeight: +h,\n url: this.resolveThumbnailUrl(url),\n };\n } else {\n // The thumbnail is a separate image.\n return {\n url: this.resolveThumbnailUrl(thumbnailContent),\n };\n }\n }\n\n private onTileImageLoad = (thumbnail: Thumbnail) => () => {\n if (!this._ismounted) {\n return;\n }\n const { size } = this.props;\n const { tileWidth, tileHeight } = thumbnail;\n if (tileWidth && tileHeight) {\n Image.getSize(thumbnail.url, (width: number, height: number) => {\n this.setState({\n imageWidth: width,\n imageHeight: height,\n renderWidth: size,\n renderHeight: (tileHeight * size) / tileWidth,\n });\n });\n }\n };\n\n private onImageLoadError = (event: any) => {\n console.error(TAG, 'Failed to load thumbnail url:', event.nativeEvent.error);\n };\n\n private onImageLoad = (thumbnail: Thumbnail) => () => {\n if (!this._ismounted) {\n return;\n }\n const { size } = this.props;\n Image.getSize(thumbnail.url, (width: number, height: number) => {\n this.setState({\n imageWidth: width,\n imageHeight: height,\n renderWidth: size,\n renderHeight: (height * size) / width,\n });\n });\n };\n\n private renderThumbnail = (thumbnail: Thumbnail, index: number) => {\n const { imageWidth, imageHeight, renderWidth, renderHeight } = this.state;\n const { size } = this.props;\n const scale = 1.0;\n\n if (isTileMapThumbnail(thumbnail)) {\n const ratio = thumbnail.tileWidth == 0 ? 0 : (scale * size) / thumbnail.tileWidth;\n return (\n <View key={index} style={[DEFAULT_THUMBNAIL_VIEW_STYLE.thumbnail, { width: scale * renderWidth, height: scale * renderHeight }]}>\n <Image\n resizeMode={'cover'}\n style={{\n position: 'absolute',\n top: -ratio * thumbnail.tileY,\n left: -ratio * thumbnail.tileX,\n width: ratio * imageWidth,\n height: ratio * imageHeight,\n }}\n source={{ uri: thumbnail.url }}\n onError={this.onImageLoadError}\n onLoad={this.onTileImageLoad(thumbnail)}\n />\n </View>\n );\n } else {\n return (\n <View key={index} style={[DEFAULT_THUMBNAIL_VIEW_STYLE.thumbnail, { width: scale * renderWidth, height: scale * renderHeight }]}>\n <Image\n resizeMode={'contain'}\n style={{ width: scale * size, height: scale * renderHeight }}\n source={{ uri: thumbnail.url }}\n onError={this.onImageLoadError}\n onLoad={this.onImageLoad(thumbnail)}\n />\n </View>\n );\n }\n };\n\n render() {\n const { time, duration, thumbnailTrack, showTimeLabel, timeLabelStyle } = this.props;\n if (!thumbnailTrack || !thumbnailTrack.cues || thumbnailTrack.cues.length === 0) {\n // No thumbnails to render.\n return <></>;\n }\n\n const nowCueIndex = this.getCueIndexAtTime(time);\n if (nowCueIndex === undefined) {\n // No thumbnail for current time\n return <></>;\n }\n\n const current = this.getThumbnailImageForCue(thumbnailTrack.cues[nowCueIndex]);\n if (current === null) {\n // No thumbnail for current time\n return <></>;\n }\n const { renderHeight } = this.state;\n return (\n <View style={{ flexDirection: 'column' }}>\n {showTimeLabel && (\n <StaticTimeLabel\n style={[\n {\n marginLeft: 20,\n height: 20,\n alignSelf: 'center',\n },\n timeLabelStyle,\n ]}\n time={time}\n duration={duration}\n showDuration={false}\n />\n )}\n <View style={[DEFAULT_THUMBNAIL_VIEW_STYLE.containerThumbnail, { height: renderHeight }]}>{this.renderThumbnail(current, 0)}</View>\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,KAAK,EAAaC,IAAI,QAAmB,cAAc;AAEhE,SAASC,gBAAgB,EAAEC,eAAe,QAAmB,yBAAyB;AAEtF,SAASC,kBAAkB,QAAQ,aAAa;AAChD,SAASC,GAAG,IAAIC,WAAW,QAAQ,eAAe;AAElD,MAAMC,YAAY,GAAG,2CAA2C;AAChE,MAAMC,GAAG,GAAG,eAAe;AA2C3B,OAAO,MAAMC,4BAA4C,GAAG;EAC1DC,kBAAkB,EAAE;IAClBC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE;EACjB,CAAC;EACDC,SAAS,EAAE;IACTC,QAAQ,EAAE,QAAQ;IAClBC,eAAe,EAAE;EACnB;AACF,CAAC;AAOD,OAAO,MAAMC,aAAa,SAASjB,aAAa,CAAyC;EAMvFkB,WAAWA,CAACC,KAAyB,EAAE;IACrC,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,qBAHM,KAAK;IAAAA,eAAA,0BA6ECN,SAAoB,IAAK,MAAM;MACxD,IAAI,CAAC,IAAI,CAACO,UAAU,EAAE;QACpB;MACF;MACA,MAAM;QAAEC;MAAK,CAAC,GAAG,IAAI,CAACH,KAAK;MAC3B,MAAM;QAAEI,SAAS;QAAEC;MAAW,CAAC,GAAGV,SAAS;MAC3C,IAAIS,SAAS,IAAIC,UAAU,EAAE;QAC3BvB,KAAK,CAACwB,OAAO,CAACX,SAAS,CAACY,GAAG,EAAE,CAACC,KAAa,EAAEC,MAAc,KAAK;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appings":"AAAA,cAAc,2BAA2B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["URL","global"],"sources":["Urlpolyfill.web.ts"],"sourcesContent":["import 'url-polyfill';\nconst URL = global.URL;\nexport { URL };\n"],"mappings":"AAAA,OAAO,cAAc;AACrB,MAAMA,GAAG,GAAGC,MAAM,CAACD,GAAG;AACtB,SAASA,GAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './SingleThumbnailView';\nexport * from './Thumbnail';\n"],"mappings":"AAAA,cAAc,uBAAuB;AACrC,cAAc,aAAa"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Text } from 'react-native';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { PlayerContext } from '../util/PlayerContext';
|
|
4
|
-
const LIVE_LABEL = 'LIVE';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A static time label for the `react-native-theoplayer` UI.
|
|
8
|
-
*/
|
|
9
|
-
export function StaticTimeLabel(props) {
|
|
10
|
-
const {
|
|
11
|
-
style,
|
|
12
|
-
showDuration,
|
|
13
|
-
time,
|
|
14
|
-
duration
|
|
15
|
-
} = props;
|
|
16
|
-
|
|
17
|
-
// An unknown duration is reported as NaN.
|
|
18
|
-
if (isNaN(duration)) {
|
|
19
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Live streams report an Infinity duration.
|
|
23
|
-
if (!isFinite(duration)) {
|
|
24
|
-
return /*#__PURE__*/React.createElement(PlayerContext.Consumer, null, context => /*#__PURE__*/React.createElement(Text, {
|
|
25
|
-
style: [context.style.text, {
|
|
26
|
-
color: context.style.colors.text
|
|
27
|
-
}, style]
|
|
28
|
-
}, LIVE_LABEL));
|
|
29
|
-
}
|
|
30
|
-
try {
|
|
31
|
-
let currentTimeLabel = new Date(time).toISOString().substring(11, 19);
|
|
32
|
-
let durationLabel = new Date(duration).toISOString().substring(11, 19);
|
|
33
|
-
if (durationLabel.startsWith('00:')) {
|
|
34
|
-
// Don't render hours if not needed.
|
|
35
|
-
currentTimeLabel = currentTimeLabel.slice(3);
|
|
36
|
-
durationLabel = durationLabel.slice(3);
|
|
37
|
-
}
|
|
38
|
-
const label = showDuration ? `${currentTimeLabel} / ${durationLabel}` : currentTimeLabel;
|
|
39
|
-
return /*#__PURE__*/React.createElement(PlayerContext.Consumer, null, context => /*#__PURE__*/React.createElement(Text, {
|
|
40
|
-
style: [context.style.text, {
|
|
41
|
-
color: context.style.colors.text
|
|
42
|
-
}, style]
|
|
43
|
-
}, label));
|
|
44
|
-
} catch (ignore) {
|
|
45
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=StaticTimeLabel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Text","React","PlayerContext","LIVE_LABEL","StaticTimeLabel","props","style","showDuration","time","duration","isNaN","createElement","Fragment","isFinite","Consumer","context","text","color","colors","currentTimeLabel","Date","toISOString","substring","durationLabel","startsWith","slice","label","ignore"],"sources":["StaticTimeLabel.tsx"],"sourcesContent":["import { StyleProp, Text, TextStyle } from 'react-native';\nimport React from 'react';\nimport { PlayerContext, UiContext } from '../util/PlayerContext';\n\nexport interface StaticTimeLabelProps {\n /**\n * Whether to show the duration of the current source.\n */\n showDuration: boolean;\n /**\n * The style overrides.\n */\n style?: StyleProp<TextStyle>;\n /**\n * The current time of the player\n */\n time: number;\n /**\n * The duration of the current source.\n */\n duration: number;\n}\n\nconst LIVE_LABEL = 'LIVE';\n\n/**\n * A static time label for the `react-native-theoplayer` UI.\n */\nexport function StaticTimeLabel(props: StaticTimeLabelProps) {\n const { style, showDuration, time, duration } = props;\n\n // An unknown duration is reported as NaN.\n if (isNaN(duration)) {\n return <></>;\n }\n\n // Live streams report an Infinity duration.\n if (!isFinite(duration)) {\n return (\n <PlayerContext.Consumer>\n {(context: UiContext) => <Text style={[context.style.text, { color: context.style.colors.text }, style]}>{LIVE_LABEL}</Text>}\n </PlayerContext.Consumer>\n );\n }\n\n try {\n let currentTimeLabel = new Date(time).toISOString().substring(11, 19);\n let durationLabel = new Date(duration).toISOString().substring(11, 19);\n if (durationLabel.startsWith('00:')) {\n // Don't render hours if not needed.\n currentTimeLabel = currentTimeLabel.slice(3);\n durationLabel = durationLabel.slice(3);\n }\n const label = showDuration ? `${currentTimeLabel} / ${durationLabel}` : currentTimeLabel;\n return (\n <PlayerContext.Consumer>\n {(context: UiContext) => <Text style={[context.style.text, { color: context.style.colors.text }, style]}>{label}</Text>}\n </PlayerContext.Consumer>\n );\n } catch (ignore) {\n return <></>;\n }\n}\n"],"mappings":"AAAA,SAAoBA,IAAI,QAAmB,cAAc;AACzD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAmB,uBAAuB;AAqBhE,MAAMC,UAAU,GAAG,MAAM;;AAEzB;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAACC,KAA2B,EAAE;EAC3D,MAAM;IAAEC,KAAK;IAAEC,YAAY;IAAEC,IAAI;IAAEC;EAAS,CAAC,GAAGJ,KAAK;;EAErD;EACA,IAAIK,KAAK,CAACD,QAAQ,CAAC,EAAE;IACnB,oBAAOR,KAAA,CAAAU,aAAA,CAAAV,KAAA,CAAAW,QAAA,OAAK;EACd;;EAEA;EACA,IAAI,CAACC,QAAQ,CAACJ,QAAQ,CAAC,EAAE;IACvB,oBACER,KAAA,CAAAU,aAAA,CAACT,aAAa,CAACY,QAAQ,QACnBC,OAAkB,iBAAKd,KAAA,CAAAU,aAAA,CAACX,IAAI;MAACM,KAAK,EAAE,CAACS,OAAO,CAACT,KAAK,CAACU,IAAI,EAAE;QAAEC,KAAK,EAAEF,OAAO,CAACT,KAAK,CAACY,MAAM,CAACF;MAAK,CAAC,EAAEV,KAAK;IAAE,GAAEH,UAAU,CAAQ,CACrG;EAE7B;EAEA,IAAI;IACF,IAAIgB,gBAAgB,GAAG,IAAIC,IAAI,CAACZ,IAAI,CAAC,CAACa,WAAW,EAAE,CAACC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;IACrE,IAAIC,aAAa,GAAG,IAAIH,IAAI,CAACX,QAAQ,CAAC,CAACY,WAAW,EAAE,CAACC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;IACtE,IAAIC,aAAa,CAACC,UAAU,CAAC,KAAK,CAAC,EAAE;MACnC;MACAL,gBAAgB,GAAGA,gBAAgB,CAACM,KAAK,CAAC,CAAC,CAAC;MAC5CF,aAAa,GAAGA,aAAa,CAACE,KAAK,CAAC,CAAC,CAAC;IACxC;IACA,MAAMC,KAAK,GAAGnB,YAAY,GAAI,GAAEY,gBAAiB,MAAKI,aAAc,EAAC,GAAGJ,gBAAgB;IACxF,oBACElB,KAAA,CAAAU,aAAA,CAACT,aAAa,CAACY,QAAQ,QACnBC,OAAkB,iBAAKd,KAAA,CAAAU,aAAA,CAACX,IAAI;MAACM,KAAK,EAAE,CAACS,OAAO,CAACT,KAAK,CAACU,IAAI,EAAE;QAAEC,KAAK,EAAEF,OAAO,CAACT,KAAK,CAACY,MAAM,CAACF;MAAK,CAAC,EAAEV,KAAK;IAAE,GAAEoB,KAAK,CAAQ,CAChG;EAE7B,CAAC,CAAC,OAAOC,MAAM,EAAE;IACf,oBAAO1B,KAAA,CAAAU,aAAA,CAAAV,KAAA,CAAAW,QAAA,OAAK;EACd;AACF"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
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; }
|
|
2
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
-
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); }
|
|
4
|
-
import React, { PureComponent } from 'react';
|
|
5
|
-
import { PlayerEventType } from 'react-native-theoplayer';
|
|
6
|
-
import { PlayerContext } from '../util/PlayerContext';
|
|
7
|
-
import { StaticTimeLabel } from './StaticTimeLabel';
|
|
8
|
-
/**
|
|
9
|
-
* The default style for the time label.
|
|
10
|
-
*/
|
|
11
|
-
export const DEFAULT_TIME_LABEL_STYLE = {
|
|
12
|
-
marginLeft: 10,
|
|
13
|
-
marginRight: 10,
|
|
14
|
-
height: 20,
|
|
15
|
-
alignSelf: 'center'
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* The default time label component for the `react-native-theoplayer` UI.
|
|
20
|
-
*/
|
|
21
|
-
export class TimeLabel extends PureComponent {
|
|
22
|
-
constructor(props) {
|
|
23
|
-
super(props);
|
|
24
|
-
_defineProperty(this, "onTimeUpdate", event => {
|
|
25
|
-
const {
|
|
26
|
-
currentTime
|
|
27
|
-
} = event;
|
|
28
|
-
this.setState({
|
|
29
|
-
currentTime
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
_defineProperty(this, "onDurationChange", event => {
|
|
33
|
-
const {
|
|
34
|
-
duration
|
|
35
|
-
} = event;
|
|
36
|
-
this.setState({
|
|
37
|
-
duration
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
this.state = TimeLabel.initialState;
|
|
41
|
-
}
|
|
42
|
-
componentDidMount() {
|
|
43
|
-
const player = this.context.player;
|
|
44
|
-
player.addEventListener(PlayerEventType.TIME_UPDATE, this.onTimeUpdate);
|
|
45
|
-
player.addEventListener(PlayerEventType.DURATION_CHANGE, this.onDurationChange);
|
|
46
|
-
this.setState({
|
|
47
|
-
currentTime: player.currentTime,
|
|
48
|
-
duration: player.duration
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
componentWillUnmount() {
|
|
52
|
-
const player = this.context.player;
|
|
53
|
-
player.removeEventListener(PlayerEventType.TIME_UPDATE, this.onTimeUpdate);
|
|
54
|
-
player.removeEventListener(PlayerEventType.DURATION_CHANGE, this.onDurationChange);
|
|
55
|
-
}
|
|
56
|
-
render() {
|
|
57
|
-
const {
|
|
58
|
-
currentTime,
|
|
59
|
-
duration
|
|
60
|
-
} = this.state;
|
|
61
|
-
const {
|
|
62
|
-
style,
|
|
63
|
-
showDuration
|
|
64
|
-
} = this.props;
|
|
65
|
-
return /*#__PURE__*/React.createElement(StaticTimeLabel, {
|
|
66
|
-
showDuration: showDuration,
|
|
67
|
-
time: currentTime,
|
|
68
|
-
duration: duration,
|
|
69
|
-
style: [DEFAULT_TIME_LABEL_STYLE, style]
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
_defineProperty(TimeLabel, "initialState", {
|
|
74
|
-
currentTime: 0.0,
|
|
75
|
-
duration: 0
|
|
76
|
-
});
|
|
77
|
-
TimeLabel.contextType = PlayerContext;
|
|
78
|
-
//# sourceMappingURL=TimeLabel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","PlayerEventType","PlayerContext","StaticTimeLabel","DEFAULT_TIME_LABEL_STYLE","marginLeft","marginRight","height","alignSelf","TimeLabel","constructor","props","_defineProperty","event","currentTime","setState","duration","state","initialState","componentDidMount","player","context","addEventListener","TIME_UPDATE","onTimeUpdate","DURATION_CHANGE","onDurationChange","componentWillUnmount","removeEventListener","render","style","showDuration","createElement","time","contextType"],"sources":["TimeLabel.tsx"],"sourcesContent":["import type { StyleProp, TextStyle } from 'react-native';\nimport React, { PureComponent } from 'react';\nimport { DurationChangeEvent, PlayerEventType, TimeUpdateEvent } from 'react-native-theoplayer';\nimport { PlayerContext, UiContext } from '../util/PlayerContext';\nimport { StaticTimeLabel } from './StaticTimeLabel';\n\nexport interface TimeLabelProps {\n /**\n * Whether to show the duration of the player.\n */\n showDuration: boolean;\n /**\n * The style overrides.\n */\n style?: StyleProp<TextStyle>;\n}\n\nexport interface TimeLabelState {\n currentTime: number;\n duration: number;\n}\n\n/**\n * The default style for the time label.\n */\nexport const DEFAULT_TIME_LABEL_STYLE: TextStyle = {\n marginLeft: 10,\n marginRight: 10,\n height: 20,\n alignSelf: 'center',\n};\n\n/**\n * The default time label component for the `react-native-theoplayer` UI.\n */\nexport class TimeLabel extends PureComponent<TimeLabelProps, TimeLabelState> {\n private static initialState: TimeLabelState = {\n currentTime: 0.0,\n duration: 0,\n };\n\n constructor(props: TimeLabelProps) {\n super(props);\n this.state = TimeLabel.initialState;\n }\n\n componentDidMount() {\n const player = (this.context as UiContext).player;\n player.addEventListener(PlayerEventType.TIME_UPDATE, this.onTimeUpdate);\n player.addEventListener(PlayerEventType.DURATION_CHANGE, this.onDurationChange);\n this.setState({ currentTime: player.currentTime, duration: player.duration });\n }\n\n componentWillUnmount() {\n const player = (this.context as UiContext).player;\n player.removeEventListener(PlayerEventType.TIME_UPDATE, this.onTimeUpdate);\n player.removeEventListener(PlayerEventType.DURATION_CHANGE, this.onDurationChange);\n }\n\n private onTimeUpdate = (event: TimeUpdateEvent) => {\n const { currentTime } = event;\n this.setState({ currentTime });\n };\n\n private onDurationChange = (event: DurationChangeEvent) => {\n const { duration } = event;\n this.setState({ duration });\n };\n\n render() {\n const { currentTime, duration } = this.state;\n const { style, showDuration } = this.props;\n return (\n <StaticTimeLabel showDuration={showDuration} time={currentTime} duration={duration} style={[DEFAULT_TIME_LABEL_STYLE, style]}></StaticTimeLabel>\n );\n }\n}\n\nTimeLabel.contextType = PlayerContext;\n"],"mappings":";;;AACA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAA8BC,eAAe,QAAyB,yBAAyB;AAC/F,SAASC,aAAa,QAAmB,uBAAuB;AAChE,SAASC,eAAe,QAAQ,mBAAmB;AAkBnD;AACA;AACA;A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