Skip to content
Open
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
6 changes: 6 additions & 0 deletions packages/video_player_avplay/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.8.15

* Added `setAbr` property to disable adaptive bitrate switching for HLS streams.
* HLS fixed bitrate now supported via `STARTBITRATE + SET_ABR` combination.
* Removed logging from the Dart public API.

## 0.8.14

* Update plusplayer
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player_avplay/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_avplay` as a dependency in your `pubspec.

```yaml
dependencies:
video_player_avplay: ^0.8.14
video_player_avplay: ^0.8.15
```

Then you can import `video_player_avplay` in your Dart code:
Expand Down
15 changes: 14 additions & 1 deletion packages/video_player_avplay/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,19 @@ class _HlsRomoteVideo extends StatefulWidget {

class _HlsRomoteVideoState extends State<_HlsRomoteVideo> {
late VideoPlayerController _controller;
// Optional
final Map<StreamingPropertyType, String> _streamingProperties =
<StreamingPropertyType, String>{
StreamingPropertyType.adaptiveInfo: 'STARTBITRATE=460560',
StreamingPropertyType.setAbr: '0',
};

@override
void initState() {
super.initState();
_controller = VideoPlayerController.network(
'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8',
streamingProperty: _streamingProperties,
);

_controller.addListener(() {
Expand All @@ -84,7 +91,12 @@ class _HlsRomoteVideoState extends State<_HlsRomoteVideo> {
setState(() {});
});
_controller.setLooping(true);
_controller.initialize().then((_) => setState(() {}));
_controller.initialize().then((_) async {
setState(() {});
// Optional
final List<Track> activateTracks = await _controller.getActiveTrackInfo();
print('[getActivateTrackInfo()] result: $activateTracks');
});
_controller.play();
}

Expand Down Expand Up @@ -173,6 +185,7 @@ class _DashRomoteVideoState extends State<_DashRomoteVideo> {
_controller
.getStreamingProperty(StreamingPropertyType.subtitleStreamInfo);
_controller.getStreamingProperty(StreamingPropertyType.videoStreamInfo);

_controller.getData(<DashPlayerProperty>{DashPlayerProperty.httpHeader});
});
_controller.play();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ class VideoPlayerTizen extends VideoPlayerPlatform {
StreamingPropertyType.dashToken: 'TOKEN',
StreamingPropertyType.openHttpHeader: 'OPEN_HTTP_HEADER',
StreamingPropertyType.openManifest: 'OPEN_MANIFEST',
StreamingPropertyType.setAbr: 'SET_ABR',
};

static const Map<BufferConfigType, String> _bufferConfigTypeMap =
Expand Down
29 changes: 9 additions & 20 deletions packages/video_player_avplay/lib/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -921,14 +921,7 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
return '';
}

final Future<String> streamingProperty =
_videoPlayerPlatform.getStreamingProperty(_playerId, type);
await streamingProperty.then((String result) {
// ignore: avoid_print
print('[getStreamingProperty()] type: $type, result: $result');
});

return streamingProperty;
return _videoPlayerPlatform.getStreamingProperty(_playerId, type);
}

/// Sets specific feature values for HTTP, MMS, or specific streaming engine (Smooth Streaming, HLS, DASH, DivX Plus Streaming, or Widevine).
Expand Down Expand Up @@ -1049,14 +1042,7 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
return <DashPlayerProperty, Object>{};
}

final Future<Map<DashPlayerProperty, Object>> data =
_videoPlayerPlatform.getData(playerId, keys);
await data.then((Object result) {
// ignore: avoid_print
print('[getData()] result: \n$result');
});

return data;
return _videoPlayerPlatform.getData(playerId, keys);
}

/// Updates the authentication token for the current DASH video stream.
Expand Down Expand Up @@ -1627,10 +1613,13 @@ class ClosedCaption extends StatelessWidget {
width: pictureCaption.pictureWidth,
height: pictureCaption.pictureHeight, errorBuilder:
(BuildContext context, Object error, StackTrace? stackTrace) {
// ignore: avoid_print
print('[ClosedCaption] Image.memory error: $error');
// ignore: avoid_print
print('[ClosedCaption] StackTrace: $stackTrace');
FlutterError.reportError(
FlutterErrorDetails(
exception: error,
stack: stackTrace,
context: ErrorDescription('while decoding a closed caption image'),
),
);

return const Text('');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,16 @@ enum StreamingPropertyType {
///
/// To control is force enable if can get manifest content callback. 'TRUE' or others.
openManifest,

/// Controls adaptive bitrate switching for HLS stream.
/// * '0': Disables adaptive bitrate switching. Playback stays at the initially
/// selected bitrate regardless of network conditions.
/// * '1': Enables adaptive bitrate switching (default). Player dynamically
/// selects bitrate based on available network bandwidth.
///
/// Typically used with adaptiveInfo-STARTBITRATE to lock playback at a specific bitrate.
/// Example: {adaptiveInfo: 'STARTBITRATE=460560', setAbr: '0'} locks playback at 460560 bps.
setAbr,
}

/// The different types of buffer configurations that can be set on the player.
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player_avplay/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: video_player_avplay
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/master/packages/video_player_avplay
version: 0.8.14
version: 0.8.15

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