cordova-plugin-media3 1.1.30 → 1.1.32

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-media3",
3
- "version": "1.1.030",
3
+ "version": "1.1.032",
4
4
  "description": "Media player for Cordova using Google's media3 ExoPlayer framework",
5
5
  "cordova": {
6
6
  "id": "cordova-plugin-media3",
package/plugin.xml CHANGED
@@ -43,7 +43,7 @@
43
43
  <activity android:resizeableActivity="true"
44
44
  android:supportsPictureInPicture="true"
45
45
  android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
46
- > <!-- android:launchMode="singleTask" -->
46
+ android:launchMode="singleTask">
47
47
  </activity>
48
48
 
49
49
  </edit-config>
@@ -69,6 +69,5 @@
69
69
  <source-file src="src/android/Payload.java" target-dir="src/ma/naja7host/cordova/plugin/exoplayer/"/>
70
70
  <source-file src="src/android/Player.java" target-dir="src/ma/naja7host/cordova/plugin/exoplayer/"/>
71
71
  <source-file src="src/android/Plugin.java" target-dir="src/ma/naja7host/cordova/plugin/exoplayer/"/>
72
- <!-- <source-file src="src/android/DeviceDetector.java" target-dir="src/ma/naja7host/cordova/plugin/exoplayer/"/> -->
73
72
  </platform>
74
73
  </plugin>
@@ -1027,6 +1027,7 @@ public class Player {
1027
1027
  return AspectRatioFrameLayout.RESIZE_MODE_FIT;
1028
1028
  }
1029
1029
  }
1030
+
1030
1031
  private int getColor(String color) {
1031
1032
  switch (color) {
1032
1033
  case "transparent":
@@ -214,7 +214,8 @@ public class Plugin extends CordovaPlugin {
214
214
  }
215
215
  });
216
216
  return true;
217
- } else if (action.equals("setSubtitleTrack")) {
217
+ }
218
+ else if (action.equals("setSubtitleTrack")) {
218
219
  if (self.player == null) {
219
220
  return false;
220
221
  }
@@ -226,7 +227,8 @@ public class Plugin extends CordovaPlugin {
226
227
  }
227
228
  });
228
229
  return true;
229
- } else if (action.equals("setAudioTrack")) {
230
+ }
231
+ else if (action.equals("setAudioTrack")) {
230
232
  if (self.player == null) {
231
233
  return false;
232
234
  }
@@ -238,7 +240,8 @@ public class Plugin extends CordovaPlugin {
238
240
  }
239
241
  });
240
242
  return true;
241
- } else if (action.equals("subTitleOff")) {
243
+ }
244
+ else if (action.equals("subTitleOff")) {
242
245
  if (self.player == null) {
243
246
  return false;
244
247
  }
@@ -250,7 +253,8 @@ public class Plugin extends CordovaPlugin {
250
253
  });
251
254
  return true;
252
255
 
253
- } else if (action.equals("setSubtitleStyle")) {
256
+ }
257
+ else if (action.equals("setSubtitleStyle")) {
254
258
  if (self.player == null) {
255
259
  return false;
256
260
  }
@@ -273,7 +277,8 @@ public class Plugin extends CordovaPlugin {
273
277
  // }
274
278
  // });
275
279
  // return true;
276
- } else if (action.equals("setAspectRatio")) {
280
+ }
281
+ else if (action.equals("setAspectRatio")) {
277
282
  if (self.player == null) {
278
283
  return false;
279
284
  }
@@ -285,7 +290,8 @@ public class Plugin extends CordovaPlugin {
285
290
  }
286
291
  });
287
292
  return true;
288
- } else if (action.equals("createPIPMode")) {
293
+ }
294
+ else if (action.equals("createPIPMode")) {
289
295
  if (self.player == null) {
290
296
  return false;
291
297
  }
@@ -296,10 +302,11 @@ public class Plugin extends CordovaPlugin {
296
302
  }
297
303
  });
298
304
  return true;
299
- } else if (action.equals("isPipModeSupported")) {
300
- if (self.player == null) {
301
- return false;
302
- }
305
+ }
306
+ else if (action.equals("isPipModeSupported")) {
307
+ // if (self.player == null) {
308
+ // return false;
309
+ // }
303
310
  cordova.getActivity().runOnUiThread(new Runnable() {
304
311
  public void run() {
305
312
  JSONObject response = self.player.isPipModeSupported();
@@ -307,10 +314,11 @@ public class Plugin extends CordovaPlugin {
307
314
  }
308
315
  });
309
316
  return true;
310
- } else if (action.equals("isPipMode")) {
311
- if (self.player == null) {
312
- return false;
313
- }
317
+ }
318
+ else if (action.equals("isPipMode")) {
319
+ // if (self.player == null) {
320
+ // return false;
321
+ // }
314
322
  cordova.getActivity().runOnUiThread(new Runnable() {
315
323
  public void run() {
316
324
  JSONObject response = self.player.isPipMode();
@@ -318,7 +326,8 @@ public class Plugin extends CordovaPlugin {
318
326
  }
319
327
  });
320
328
  return true;
321
- } else {
329
+ }
330
+ else {
322
331
  new CallbackResponse(callbackContext).send(PluginResult.Status.INVALID_ACTION, false);
323
332
  return false;
324
333
  }
package/www/exoplayer.js CHANGED
@@ -59,7 +59,6 @@ module.exports = {
59
59
  setZIndex: function(zIndex, successCallback, errorCallback) {
60
60
  cordova.exec(successCallback, errorCallback, "ExoPlayer", "setZIndex", [zIndex]);
61
61
  },
62
-
63
62
  play: function (successCallback, errorCallback) {
64
63
  cordova.exec(successCallback, errorCallback, "ExoPlayer", "play", []);
65
64
  },
@@ -79,9 +78,6 @@ module.exports = {
79
78
  setSubtitleStyle: function (subtitle_color, subtitle_background, edgeColor, edgeType, successCallback, errorCallback) {
80
79
  cordova.exec(successCallback, errorCallback, "ExoPlayer", "setSubtitleStyle", [subtitle_color, subtitle_background, edgeColor, edgeType]);
81
80
  },
82
- // isTV: function (successCallback, errorCallback) {
83
- // cordova.exec(successCallback, errorCallback, "ExoPlayer", "isTV", []);
84
- // },
85
81
  setAspectRatio: function (aspectRatio, successCallback, errorCallback) {
86
82
  cordova.exec(successCallback, errorCallback, "ExoPlayer", "setAspectRatio", [aspectRatio]);
87
83
  },