Commit 729eb6dfc783cd192d1970a2da517972b9b8393e
1 parent
77b86726
fix: 优化安卓视频播放兼容性
Showing
7 changed files
with
22 additions
and
19 deletions
android/app/build.gradle
| @@ -29,7 +29,7 @@ apply from: "../archive_apk.gradle" | @@ -29,7 +29,7 @@ apply from: "../archive_apk.gradle" | ||
| 29 | android { | 29 | android { |
| 30 | namespace "com.kouyuxingqiu.wow_english" | 30 | namespace "com.kouyuxingqiu.wow_english" |
| 31 | // compileSdkVersion flutter.compileSdkVersion | 31 | // compileSdkVersion flutter.compileSdkVersion |
| 32 | - compileSdkVersion 34 | 32 | + compileSdkVersion 35 |
| 33 | // 暂时没有ndk需求 | 33 | // 暂时没有ndk需求 |
| 34 | // ndkVersion flutter.ndkVersion | 34 | // ndkVersion flutter.ndkVersion |
| 35 | 35 |
android/build.gradle
| 1 | apply from: "/Users/stay/StudioProjects/ishowMavenRepositories.gradle" | 1 | apply from: "/Users/stay/StudioProjects/ishowMavenRepositories.gradle" |
| 2 | 2 | ||
| 3 | buildscript { | 3 | buildscript { |
| 4 | - ext.kotlin_version = '1.8.21' | 4 | + ext.kotlin_version = '1.8.22' |
| 5 | repositories { | 5 | repositories { |
| 6 | maven { url 'https://maven.aliyun.com/repository/google' } | 6 | maven { url 'https://maven.aliyun.com/repository/google' } |
| 7 | maven { url "https://maven.aliyun.com/repository/public" } | 7 | maven { url "https://maven.aliyun.com/repository/public" } |
| @@ -12,8 +12,7 @@ buildscript { | @@ -12,8 +12,7 @@ buildscript { | ||
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | dependencies { | 14 | dependencies { |
| 15 | - // AGP版本,目前自动创建的Gradle版本是用的7.5.0 | ||
| 16 | - classpath 'com.android.tools.build:gradle:7.3.0' | 15 | + classpath 'com.android.tools.build:gradle:8.1.0' |
| 17 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | 16 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
| 18 | } | 17 | } |
| 19 | } | 18 | } |
android/gradle/wrapper/gradle-wrapper.properties
| @@ -2,5 +2,4 @@ distributionBase=GRADLE_USER_HOME | @@ -2,5 +2,4 @@ distributionBase=GRADLE_USER_HOME | ||
| 2 | distributionPath=wrapper/dists | 2 | distributionPath=wrapper/dists |
| 3 | zipStoreBase=GRADLE_USER_HOME | 3 | zipStoreBase=GRADLE_USER_HOME |
| 4 | zipStorePath=wrapper/dists | 4 | zipStorePath=wrapper/dists |
| 5 | -#distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip | ||
| 6 | -distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-7.5-all.zip | 5 | +distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-8.3-all.zip |
lib/pages/video/zone/video_zone_player_page.dart
| @@ -63,8 +63,12 @@ class _VideoZonePlayerPageState extends State<VideoZonePlayerPage> | @@ -63,8 +63,12 @@ class _VideoZonePlayerPageState extends State<VideoZonePlayerPage> | ||
| 63 | } | 63 | } |
| 64 | oldController?.removeListener(_onVideoChanged); | 64 | oldController?.removeListener(_onVideoChanged); |
| 65 | _lastIsPlaying = null; | 65 | _lastIsPlaying = null; |
| 66 | - final controller = | ||
| 67 | - VideoPlayerController.networkUrl(Uri.parse(_currentItem.videoUrl)); | 66 | + final controller = VideoPlayerController.networkUrl( |
| 67 | + Uri.parse(_currentItem.videoUrl), | ||
| 68 | + viewType: defaultTargetPlatform == TargetPlatform.android | ||
| 69 | + ? VideoViewType.platformView | ||
| 70 | + : VideoViewType.textureView, | ||
| 71 | + ); | ||
| 68 | _controller = controller; | 72 | _controller = controller; |
| 69 | _chewieController = null; | 73 | _chewieController = null; |
| 70 | _loadError = null; | 74 | _loadError = null; |
packages/chivox_aiengine/android/build.gradle
| @@ -22,6 +22,7 @@ rootProject.allprojects { | @@ -22,6 +22,7 @@ rootProject.allprojects { | ||
| 22 | apply plugin: 'com.android.library' | 22 | apply plugin: 'com.android.library' |
| 23 | 23 | ||
| 24 | android { | 24 | android { |
| 25 | + namespace 'com.example.chivox_aiengine' | ||
| 25 | compileSdkVersion 31 | 26 | compileSdkVersion 31 |
| 26 | 27 | ||
| 27 | compileOptions { | 28 | compileOptions { |
pubspec.lock
| @@ -867,10 +867,10 @@ packages: | @@ -867,10 +867,10 @@ packages: | ||
| 867 | dependency: "direct main" | 867 | dependency: "direct main" |
| 868 | description: | 868 | description: |
| 869 | name: limiting_direction_csx | 869 | name: limiting_direction_csx |
| 870 | - sha256: c606c629d5e2905d4df6835be100885f4049e05c2dbc74337a69ae65ce6eaed1 | 870 | + sha256: "283a846809a076ad641924ba830e3e39ff5385b9fb9bab7ecd322200948a89bd" |
| 871 | url: "https://pub.flutter-io.cn" | 871 | url: "https://pub.flutter-io.cn" |
| 872 | source: hosted | 872 | source: hosted |
| 873 | - version: "0.2.0" | 873 | + version: "0.2.0+5" |
| 874 | lints: | 874 | lints: |
| 875 | dependency: transitive | 875 | dependency: transitive |
| 876 | description: | 876 | description: |
| @@ -1504,34 +1504,34 @@ packages: | @@ -1504,34 +1504,34 @@ packages: | ||
| 1504 | dependency: "direct main" | 1504 | dependency: "direct main" |
| 1505 | description: | 1505 | description: |
| 1506 | name: video_player | 1506 | name: video_player |
| 1507 | - sha256: "4a8c3492d734f7c39c2588a3206707a05ee80cef52e8c7f3b2078d430c84bc17" | 1507 | + sha256: "0d55b1f1a31e5ad4c4967bfaa8ade0240b07d20ee4af1dfef5f531056512961a" |
| 1508 | url: "https://pub.flutter-io.cn" | 1508 | url: "https://pub.flutter-io.cn" |
| 1509 | source: hosted | 1509 | source: hosted |
| 1510 | - version: "2.9.2" | 1510 | + version: "2.10.0" |
| 1511 | video_player_android: | 1511 | video_player_android: |
| 1512 | dependency: transitive | 1512 | dependency: transitive |
| 1513 | description: | 1513 | description: |
| 1514 | name: video_player_android | 1514 | name: video_player_android |
| 1515 | - sha256: "134e1ad410d67e18a19486ed9512c72dfc6d8ffb284d0e8f2e99e903d1ba8fa3" | 1515 | + sha256: "28dcc4122079f40f93a0965b3679aff1a5f4251cf79611bd8011f937eb6b69de" |
| 1516 | url: "https://pub.flutter-io.cn" | 1516 | url: "https://pub.flutter-io.cn" |
| 1517 | source: hosted | 1517 | source: hosted |
| 1518 | - version: "2.4.14" | 1518 | + version: "2.8.4" |
| 1519 | video_player_avfoundation: | 1519 | video_player_avfoundation: |
| 1520 | dependency: transitive | 1520 | dependency: transitive |
| 1521 | description: | 1521 | description: |
| 1522 | name: video_player_avfoundation | 1522 | name: video_player_avfoundation |
| 1523 | - sha256: "33224c19775fd244be2d6e3dbd8e1826ab162877bd61123bf71890772119a2b7" | 1523 | + sha256: f9a780aac57802b2892f93787e5ea53b5f43cc57dc107bee9436458365be71cd |
| 1524 | url: "https://pub.flutter-io.cn" | 1524 | url: "https://pub.flutter-io.cn" |
| 1525 | source: hosted | 1525 | source: hosted |
| 1526 | - version: "2.6.5" | 1526 | + version: "2.8.4" |
| 1527 | video_player_platform_interface: | 1527 | video_player_platform_interface: |
| 1528 | dependency: transitive | 1528 | dependency: transitive |
| 1529 | description: | 1529 | description: |
| 1530 | name: video_player_platform_interface | 1530 | name: video_player_platform_interface |
| 1531 | - sha256: "229d7642ccd9f3dc4aba169609dd6b5f3f443bb4cc15b82f7785fcada5af9bbb" | 1531 | + sha256: cf2a1d29a284db648fd66cbd18aacc157f9862d77d2cc790f6f9678a46c1db5a |
| 1532 | url: "https://pub.flutter-io.cn" | 1532 | url: "https://pub.flutter-io.cn" |
| 1533 | source: hosted | 1533 | source: hosted |
| 1534 | - version: "6.2.3" | 1534 | + version: "6.4.0" |
| 1535 | video_player_web: | 1535 | video_player_web: |
| 1536 | dependency: transitive | 1536 | dependency: transitive |
| 1537 | description: | 1537 | description: |
pubspec.yaml
| @@ -95,7 +95,7 @@ dependencies: | @@ -95,7 +95,7 @@ dependencies: | ||
| 95 | # 富文本插件 https://pub.dev/packages/extended_text | 95 | # 富文本插件 https://pub.dev/packages/extended_text |
| 96 | extended_text: ^11.0.1 | 96 | extended_text: ^11.0.1 |
| 97 | # 视频播放 https://pub.dev/packages/video_player | 97 | # 视频播放 https://pub.dev/packages/video_player |
| 98 | - video_player: 2.9.2 | 98 | + video_player: 2.10.0 |
| 99 | # 视频播放器控制层 https://pub.dev/packages/chewie | 99 | # 视频播放器控制层 https://pub.dev/packages/chewie |
| 100 | chewie: 1.7.5 | 100 | chewie: 1.7.5 |
| 101 | # 驰声语音评测 SDK(官方离线包裁剪为当前支持架构) | 101 | # 驰声语音评测 SDK(官方离线包裁剪为当前支持架构) |