diff --git a/CHANGELOG.md b/CHANGELOG.md index 9066159..2751daa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 0.7.2 (2024-05-15) + +### Fixed + +- Fixed an issue where the `SeekBar`'s seekable state was not updated when switching to a MP4 source. +- Fixed an issue where the `SkipButton` components are not rendered when switching sources while casting. + ## 0.7.1 (2024-04-16) ### Fixed diff --git a/package.json b/package.json index 6cea6ea..84c3cdf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@theoplayer/react-native-ui", - "version": "0.7.1", + "version": "0.7.2", "description": "A React Native UI for @theoplayer/react-native", "main": "lib/commonjs/index", "module": "lib/module/index", diff --git a/src/ui/components/button/SkipButton.tsx b/src/ui/components/button/SkipButton.tsx index f41368f..d2fac03 100644 --- a/src/ui/components/button/SkipButton.tsx +++ b/src/ui/components/button/SkipButton.tsx @@ -65,7 +65,8 @@ export class SkipButton extends PureComponent private readonly onPlaying = () => { const player = (this.context as UiContext).player; - this.setState({ enabled: player.seekable.length > 0 || player.buffered.length > 0 }); + const isCasting = player.cast.chromecast?.casting ?? false + this.setState({ enabled: player.seekable.length > 0 || player.buffered.length > 0 || isCasting}); }; private readonly onPress = () => { diff --git a/src/ui/components/seekbar/SeekBar.tsx b/src/ui/components/seekbar/SeekBar.tsx index ab9a433..b78f1ed 100644 --- a/src/ui/components/seekbar/SeekBar.tsx +++ b/src/ui/components/seekbar/SeekBar.tsx @@ -74,7 +74,10 @@ export class SeekBar extends PureComponent { } }; private _onLoadedMetadata = (event: LoadedMetadataEvent) => this.setState({ duration: event.duration }); - private _onDurationChange = (event: DurationChangeEvent) => this.setState({ duration: event.duration }); + private _onDurationChange = (event: DurationChangeEvent) => { + const player = (this.context as UiContext).player; + this.setState({ duration: event.duration, seekable: player.seekable }); + } private _onProgress = (event: ProgressEvent) => this.setState({ seekable: event.seekable }); private _onSlidingStart = (value: number) => {