@@ -66,6 +66,18 @@ public Action(@Size(max = 23) String tag, @Nullable String description) {
66
66
this .description = description ;
67
67
}
68
68
69
+ /**
70
+ * Called by {@link #doActionAndScheduleNextImpl(ExoPlayer, DefaultTrackSelector, Surface,
71
+ * HandlerWrapper, ActionNode)} to perform the action.
72
+ *
73
+ * @param player The player to which the action should be applied.
74
+ * @param trackSelector The track selector to which the action should be applied.
75
+ * @param surface The surface to use when applying actions, or {@code null} if no surface is
76
+ * needed.
77
+ */
78
+ protected abstract void doActionImpl (
79
+ ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface );
80
+
69
81
/**
70
82
* Executes the action and schedules the next.
71
83
*
@@ -77,7 +89,7 @@ public Action(@Size(max = 23) String tag, @Nullable String description) {
77
89
* @param nextAction The next action to schedule immediately after this action finished, or {@code
78
90
* null} if there's no next action.
79
91
*/
80
- public final void doActionAndScheduleNext (
92
+ /* package */ final void doActionAndScheduleNext (
81
93
ExoPlayer player ,
82
94
DefaultTrackSelector trackSelector ,
83
95
@ Nullable Surface surface ,
@@ -101,7 +113,7 @@ public final void doActionAndScheduleNext(
101
113
* @param nextAction The next action to schedule immediately after this action finished, or {@code
102
114
* null} if there's no next action.
103
115
*/
104
- protected void doActionAndScheduleNextImpl (
116
+ /* package */ void doActionAndScheduleNextImpl (
105
117
ExoPlayer player ,
106
118
DefaultTrackSelector trackSelector ,
107
119
@ Nullable Surface surface ,
@@ -113,18 +125,6 @@ protected void doActionAndScheduleNextImpl(
113
125
}
114
126
}
115
127
116
- /**
117
- * Called by {@link #doActionAndScheduleNextImpl(ExoPlayer, DefaultTrackSelector, Surface,
118
- * HandlerWrapper, ActionNode)} to perform the action.
119
- *
120
- * @param player The player to which the action should be applied.
121
- * @param trackSelector The track selector to which the action should be applied.
122
- * @param surface The surface to use when applying actions, or {@code null} if no surface is
123
- * needed.
124
- */
125
- protected abstract void doActionImpl (
126
- ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface );
127
-
128
128
/** Calls {@link Player#seekTo(long)} or {@link Player#seekTo(int, long)}. */
129
129
public static final class Seek extends Action {
130
130
@@ -697,7 +697,13 @@ public PlayUntilPosition(@Size(max = 23) String tag, int mediaItemIndex, long po
697
697
}
698
698
699
699
@ Override
700
- protected void doActionAndScheduleNextImpl (
700
+ protected void doActionImpl (
701
+ ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
702
+ // Not triggered.
703
+ }
704
+
705
+ @ Override
706
+ /* package */ void doActionAndScheduleNextImpl (
701
707
ExoPlayer player ,
702
708
DefaultTrackSelector trackSelector ,
703
709
@ Nullable Surface surface ,
@@ -739,12 +745,6 @@ protected void doActionAndScheduleNextImpl(
739
745
}
740
746
player .play ();
741
747
}
742
-
743
- @ Override
744
- protected void doActionImpl (
745
- ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
746
- // Not triggered.
747
- }
748
748
}
749
749
750
750
/** Waits for {@link Player.Listener#onTimelineChanged(Timeline, int)}. */
@@ -785,7 +785,13 @@ public WaitForTimelineChanged(String tag) {
785
785
}
786
786
787
787
@ Override
788
- protected void doActionAndScheduleNextImpl (
788
+ protected void doActionImpl (
789
+ ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
790
+ // Not triggered.
791
+ }
792
+
793
+ @ Override
794
+ /* package */ void doActionAndScheduleNextImpl (
789
795
ExoPlayer player ,
790
796
DefaultTrackSelector trackSelector ,
791
797
@ Nullable Surface surface ,
@@ -813,12 +819,6 @@ && timelinesAreSame(player.getCurrentTimeline(), expectedTimeline)) {
813
819
nextAction .schedule (player , trackSelector , surface , handler );
814
820
}
815
821
}
816
-
817
- @ Override
818
- protected void doActionImpl (
819
- ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
820
- // Not triggered.
821
- }
822
822
}
823
823
824
824
/**
@@ -835,7 +835,13 @@ public WaitForPositionDiscontinuity(String tag) {
835
835
}
836
836
837
837
@ Override
838
- protected void doActionAndScheduleNextImpl (
838
+ protected void doActionImpl (
839
+ ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
840
+ // Not triggered.
841
+ }
842
+
843
+ @ Override
844
+ /* package */ void doActionAndScheduleNextImpl (
839
845
ExoPlayer player ,
840
846
DefaultTrackSelector trackSelector ,
841
847
@ Nullable Surface surface ,
@@ -856,12 +862,6 @@ public void onPositionDiscontinuity(
856
862
}
857
863
});
858
864
}
859
-
860
- @ Override
861
- protected void doActionImpl (
862
- ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
863
- // Not triggered.
864
- }
865
865
}
866
866
867
867
/**
@@ -882,7 +882,13 @@ public WaitForPlayWhenReady(@Size(max = 23) String tag, boolean playWhenReady) {
882
882
}
883
883
884
884
@ Override
885
- protected void doActionAndScheduleNextImpl (
885
+ protected void doActionImpl (
886
+ ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
887
+ // Not triggered.
888
+ }
889
+
890
+ @ Override
891
+ /* package */ void doActionAndScheduleNextImpl (
886
892
ExoPlayer player ,
887
893
DefaultTrackSelector trackSelector ,
888
894
@ Nullable Surface surface ,
@@ -907,12 +913,6 @@ public void onPlayWhenReadyChanged(
907
913
});
908
914
}
909
915
}
910
-
911
- @ Override
912
- protected void doActionImpl (
913
- ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
914
- // Not triggered.
915
- }
916
916
}
917
917
918
918
/**
@@ -933,7 +933,13 @@ public WaitForPlaybackState(@Size(max = 23) String tag, @Player.State int target
933
933
}
934
934
935
935
@ Override
936
- protected void doActionAndScheduleNextImpl (
936
+ protected void doActionImpl (
937
+ ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
938
+ // Not triggered.
939
+ }
940
+
941
+ @ Override
942
+ /* package */ void doActionAndScheduleNextImpl (
937
943
ExoPlayer player ,
938
944
DefaultTrackSelector trackSelector ,
939
945
@ Nullable Surface surface ,
@@ -957,12 +963,6 @@ public void onPlaybackStateChanged(@Player.State int playbackState) {
957
963
});
958
964
}
959
965
}
960
-
961
- @ Override
962
- protected void doActionImpl (
963
- ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
964
- // Not triggered.
965
- }
966
966
}
967
967
968
968
/**
@@ -983,7 +983,13 @@ public WaitForMessage(@Size(max = 23) String tag, PlayerTarget playerTarget) {
983
983
}
984
984
985
985
@ Override
986
- protected void doActionAndScheduleNextImpl (
986
+ protected void doActionImpl (
987
+ ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
988
+ // Not triggered.
989
+ }
990
+
991
+ @ Override
992
+ /* package */ void doActionAndScheduleNextImpl (
987
993
ExoPlayer player ,
988
994
DefaultTrackSelector trackSelector ,
989
995
@ Nullable Surface surface ,
@@ -997,12 +1003,6 @@ protected void doActionAndScheduleNextImpl(
997
1003
998
1004
playerTarget .setCallback (callback );
999
1005
}
1000
-
1001
- @ Override
1002
- protected void doActionImpl (
1003
- ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
1004
- // Not triggered.
1005
- }
1006
1006
}
1007
1007
1008
1008
/**
@@ -1023,7 +1023,13 @@ public WaitForIsLoading(@Size(max = 23) String tag, boolean targetIsLoading) {
1023
1023
}
1024
1024
1025
1025
@ Override
1026
- protected void doActionAndScheduleNextImpl (
1026
+ protected void doActionImpl (
1027
+ ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
1028
+ // Not triggered.
1029
+ }
1030
+
1031
+ @ Override
1032
+ /* package */ void doActionAndScheduleNextImpl (
1027
1033
ExoPlayer player ,
1028
1034
DefaultTrackSelector trackSelector ,
1029
1035
@ Nullable Surface surface ,
@@ -1047,12 +1053,6 @@ public void onIsLoadingChanged(boolean isLoading) {
1047
1053
});
1048
1054
}
1049
1055
}
1050
-
1051
- @ Override
1052
- protected void doActionImpl (
1053
- ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
1054
- // Not triggered.
1055
- }
1056
1056
}
1057
1057
1058
1058
/** Waits until the player acknowledged all pending player commands. */
@@ -1066,7 +1066,13 @@ public WaitForPendingPlayerCommands(String tag) {
1066
1066
}
1067
1067
1068
1068
@ Override
1069
- protected void doActionAndScheduleNextImpl (
1069
+ protected void doActionImpl (
1070
+ ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
1071
+ // Not triggered.
1072
+ }
1073
+
1074
+ @ Override
1075
+ /* package */ void doActionAndScheduleNextImpl (
1070
1076
ExoPlayer player ,
1071
1077
DefaultTrackSelector trackSelector ,
1072
1078
@ Nullable Surface surface ,
@@ -1084,12 +1090,6 @@ protected void doActionAndScheduleNextImpl(
1084
1090
.setLooper (Util .getCurrentOrMainLooper ())
1085
1091
.send ();
1086
1092
}
1087
-
1088
- @ Override
1089
- protected void doActionImpl (
1090
- ExoPlayer player , DefaultTrackSelector trackSelector , @ Nullable Surface surface ) {
1091
- // Not triggered.
1092
- }
1093
1093
}
1094
1094
1095
1095
/** Calls {@code Runnable.run()}. */
0 commit comments