Skip to content

Commit

Permalink
fix issue where changing non dash stream resolution would not work
Browse files Browse the repository at this point in the history
  • Loading branch information
lamarios committed Dec 17, 2023
1 parent 6ebc726 commit 3ce848d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/player/states/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,19 @@ class VideoPlayerCubit extends MediaPlayerCubit<VideoPlayerState> {

@override
selectVideoTrack(int index) {
var betterPlayerAsmsTrack = videoController?.betterPlayerAsmsTracks[index];
if (betterPlayerAsmsTrack != null) {
videoController?.setTrack(betterPlayerAsmsTrack);
if (isUsingDash()) {
var betterPlayerAsmsTrack =
videoController?.betterPlayerAsmsTracks[index];
if (betterPlayerAsmsTrack != null) {
videoController?.setTrack(betterPlayerAsmsTrack);
}
} else {
var track = getVideoTracks()[index];
var url = videoController?.betterPlayerDataSource?.resolutions?[track];
if (url != null) {
videoController?.setResolution(url);
emit(state.copyWith(selectedNonDashTrack: track));
}
}
}

Expand Down

0 comments on commit 3ce848d

Please sign in to comment.