You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[video_player] Move more Java logic to Dart (#9672)
Moves some logic from native code to Dart:
- User-Agent header -> ExoPlayer user agent extraction logic (with TODOs for future improvements, based on implementation issues/questions I noticed while converting it).
- Asset -> URL lookup.
- Conversion of buffer position to the buffer range list required for the Dart event stream.
Also converts video format hint from strings to enums, which was missed in earlier Pigeon conversions. Using strings was the pre-Pigeon way of handling this kind of thing.
Part of flutter/flutter#172763
## Pre-Review Checklist
**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Copy file name to clipboardExpand all lines: packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/HttpVideoAsset.java
Copy file name to clipboardExpand all lines: packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java
+95-65Lines changed: 95 additions & 65 deletions
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,19 @@ public enum PlatformVideoViewType {
77
77
}
78
78
}
79
79
80
+
/** Pigeon equivalent of video_platform_interface's VideoFormat. */
81
+
publicenumPlatformVideoFormat {
82
+
DASH(0),
83
+
HLS(1),
84
+
SS(2);
85
+
86
+
finalintindex;
87
+
88
+
PlatformVideoFormat(finalintindex) {
89
+
this.index = index;
90
+
}
91
+
}
92
+
80
93
/**
81
94
* Information passed to the platform view creation.
Copy file name to clipboardExpand all lines: packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/RtspVideoAsset.java
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,8 @@ public MediaItem getMediaItem() {
26
26
// TODO: Migrate to stable API, see https://github.com/flutter/flutter/issues/147039.
Copy file name to clipboardExpand all lines: packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoAsset.java
Copy file name to clipboardExpand all lines: packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerEventCallbacks.java
0 commit comments