cordova-plugin-media3 1.1.25 → 1.1.26
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 +1 -1
- package/src/android/Player.java +9 -9
package/package.json
CHANGED
package/src/android/Player.java
CHANGED
|
@@ -108,14 +108,14 @@ public class Player {
|
|
|
108
108
|
@Override
|
|
109
109
|
public void onPlaybackStateChanged(int playbackState) {
|
|
110
110
|
if (config.getShowBuffering()) {
|
|
111
|
-
LayoutProvider.setBufferingVisibility(exoView, activity, playbackState ==
|
|
111
|
+
LayoutProvider.setBufferingVisibility(exoView, activity, playbackState == ExoPlayer.STATE_BUFFERING);
|
|
112
112
|
}
|
|
113
113
|
JSONObject payload = Payload.stateEvent(Player.this.exoPlayer, playbackState, Player.this.controllerVisibility == View.VISIBLE);
|
|
114
114
|
new CallbackResponse(Player.this.callbackContext).send(PluginResult.Status.OK, payload, true);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
@Override
|
|
118
|
-
public void onPositionDiscontinuity(@NonNull
|
|
118
|
+
public void onPositionDiscontinuity(@NonNull ExoPlayer.PositionInfo oldPosition, @NonNull ExoPlayer.PositionInfo newPosition, int reason) {
|
|
119
119
|
JSONObject payload = Payload.positionDiscontinuityEvent(Player.this.exoPlayer, reason);
|
|
120
120
|
new CallbackResponse(Player.this.callbackContext).send(PluginResult.Status.OK, payload, true);
|
|
121
121
|
}
|
|
@@ -231,8 +231,8 @@ public class Player {
|
|
|
231
231
|
public void createPlayer() {
|
|
232
232
|
Log.i(TAG, "Playing " + config.getUri());
|
|
233
233
|
|
|
234
|
-
String mediaUrl = config.getUri(); // Your method to get the URL
|
|
235
|
-
if (mediaUrl != null && URLUtil.isValidUrl(mediaUrl)) {
|
|
234
|
+
// String mediaUrl = config.getUri(); // Your method to get the URL
|
|
235
|
+
// if (mediaUrl != null && URLUtil.isValidUrl(mediaUrl)) {
|
|
236
236
|
// Proceed with ExoPlayer setup using mediaUrl
|
|
237
237
|
if (config.useInlineView()) {
|
|
238
238
|
// Using a dialog doesn't work for us, as controls are drawn in HTML view (cordova ui)
|
|
@@ -247,11 +247,11 @@ public class Player {
|
|
|
247
247
|
if (config.useInlineView()) {
|
|
248
248
|
setController(config.getController());
|
|
249
249
|
}
|
|
250
|
-
} else {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
250
|
+
// } else {
|
|
251
|
+
// // Handle invalid or null URL: e.g., show an error message, log the issue, or use a placeholder.
|
|
252
|
+
// Log.e("ExoPlayerDebug", "Invalid media URL: " + mediaUrl);
|
|
253
|
+
// sendError("Invalid media URL: " + mediaUrl);
|
|
254
|
+
// }
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
public void createDialog() {
|