diff --git a/analysis_options.yaml b/analysis_options.yaml index aa322b6ae..4b4365dd6 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -15,7 +15,6 @@ linter: prefer_constructors_over_static_methods: false sort_unnamed_constructors_first: false sized_box_for_whitespace: false - invalid_dependency: false sort_pub_dependencies: false avoid_unnecessary_containers: false use_setters_to_change_properties: false diff --git a/lib/src/asms/better_player_asms_track.dart b/lib/src/asms/better_player_asms_track.dart index 0a11df79b..755e43e68 100644 --- a/lib/src/asms/better_player_asms_track.dart +++ b/lib/src/asms/better_player_asms_track.dart @@ -40,7 +40,7 @@ class BetterPlayerAsmsTrack { int get hashCode => super.hashCode; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return other is BetterPlayerAsmsTrack && width == other.width && height == other.height && diff --git a/lib/src/core/better_player_controller.dart b/lib/src/core/better_player_controller.dart index d1a53bc31..5ab5e80b2 100644 --- a/lib/src/core/better_player_controller.dart +++ b/lib/src/core/better_player_controller.dart @@ -522,9 +522,9 @@ class BetterPlayerController { } break; - default: + /*default: throw UnimplementedError( - "${betterPlayerDataSource.type} is not implemented"); + "${betterPlayerDataSource.type} is not implemented");*/ } await _initializeVideo(); } @@ -1260,7 +1260,7 @@ class BetterPlayerController { ///cache started for given [betterPlayerDataSource] then it will be ignored. Future stopPreCache( BetterPlayerDataSource betterPlayerDataSource) async { - return VideoPlayerController?.stopPreCache(betterPlayerDataSource.url, + return VideoPlayerController.stopPreCache(betterPlayerDataSource.url, betterPlayerDataSource.cacheConfiguration?.key); } diff --git a/lib/src/dash/better_player_dash_utils.dart b/lib/src/dash/better_player_dash_utils.dart index c137599c7..cede135ce 100644 --- a/lib/src/dash/better_player_dash_utils.dart +++ b/lib/src/dash/better_player_dash_utils.dart @@ -85,8 +85,7 @@ class BetterPlayerDashUtils { String? name = node.getAttribute('label'); final String? language = node.getAttribute('lang'); final String? mimeType = node.getAttribute('mimeType'); - String? url = - node.getElement('Representation')?.getElement('BaseURL')?.text; + String? url = node.getElement('Representation')?.getElement('BaseURL')?.value; if (url?.contains("http") == false) { final Uri masterPlaylistUri = Uri.parse(masterPlaylistUrl); final pathSegments = [...masterPlaylistUri.pathSegments]; diff --git a/lib/src/hls/hls_parser/drm_init_data.dart b/lib/src/hls/hls_parser/drm_init_data.dart index dbca2a269..e189c286d 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,7 @@ class DrmInitData { final String? schemeType; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other is DrmInitData) { return schemeType == other.schemeType && const ListEquality().equals(other.schemeData, schemeData); @@ -19,5 +18,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..beb8fce37 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,7 @@ class HlsTrackMetadataEntry { final List? variantInfos; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other is HlsTrackMetadataEntry) { return other.groupId == groupId && other.name == name && @@ -28,5 +27,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..41a9913c2 100644 --- a/lib/src/hls/hls_parser/metadata.dart +++ b/lib/src/hls/hls_parser/metadata.dart @@ -7,7 +7,7 @@ class Metadata { final List list; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { 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..336452aa5 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,7 @@ class SchemeData { ); @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other is SchemeData) { return other.mimeType == mimeType && other.licenseServerUrl == licenseServerUrl && @@ -49,7 +47,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..f5f51d5cd 100644 --- a/lib/src/hls/hls_parser/variant_info.dart +++ b/lib/src/hls/hls_parser/variant_info.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; + class VariantInfo { VariantInfo({ @@ -29,9 +29,10 @@ class VariantInfo { final String? captionGroupId; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other is VariantInfo) { - return other.bitrate == bitrate && + return other.runtimeType == runtimeType && + other.bitrate == bitrate && other.videoGroupId == videoGroupId && other.audioGroupId == audioGroupId && other.subtitleGroupId == subtitleGroupId && @@ -41,6 +42,5 @@ class VariantInfo { } @override - int get hashCode => hashValues( - bitrate, videoGroupId, audioGroupId, subtitleGroupId, captionGroupId); + int get hashCode => Object.hash(bitrate, videoGroupId, audioGroupId, subtitleGroupId, captionGroupId); } diff --git a/pubspec.lock b/pubspec.lock index 11837d5a6..6b2fa4094 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.6.0" async: dependency: transitive description: @@ -45,18 +45,18 @@ 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: name: csslib - sha256: f857285c8dc0b4f2f77b49a1c083ff8c75223a7549de20f3e607df58cf497a43 + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "1.0.2" cupertino_icons: dependency: "direct main" description: @@ -85,18 +85,10 @@ packages: dependency: transitive description: name: ffi - sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" url: "https://pub.dev" source: hosted - version: "2.1.2" - file: - dependency: transitive - description: - name: file - sha256: "9fd2163d866769f60f4df8ac1dc59f52498d810c356fe78022e383dd3c57c0e1" - url: "https://pub.dev" - source: hosted - version: "6.1.0" + version: "2.1.3" flutter: dependency: "direct main" description: flutter @@ -121,34 +113,34 @@ packages: dependency: "direct main" description: name: flutter_widget_from_html_core - sha256: df7c7c9e5ea144f7ab0adfbad733b4d4f7d408ab733c94e6e9fdcb327af92aa1 + sha256: b1048fd119a14762e2361bd057da608148a895477846d6149109b2151d2f7abf url: "https://pub.dev" source: hosted - version: "0.15.1" + version: "0.15.2" html: dependency: transitive description: name: html - sha256: bfef906cbd4e78ef49ae511d9074aebd1d2251482ef601a280973e8b58b51bbf + sha256: "1fc58edeaec4307368c60d59b7e15b9d658b57d7f3125098b6294153c75337ec" url: "https://pub.dev" source: hosted - version: "0.15.0" + version: "0.15.5" http: dependency: transitive description: name: http - sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" + sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.1" intl: dependency: transitive description: @@ -161,18 +153,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: @@ -181,22 +173,22 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.1" - lint: + lints: dependency: "direct dev" description: - name: lint - sha256: d758a5211fce7fd3f5e316f804daefecdc34c7e53559716125e6da7388ae8565 + name: lints + sha256: "4a16b3f03741e1252fda5de3ce712666d010ba2122f8e912c94f9f7b90e1a4c3" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "5.1.0" logging: dependency: transitive description: name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" matcher: dependency: transitive description: @@ -209,34 +201,34 @@ 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: name: package_info_plus - sha256: b93d8b4d624b4ea19b0a5a208b2d6eff06004bc3ce74c06040b120eeadd00ce0 + sha256: "70c421fe9d9cc1a9a7f3b05ae56befd469fe4f8daa3b484823141a55442d858d" url: "https://pub.dev" source: hosted - version: "8.0.0" + version: "8.1.2" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - sha256: f49918f3433a3146047372f9d4f1f847511f2acd5cd030e1f44fe5a50036b70e + sha256: a5ef9986efc7bf772f2696183a3992615baa76c1ffb1189318dd8803778fb05b url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.2" path: dependency: transitive description: @@ -249,26 +241,26 @@ packages: dependency: "direct main" description: name: path_provider - sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.5" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "9c96da072b421e98183f9ea7464898428e764bc0ce5567f27ec8693442e72514" + sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2" url: "https://pub.dev" source: hosted - version: "2.2.5" + version: "2.2.15" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 + sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" path_provider_linux: dependency: transitive description: @@ -289,10 +281,10 @@ packages: dependency: transitive description: name: path_provider_windows - sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.3.0" petitparser: dependency: transitive description: @@ -305,10 +297,10 @@ packages: dependency: transitive description: name: platform - sha256: ebc79f16b5f6b609aad4a5e63447d4795d16f7adee46e93ed03200848c006735 + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.6" plugin_platform_interface: dependency: transitive description: @@ -317,19 +309,11 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" - process: - dependency: transitive - description: - name: process - sha256: c7b9f7d8a6ee4407ab4f8a7d4a951f8f5659c40df14c0924e2e97c32372e9b14 - url: "https://pub.dev" - source: hosted - version: "4.1.0" sky_engine: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: @@ -342,10 +326,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 +342,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,18 +358,18 @@ 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: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" vector_math: dependency: transitive description: @@ -406,18 +390,18 @@ 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: name: wakelock_plus - sha256: "14758533319a462ffb5aa3b7ddb198e59b29ac3b02da14173a1715d65d4e6e68" + sha256: bf4ee6f17a2fa373ed3753ad0e602b7603f8c75af006d5b9bdade263928c0484 url: "https://pub.dev" source: hosted - version: "1.2.5" + version: "1.2.8" wakelock_plus_platform_interface: dependency: transitive description: @@ -430,26 +414,26 @@ packages: dependency: transitive description: name: web - sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "1.1.0" win32: dependency: transitive description: name: win32 - sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 + sha256: "8b338d4486ab3fbc0ba0db9f9b4f5239b6697fcee427939a40e720cbb9ee0a69" url: "https://pub.dev" source: hosted - version: "5.5.1" + version: "5.9.0" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: "0186b3f2d66be9a12b0295bddcf8b6f8c0b0cc2f85c6287344e2a6366bc28457" + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "1.1.0" xml: dependency: "direct main" description: @@ -459,5 +443,5 @@ packages: source: hosted version: "6.5.0" sdks: - dart: ">=3.4.0 <4.0.0" - flutter: ">=3.22.0" + dart: ">=3.6.0-0 <4.0.0" + flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index 31b237d02..d4444e8cf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: xml: ^6.5.0 dev_dependencies: - lint: ^2.3.0 + lints: ^5.1.0 flutter_test: sdk: flutter flutter_localizations: diff --git a/test/better_player_controller_test.dart b/test/better_player_controller_test.dart index e6117df33..1fda9dd11 100644 --- a/test/better_player_controller_test.dart +++ b/test/better_player_controller_test.dart @@ -14,7 +14,7 @@ void main() { () { setUp( () => { - TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler( mockMethodChannel.channel, mockMethodChannel.handle) }, diff --git a/test/mock_method_channel.dart b/test/mock_method_channel.dart index 2e256ab59..ac06c0dfb 100644 --- a/test/mock_method_channel.dart +++ b/test/mock_method_channel.dart @@ -34,9 +34,9 @@ class MockMethodChannel { void _createEventChannel(int id) { final MethodChannel eventChannel = MethodChannel("better_player_channel/videoEvents$id"); - TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(eventChannel, (MethodCall methodCall) async { - TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .handlePlatformMessage( "better_player_channel/videoEvents$id", const StandardMethodCodec()