Commit 6d10279
authored
[video_player] Move most Android event logic to Dart (#10128)
Rather than interpreting ExoPlayer event callbacks in Java and then sending event channel events that match the Dart platform interface, send the events directly and intepret them in Dart. This continues the process of reducing Java-side logic in the plugin.
In order to make this change less error-prone, it also adopts Pigeon event channels, so that the new events are type-safe; in order to do that, this switches to the Kotlin Pigeon generator, since Pigeon event channels haven't been implemented for Java.
Now that the buffer progress event synthesis is in Dart, this also fixes an existing TODO by reworking that logic to be based on an independent timer, rather than driven by playback position polling from the app-facing package. This both makes the logic clearer, and makes it work regardless of whether or not the video is paused.
Part of flutter/flutter#172763
## Pre-Review Checklist
[^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.1 parent 835dccb commit 6d10279
File tree
23 files changed
+1625
-1550
lines changed- packages/video_player/video_player_android
- android
- src
- main
- java/io/flutter/plugins/videoplayer
- platformview
- texture
- kotlin/io/flutter/plugins/videoplayer
- test/java/io/flutter/plugins/videoplayer
- lib/src
- pigeons
- test
23 files changed
+1625
-1550
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
1 | 8 | | |
2 | 9 | | |
3 | 10 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
41 | 51 | | |
42 | 52 | | |
43 | 53 | | |
| |||
Lines changed: 6 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 49 | | |
63 | 50 | | |
64 | 51 | | |
65 | 52 | | |
| 53 | + | |
66 | 54 | | |
67 | 55 | | |
68 | | - | |
69 | | - | |
| 56 | + | |
70 | 57 | | |
71 | 58 | | |
| 59 | + | |
72 | 60 | | |
73 | 61 | | |
74 | 62 | | |
75 | 63 | | |
76 | 64 | | |
77 | 65 | | |
78 | | - | |
| 66 | + | |
79 | 67 | | |
80 | 68 | | |
| 69 | + | |
81 | 70 | | |
82 | 71 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 72 | + | |
86 | 73 | | |
87 | 74 | | |
88 | 75 | | |
89 | 76 | | |
90 | | - | |
91 | 77 | | |
92 | 78 | | |
93 | 79 | | |
| |||
0 commit comments