diff --git a/example/ios/Flutter/Debug.xcconfig b/example/ios/Flutter/Debug.xcconfig index 592ceee85..ec97fc6f3 100644 --- a/example/ios/Flutter/Debug.xcconfig +++ b/example/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/example/ios/Flutter/Release.xcconfig b/example/ios/Flutter/Release.xcconfig index 592ceee85..c4855bfe2 100644 --- a/example/ios/Flutter/Release.xcconfig +++ b/example/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/example/pubspec.lock b/example/pubspec.lock new file mode 100644 index 000000000..9690d3187 --- /dev/null +++ b/example/pubspec.lock @@ -0,0 +1,446 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + args: + dependency: transitive + description: + name: args + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + url: "https://pub.dev" + source: hosted + version: "2.6.0" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + better_player: + dependency: "direct main" + description: + path: ".." + relative: true + source: path + version: "0.0.84" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: "direct main" + description: + name: collection + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + url: "https://pub.dev" + source: hosted + version: "1.19.0" + csslib: + dependency: transitive + description: + name: csslib + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + cupertino_icons: + dependency: transitive + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + dbus: + dependency: transitive + description: + name: dbus + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" + url: "https://pub.dev" + source: hosted + version: "0.7.10" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" + url: "https://pub.dev" + source: hosted + version: "2.1.3" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_widget_from_html_core: + dependency: transitive + description: + name: flutter_widget_from_html_core + sha256: b1048fd119a14762e2361bd057da608148a895477846d6149109b2151d2f7abf + url: "https://pub.dev" + source: hosted + version: "0.15.2" + html: + dependency: transitive + description: + name: html + sha256: "1fc58edeaec4307368c60d59b7e15b9d658b57d7f3125098b6294153c75337ec" + url: "https://pub.dev" + source: hosted + version: "0.15.5" + http: + dependency: transitive + description: + name: http + sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 + url: "https://pub.dev" + source: hosted + version: "1.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + intl: + dependency: transitive + description: + name: intl + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + url: "https://pub.dev" + source: hosted + version: "0.19.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + url: "https://pub.dev" + source: hosted + version: "10.0.7" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + url: "https://pub.dev" + source: hosted + version: "3.0.8" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.dev" + source: hosted + version: "1.15.0" + package_info_plus: + dependency: transitive + description: + name: package_info_plus + sha256: "70c421fe9d9cc1a9a7f3b05ae56befd469fe4f8daa3b484823141a55442d858d" + url: "https://pub.dev" + source: hosted + version: "8.1.2" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: a5ef9986efc7bf772f2696183a3992615baa76c1ffb1189318dd8803778fb05b + url: "https://pub.dev" + source: hosted + version: "3.0.2" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + path_provider: + dependency: "direct main" + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2" + url: "https://pub.dev" + source: hosted + version: "2.2.15" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + url: "https://pub.dev" + source: hosted + version: "6.0.2" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + url: "https://pub.dev" + source: hosted + version: "0.7.3" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + visibility_detector: + dependency: "direct main" + description: + name: visibility_detector + sha256: dd5cc11e13494f432d15939c3aa8ae76844c42b723398643ce9addb88a5ed420 + url: "https://pub.dev" + source: hosted + version: "0.4.0+2" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + url: "https://pub.dev" + source: hosted + version: "14.3.0" + wakelock_plus: + dependency: transitive + description: + name: wakelock_plus + sha256: bf4ee6f17a2fa373ed3753ad0e602b7603f8c75af006d5b9bdade263928c0484 + url: "https://pub.dev" + source: hosted + version: "1.2.8" + wakelock_plus_platform_interface: + dependency: transitive + description: + name: wakelock_plus_platform_interface + sha256: "422d1cdbb448079a8a62a5a770b69baa489f8f7ca21aef47800c726d404f9d16" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + web: + dependency: transitive + description: + name: web + sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb + url: "https://pub.dev" + source: hosted + version: "1.1.0" + win32: + dependency: transitive + description: + name: win32 + sha256: "8b338d4486ab3fbc0ba0db9f9b4f5239b6697fcee427939a40e720cbb9ee0a69" + url: "https://pub.dev" + source: hosted + version: "5.9.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" + source: hosted + version: "6.5.0" +sdks: + dart: ">=3.5.0 <4.0.0" + flutter: ">=3.24.0" diff --git a/ios/Classes/BetterPlayer.h b/ios/Classes/BetterPlayer.h index 3e721a32e..ae116c5a4 100644 --- a/ios/Classes/BetterPlayer.h +++ b/ios/Classes/BetterPlayer.h @@ -43,7 +43,6 @@ NS_ASSUME_NONNULL_BEGIN - (int64_t) position; - (instancetype)initWithFrame:(CGRect)frame; -- (void)setMixWithOthers:(bool)mixWithOthers; - (void)seekTo:(int)location; - (void)setDataSourceAsset:(NSString*)asset withKey:(NSString*)key withCertificateUrl:(NSString*)certificateUrl withLicenseUrl:(NSString*)licenseUrl cacheKey:(NSString*)cacheKey cacheManager:(CacheManager*)cacheManager overriddenDuration:(int) overriddenDuration; - (void)setDataSourceURL:(NSURL*)url withKey:(NSString*)key withCertificateUrl:(NSString*)certificateUrl withLicenseUrl:(NSString*)licenseUrl withHeaders:(NSDictionary*)headers withCache:(BOOL)useCache cacheKey:(NSString*)cacheKey cacheManager:(CacheManager*)cacheManager overriddenDuration:(int) overriddenDuration videoExtension: (NSString*) videoExtension; diff --git a/ios/Classes/BetterPlayer.m b/ios/Classes/BetterPlayer.m index 2837ef651..50b2aa538 100644 --- a/ios/Classes/BetterPlayer.m +++ b/ios/Classes/BetterPlayer.m @@ -710,17 +710,6 @@ - (void) setAudioTrack:(NSString*) name index:(int) index{ } -- (void)setMixWithOthers:(bool)mixWithOthers { - if (mixWithOthers) { - [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback - withOptions:AVAudioSessionCategoryOptionMixWithOthers - error:nil]; - } else { - [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; - } -} - - #endif - (FlutterError* _Nullable)onCancelWithArguments:(id _Nullable)arguments { diff --git a/ios/Classes/BetterPlayerPlugin.m b/ios/Classes/BetterPlayerPlugin.m index ed50403fa..5464de115 100644 --- a/ios/Classes/BetterPlayerPlugin.m +++ b/ios/Classes/BetterPlayerPlugin.m @@ -78,7 +78,6 @@ - (void)onPlayerSetup:(BetterPlayer*)player eventChannelWithName:[NSString stringWithFormat:@"better_player_channel/videoEvents%lld", textureId] binaryMessenger:_messenger]; - [player setMixWithOthers:false]; [eventChannel setStreamHandler:player]; player.eventChannel = eventChannel; _players[@(textureId)] = player; @@ -276,6 +275,19 @@ - (void) stopOtherUpdateListener: (BetterPlayer*) player{ } +- (void) setMixWithOthers:(BOOL)mixWithOthers { +#if TARGET_OS_OSX + // AVAudioSession doesn't exist on macOS, and audio always mixes, so just no-op. +#else + if (mixWithOthers) { + [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback + withOptions:AVAudioSessionCategoryOptionMixWithOthers + error:nil]; + } else { + [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; + } +#endif +} - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { @@ -291,6 +303,8 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { } else if ([@"create" isEqualToString:call.method]) { BetterPlayer* player = [[BetterPlayer alloc] initWithFrame:CGRectZero]; [self onPlayerSetup:player result:result]; + } else if([@"setMixWithOthers" isEqualToString:call.method]) { + [self setMixWithOthers:call.arguments[@"mixWithOthers"]]; } else { NSDictionary* argsMap = call.arguments; int64_t textureId = ((NSNumber*)argsMap[@"textureId"]).unsignedIntegerValue; @@ -420,8 +434,6 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { NSString* name = argsMap[@"name"]; int index = [argsMap[@"index"] intValue]; [player setAudioTrack:name index: index]; - } else if ([@"setMixWithOthers" isEqualToString:call.method]){ - [player setMixWithOthers:[argsMap[@"mixWithOthers"] boolValue]]; } else if ([@"preCache" isEqualToString:call.method]){ NSDictionary* dataSource = argsMap[@"dataSource"]; NSString* urlArg = dataSource[@"uri"]; diff --git a/lib/src/configuration/better_player_configuration.dart b/lib/src/configuration/better_player_configuration.dart index fa9ec564e..a1acfc2c8 100644 --- a/lib/src/configuration/better_player_configuration.dart +++ b/lib/src/configuration/better_player_configuration.dart @@ -118,6 +118,10 @@ class BetterPlayerConfiguration { ///Default value is false. final bool useRootNavigator; + /// Set this to true to mix video players audio with other audio sources. + /// The default value is false + final bool mixWithOthers; + const BetterPlayerConfiguration({ this.aspectRatio, this.autoPlay = false, @@ -156,6 +160,7 @@ class BetterPlayerConfiguration { this.autoDispose = true, this.expandToFill = true, this.useRootNavigator = false, + this.mixWithOthers = false, }); BetterPlayerConfiguration copyWith({ @@ -188,6 +193,7 @@ class BetterPlayerConfiguration { bool? autoDispose, bool? expandToFill, bool? useRootNavigator, + bool? mixWithOthers, }) { return BetterPlayerConfiguration( aspectRatio: aspectRatio ?? this.aspectRatio, @@ -228,6 +234,7 @@ class BetterPlayerConfiguration { autoDispose: autoDispose ?? this.autoDispose, expandToFill: expandToFill ?? this.expandToFill, useRootNavigator: useRootNavigator ?? this.useRootNavigator, + mixWithOthers: mixWithOthers ?? this.mixWithOthers, ); } } diff --git a/lib/src/core/better_player_controller.dart b/lib/src/core/better_player_controller.dart index d1a53bc31..d7f813278 100644 --- a/lib/src/core/better_player_controller.dart +++ b/lib/src/core/better_player_controller.dart @@ -246,8 +246,13 @@ class BetterPlayerController { ///Build videoPlayerController if null if (videoPlayerController == null) { videoPlayerController = VideoPlayerController( - bufferingConfiguration: - betterPlayerDataSource.bufferingConfiguration); + bufferingConfiguration: betterPlayerDataSource.bufferingConfiguration, + ); + // Even though the player is being created at this moment, + // we let OS know to mix with others before the player is created, so we don't + // mute other sources at all. Audio session mix is not connected with the player. + videoPlayerController + ?.setMixWithOthers(betterPlayerConfiguration.mixWithOthers); videoPlayerController?.addListener(_onVideoPlayerChanged); } @@ -1281,26 +1286,26 @@ class BetterPlayerController { ///Dispose BetterPlayerController. When [forceDispose] parameter is true, then ///autoDispose parameter will be overridden and controller will be disposed ///(if it wasn't disposed before). - void dispose({bool forceDispose = false}) { + Future dispose({bool forceDispose = false}) async { if (!betterPlayerConfiguration.autoDispose && !forceDispose) { return; } if (!_disposed) { if (videoPlayerController != null) { - pause(); + await pause(); videoPlayerController!.removeListener(_onFullScreenStateChanged); videoPlayerController!.removeListener(_onVideoPlayerChanged); - videoPlayerController!.dispose(); + await videoPlayerController!.dispose(); } _eventListeners.clear(); _nextVideoTimer?.cancel(); - _nextVideoTimeStreamController.close(); - _controlsVisibilityStreamController.close(); - _videoEventStreamSubscription?.cancel(); + await _nextVideoTimeStreamController.close(); + await _controlsVisibilityStreamController.close(); + await _videoEventStreamSubscription?.cancel(); _disposed = true; - _controllerEventStreamController.close(); + await _controllerEventStreamController.close(); - ///Delete files async + // Delete files async _tempFiles.forEach((file) => file.delete()); } } diff --git a/lib/src/hls/hls_parser/drm_init_data.dart b/lib/src/hls/hls_parser/drm_init_data.dart index dbca2a269..74ef68012 100644 --- a/lib/src/hls/hls_parser/drm_init_data.dart +++ b/lib/src/hls/hls_parser/drm_init_data.dart @@ -1,5 +1,4 @@ import 'package:collection/collection.dart'; -import 'package:flutter/cupertino.dart'; import 'scheme_data.dart'; @@ -10,7 +9,13 @@ class DrmInitData { final String? schemeType; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (other.runtimeType != runtimeType) { + return false; + } if (other is DrmInitData) { return schemeType == other.schemeType && const ListEquality().equals(other.schemeData, schemeData); @@ -19,5 +24,5 @@ class DrmInitData { } @override - int get hashCode => hashValues(schemeType, schemeData); + int get hashCode => Object.hash(schemeType, schemeData); } diff --git a/lib/src/hls/hls_parser/hls_track_metadata_entry.dart b/lib/src/hls/hls_parser/hls_track_metadata_entry.dart index 9d7d215a6..025e5a327 100644 --- a/lib/src/hls/hls_parser/hls_track_metadata_entry.dart +++ b/lib/src/hls/hls_parser/hls_track_metadata_entry.dart @@ -1,6 +1,5 @@ import 'package:better_player/src/hls/hls_parser/variant_info.dart'; import 'package:collection/collection.dart'; -import 'package:flutter/rendering.dart'; class HlsTrackMetadataEntry { HlsTrackMetadataEntry({this.groupId, this.name, this.variantInfos}); @@ -17,7 +16,13 @@ class HlsTrackMetadataEntry { final List? variantInfos; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (other.runtimeType != runtimeType) { + return false; + } if (other is HlsTrackMetadataEntry) { return other.groupId == groupId && other.name == name && @@ -28,5 +33,5 @@ class HlsTrackMetadataEntry { } @override - int get hashCode => hashValues(groupId, name, variantInfos); + int get hashCode => Object.hash(groupId, name, variantInfos); } diff --git a/lib/src/hls/hls_parser/metadata.dart b/lib/src/hls/hls_parser/metadata.dart index 10ae6d860..245c03757 100644 --- a/lib/src/hls/hls_parser/metadata.dart +++ b/lib/src/hls/hls_parser/metadata.dart @@ -7,7 +7,13 @@ class Metadata { final List list; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (other.runtimeType != runtimeType) { + return false; + } if (other is Metadata) { return const ListEquality() .equals(other.list, list); diff --git a/lib/src/hls/hls_parser/scheme_data.dart b/lib/src/hls/hls_parser/scheme_data.dart index 49557dde0..fcbe8a589 100644 --- a/lib/src/hls/hls_parser/scheme_data.dart +++ b/lib/src/hls/hls_parser/scheme_data.dart @@ -1,7 +1,5 @@ import 'dart:typed_data'; -import 'package:flutter/material.dart'; - class SchemeData { SchemeData({ // @required this.uuid, @@ -36,7 +34,13 @@ class SchemeData { ); @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (other.runtimeType != runtimeType) { + return false; + } if (other is SchemeData) { return other.mimeType == mimeType && other.licenseServerUrl == licenseServerUrl && @@ -49,7 +53,7 @@ class SchemeData { } @override - int get hashCode => hashValues( + int get hashCode => Object.hash( /*uuid, */ licenseServerUrl, mimeType, diff --git a/lib/src/hls/hls_parser/variant_info.dart b/lib/src/hls/hls_parser/variant_info.dart index 74c4ecb38..402e7d5bb 100644 --- a/lib/src/hls/hls_parser/variant_info.dart +++ b/lib/src/hls/hls_parser/variant_info.dart @@ -1,5 +1,3 @@ -import 'package:flutter/material.dart'; - class VariantInfo { VariantInfo({ this.bitrate, @@ -29,7 +27,13 @@ class VariantInfo { final String? captionGroupId; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (other.runtimeType != runtimeType) { + return false; + } if (other is VariantInfo) { return other.bitrate == bitrate && other.videoGroupId == videoGroupId && @@ -41,6 +45,6 @@ class VariantInfo { } @override - int get hashCode => hashValues( + int get hashCode => Object.hash( bitrate, videoGroupId, audioGroupId, subtitleGroupId, captionGroupId); } diff --git a/lib/src/video_player/method_channel_video_player.dart b/lib/src/video_player/method_channel_video_player.dart index a4066d5f0..0bfea7b8c 100644 --- a/lib/src/video_player/method_channel_video_player.dart +++ b/lib/src/video_player/method_channel_video_player.dart @@ -270,11 +270,10 @@ class MethodChannelVideoPlayer extends VideoPlayerPlatform { } @override - Future setMixWithOthers(int? textureId, bool mixWithOthers) { + Future setMixWithOthers(bool mixWithOthers) { return _channel.invokeMethod( 'setMixWithOthers', { - 'textureId': textureId, 'mixWithOthers': mixWithOthers, }, ); diff --git a/lib/src/video_player/video_player.dart b/lib/src/video_player/video_player.dart index 7a8453f13..8d3cba038 100644 --- a/lib/src/video_player/video_player.dart +++ b/lib/src/video_player/video_player.dart @@ -622,7 +622,7 @@ class VideoPlayerController extends ValueNotifier { } void setMixWithOthers(bool mixWithOthers) { - _videoPlayerPlatform.setMixWithOthers(_textureId, mixWithOthers); + _videoPlayerPlatform.setMixWithOthers(mixWithOthers); } static Future clearCache() async { diff --git a/lib/src/video_player/video_player_platform_interface.dart b/lib/src/video_player/video_player_platform_interface.dart index 336f54b04..ce5a81047 100644 --- a/lib/src/video_player/video_player_platform_interface.dart +++ b/lib/src/video_player/video_player_platform_interface.dart @@ -159,7 +159,7 @@ abstract class VideoPlayerPlatform { throw UnimplementedError('setAudio() has not been implemented.'); } - Future setMixWithOthers(int? textureId, bool mixWithOthers) { + Future setMixWithOthers(bool mixWithOthers) { throw UnimplementedError('setMixWithOthers() has not been implemented.'); } diff --git a/pubspec.lock b/pubspec.lock index 11837d5a6..437cb1c77 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -45,10 +45,10 @@ packages: dependency: "direct main" description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" csslib: dependency: transitive description: @@ -161,18 +161,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: @@ -209,18 +209,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: "direct main" description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" package_info_plus: dependency: transitive description: @@ -329,7 +329,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: @@ -342,10 +342,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -358,10 +358,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" term_glyph: dependency: transitive description: @@ -374,10 +374,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.3" typed_data: dependency: transitive description: @@ -406,10 +406,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.3.0" wakelock_plus: dependency: "direct main" description: