cordova-plugin-media3 1.1.23 → 1.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/android/Payload.java
CHANGED
|
@@ -49,13 +49,13 @@ public class Payload {
|
|
|
49
49
|
case Player.STATE_IDLE:
|
|
50
50
|
state = "STATE_IDLE";
|
|
51
51
|
break;
|
|
52
|
-
case
|
|
52
|
+
case Player.STATE_BUFFERING:
|
|
53
53
|
state = "STATE_BUFFERING";
|
|
54
54
|
break;
|
|
55
|
-
case
|
|
55
|
+
case Player.STATE_READY:
|
|
56
56
|
state = "STATE_READY";
|
|
57
57
|
break;
|
|
58
|
-
case
|
|
58
|
+
case Player.STATE_ENDED:
|
|
59
59
|
state = "STATE_ENDED";
|
|
60
60
|
break;
|
|
61
61
|
}
|
package/src/android/Player.java
CHANGED
|
@@ -39,6 +39,7 @@ import androidx.annotation.NonNull;
|
|
|
39
39
|
import androidx.appcompat.widget.ContentFrameLayout;
|
|
40
40
|
|
|
41
41
|
// Media3 imports
|
|
42
|
+
import androidx.media3.common.Player;
|
|
42
43
|
import androidx.media3.common.*;
|
|
43
44
|
import androidx.media3.exoplayer.*;
|
|
44
45
|
import androidx.media3.exoplayer.source.*;
|
|
@@ -87,7 +88,7 @@ public class Player {
|
|
|
87
88
|
this.audioManager = (AudioManager) activity.getSystemService(Context.AUDIO_SERVICE);
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
private
|
|
91
|
+
private Player.Listener playerEventListener = new Player.Listener() {
|
|
91
92
|
@Override
|
|
92
93
|
public void onIsLoadingChanged(boolean isLoading) {
|
|
93
94
|
// JSONObject payload = Payload.loadingEvent(Player.this.exoPlayer, isLoading);
|
|
@@ -108,14 +109,14 @@ public class Player {
|
|
|
108
109
|
@Override
|
|
109
110
|
public void onPlaybackStateChanged(int playbackState) {
|
|
110
111
|
if (config.getShowBuffering()) {
|
|
111
|
-
LayoutProvider.setBufferingVisibility(exoView, activity, playbackState ==
|
|
112
|
+
LayoutProvider.setBufferingVisibility(exoView, activity, playbackState == Player.STATE_BUFFERING);
|
|
112
113
|
}
|
|
113
114
|
JSONObject payload = Payload.stateEvent(Player.this.exoPlayer, playbackState, Player.this.controllerVisibility == View.VISIBLE);
|
|
114
115
|
new CallbackResponse(Player.this.callbackContext).send(PluginResult.Status.OK, payload, true);
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
@Override
|
|
118
|
-
public void onPositionDiscontinuity(@NonNull
|
|
119
|
+
public void onPositionDiscontinuity(@NonNull Player.PositionInfo oldPosition, @NonNull Player.PositionInfo newPosition, int reason) {
|
|
119
120
|
JSONObject payload = Payload.positionDiscontinuityEvent(Player.this.exoPlayer, reason);
|
|
120
121
|
new CallbackResponse(Player.this.callbackContext).send(PluginResult.Status.OK, payload, true);
|
|
121
122
|
}
|
|
@@ -605,7 +606,7 @@ public class Player {
|
|
|
605
606
|
|
|
606
607
|
public JSONObject getPlayerState() {
|
|
607
608
|
return Payload.stateEvent(exoPlayer,
|
|
608
|
-
null != exoPlayer ? exoPlayer.getPlaybackState() :
|
|
609
|
+
null != exoPlayer ? exoPlayer.getPlaybackState() : Player.STATE_ENDED,
|
|
609
610
|
Player.this.controllerVisibility == View.VISIBLE);
|
|
610
611
|
}
|
|
611
612
|
|