Skip to content

Commit

Permalink
Fix getVideoTracks out of bounds issue
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaowei-guan committed Sep 23, 2024
1 parent b6e8a39 commit 8707e2b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 25 deletions.
4 changes: 4 additions & 0 deletions packages/video_player_avplay/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.1

* Fix getVideoTracks out of bounds issue.

## 0.5.0

* Fix DashEngine crash issue.
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.5.0
video_player_avplay: ^0.5.1
```
Then you can import `video_player_avplay` in your Dart code:
Expand Down
14 changes: 1 addition & 13 deletions packages/video_player_avplay/lib/src/tracks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ enum TrackType {
text,
}

/// Type of the track audio channel for [TrackType.audio].
enum AudioTrackChannelType {
/// The mono channel.
mono,

/// The stereo channel.
stereo,

/// The surround channel.
surround,
}

/// Type of the track subtitle type for [TrackType.text].
enum TextTrackSubtitleType {
/// The text subtitle.
Expand Down Expand Up @@ -99,7 +87,7 @@ class AudioTrack extends Track {
final String language;

/// The channel of audio track.
final AudioTrackChannelType channel;
final int channel;

/// The bitrate of audio track.
final int bitrate;
Expand Down
12 changes: 2 additions & 10 deletions packages/video_player_avplay/lib/src/video_player_tizen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,13 @@ class VideoPlayerTizen extends VideoPlayerPlatform {
for (final Map<Object?, Object?>? trackMap in response.tracks) {
final int trackId = trackMap!['trackId']! as int;
final String language = trackMap['language']! as String;
final AudioTrackChannelType channelType =
_intChannelTypeMap[trackMap['channel']]!;
final int channel = trackMap['channel']! as int;
final int bitrate = trackMap['bitrate']! as int;

audioTracks.add(AudioTrack(
trackId: trackId,
language: language,
channel: channelType,
channel: channel,
bitrate: bitrate,
));
}
Expand Down Expand Up @@ -306,13 +305,6 @@ class VideoPlayerTizen extends VideoPlayerPlatform {
VideoFormat.other: 'other',
};

static const Map<int, AudioTrackChannelType> _intChannelTypeMap =
<int, AudioTrackChannelType>{
1: AudioTrackChannelType.mono,
2: AudioTrackChannelType.stereo,
3: AudioTrackChannelType.surround,
};

static const Map<StreamingPropertyType, String> _streamingPropertyType =
<StreamingPropertyType, String>{
StreamingPropertyType.adaptiveInfo: 'ADAPTIVE_INFO',
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.5.0
version: 0.5.1

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

0 comments on commit 8707e2b

Please sign in to comment.