Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[video_player_avplay] Fix getAudioTracks out of bounds issue #750

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
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
Loading