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

Make it compatible with latest version of Flutter Sdk and JAVA version #1368

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 11 additions & 9 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ version '1.0-SNAPSHOT'

buildscript {
ext.exoPlayerVersion = "2.17.1"
ext.lifecycleVersion = "2.4.0-beta01"
ext.lifecycleVersion = "2.8.7"
ext.annotationVersion = "1.2.0"
ext.workVersion = "2.7.0"
ext.workVersion = "2.10.0"
ext.coreVersion = "1.6.0"
ext.gradleVersion = "7.0.2"
ext.kotlinVersion = "1.5.31"
ext.kotlinVersion = "1.9.20"

repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:8.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
Expand All @@ -32,15 +32,15 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 31
compileSdkVersion 35

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}

sourceSets {
Expand All @@ -64,8 +64,10 @@ android {
implementation "androidx.annotation:annotation:$annotationVersion"
implementation "androidx.work:work-runtime:$workVersion"
}

namespace 'com.jhomlala.better_player.better_player'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
}
3 changes: 1 addition & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jhomlala.better_player">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
2 changes: 1 addition & 1 deletion lib/src/asms/better_player_asms_track.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
6 changes: 3 additions & 3 deletions lib/src/core/better_player_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,9 @@ class BetterPlayerController {
}
break;

default:
/*default:
throw UnimplementedError(
"${betterPlayerDataSource.type} is not implemented");
"${betterPlayerDataSource.type} is not implemented");*/
}
await _initializeVideo();
}
Expand Down Expand Up @@ -1260,7 +1260,7 @@ class BetterPlayerController {
///cache started for given [betterPlayerDataSource] then it will be ignored.
Future<void> stopPreCache(
BetterPlayerDataSource betterPlayerDataSource) async {
return VideoPlayerController?.stopPreCache(betterPlayerDataSource.url,
return VideoPlayerController.stopPreCache(betterPlayerDataSource.url,
betterPlayerDataSource.cacheConfiguration?.key);
}

Expand Down
3 changes: 1 addition & 2 deletions lib/src/dash/better_player_dash_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <String>[...masterPlaylistUri.pathSegments];
Expand Down
5 changes: 2 additions & 3 deletions lib/src/hls/hls_parser/drm_init_data.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:collection/collection.dart';
import 'package:flutter/cupertino.dart';

import 'scheme_data.dart';

Expand All @@ -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<SchemeData>().equals(other.schemeData, schemeData);
Expand All @@ -19,5 +18,5 @@ class DrmInitData {
}

@override
int get hashCode => hashValues(schemeType, schemeData);
int get hashCode => Object.hash(schemeType, schemeData);
}
5 changes: 2 additions & 3 deletions lib/src/hls/hls_parser/hls_track_metadata_entry.dart
Original file line number Diff line number Diff line change
@@ -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});
Expand All @@ -17,7 +16,7 @@ class HlsTrackMetadataEntry {
final List<VariantInfo>? variantInfos;

@override
bool operator ==(dynamic other) {
bool operator ==(Object other) {
if (other is HlsTrackMetadataEntry) {
return other.groupId == groupId &&
other.name == name &&
Expand All @@ -28,5 +27,5 @@ class HlsTrackMetadataEntry {
}

@override
int get hashCode => hashValues(groupId, name, variantInfos);
int get hashCode => Object.hash(groupId, name, variantInfos);
}
2 changes: 1 addition & 1 deletion lib/src/hls/hls_parser/metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Metadata {
final List<HlsTrackMetadataEntry> list;

@override
bool operator ==(dynamic other) {
bool operator ==(Object other) {
if (other is Metadata) {
return const ListEquality<HlsTrackMetadataEntry>()
.equals(other.list, list);
Expand Down
6 changes: 2 additions & 4 deletions lib/src/hls/hls_parser/scheme_data.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'dart:typed_data';

import 'package:flutter/material.dart';

class SchemeData {
SchemeData({
// @required this.uuid,
Expand Down Expand Up @@ -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 &&
Expand All @@ -49,7 +47,7 @@ class SchemeData {
}

@override
int get hashCode => hashValues(
int get hashCode => Object.hash(
/*uuid, */
licenseServerUrl,
mimeType,
Expand Down
10 changes: 5 additions & 5 deletions lib/src/hls/hls_parser/variant_info.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flutter/material.dart';


class VariantInfo {
VariantInfo({
Expand Down Expand Up @@ -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 &&
Expand All @@ -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);
}
Loading