Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/video_player_videohole/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.6.1

* Fix a "used after being disposed" error when a seek, position, or duration update completes after the controller is disposed.
* Fix multi-line WebVTT cues without an identifier being dropped.

## 0.6.0

* Migrate from Platform Channels to Dart FFI.
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player_videohole/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To use this package, add `video_player_videohole` as a dependency in your `pubsp

```yaml
dependencies:
video_player_videohole: ^0.6.0
video_player_videohole: ^0.6.1
```

Then you can import `video_player_videohole` in your Dart code:
Expand Down
4 changes: 2 additions & 2 deletions packages/video_player_videohole/lib/src/web_vtt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ List<Caption> _parseCaptionsFromWebVTTString(String file) {
continue;
}

// Caption has header
final bool hasHeader = captionLines.length > 2;
// See: https://www.w3.org/TR/webvtt1/#webvtt-cue-identifier for valid cue identifier
final bool hasHeader = !captionLines[0].contains(_webVTTArrow);
if (hasHeader) {
final int? tryParseCaptionNumber = int.tryParse(captionLines[0]);
if (tryParseCaptionNumber != null) {
Expand Down
9 changes: 9 additions & 0 deletions packages/video_player_videohole/lib/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,9 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
Future<void> play() async {
if (value.position == value.duration.end) {
await seekTo(Duration.zero);
if (_isDisposed) {
return;
}
}
value = value.copyWith(isPlaying: true);
await _applyPlayPause();
Expand Down Expand Up @@ -844,6 +847,9 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
}

void _updatePosition(Duration position) {
if (_isDisposed) {
return;
}
value = value.copyWith(
position: position,
caption: _getCaptionAt(position),
Expand All @@ -852,6 +858,9 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
}

void _updateDuration(DurationRange duration) {
if (_isDisposed) {
return;
}
value = value.copyWith(duration: duration);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/video_player_videohole/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: video_player_videohole
description: Flutter plugin for displaying inline video on Tizen TV devices.
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/main/packages/video_player_videohole
version: 0.6.0
version: 0.6.1

environment:
sdk: ">=3.1.0 <4.0.0"
Expand Down
Loading