Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Closed
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/video_player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.10.5+2

* Fixes issue when device mute control(iOS) muted
Video sound will be muted which isn't normal experience.

## 0.10.5+1

* Fixes issue where `initialize()` `Future` stalls when failing to load source
Expand Down
1 change: 1 addition & 0 deletions packages/video_player/video_player/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: video_player_example
description: Demonstrates how to use the video_player plugin.
version: 1.0.0+1

dependencies:
flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ - (instancetype)initWithPlayerItem:(AVPlayerItem*)item frameUpdater:(FLTFrameUpd
_player = [AVPlayer playerWithPlayerItem:item];
_player.actionAtItemEnd = AVPlayerActionAtItemEndNone;

[self enableSoundWhenMuteControlOfDeviceMuted];

[self createVideoOutputAndDisplayLink:frameUpdater];

[self addObservers:item];
Expand All @@ -233,6 +235,17 @@ - (instancetype)initWithPlayerItem:(AVPlayerItem*)item frameUpdater:(FLTFrameUpd
return self;
}

-(void)enableSoundWhenMuteControlOfDeviceMuted {
NSError *error = nil;
BOOL success = [[AVAudioSession sharedInstance]
setCategory: AVAudioSessionCategoryPlayback
error:&error];
if (!success) {
NSLog(@"Error setting speaker: %@", error);
}
[[AVAudioSession sharedInstance] setActive:YES error:&error];
}

- (void)observeValueForKeyPath:(NSString*)path
ofObject:(id)object
change:(NSDictionary*)change
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player/video_player/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: video_player
description: Flutter plugin for displaying inline video with other Flutter
widgets on Android and iOS.
version: 0.10.5+1
version: 0.10.5+2
homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player

flutter:
Expand Down