cordova-plugin-media3 1.1.18 → 1.1.19

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.018",
3
+ "version": "1.1.019",
4
4
  "description": "Media player for Cordova using Google's media3 ExoPlayer framework",
5
5
  "cordova": {
6
6
  "id": "cordova-plugin-media3",
@@ -45,7 +45,7 @@ public class Payload {
45
45
  public static String playbackStateToString(int playbackState) {
46
46
  String state = "UNKNOWN";
47
47
  switch (playbackState) {
48
- case androidx.media3.common.Player.STATE_IDLE:
48
+ case Player.STATE_IDLE:
49
49
  state = "STATE_IDLE";
50
50
  break;
51
51
  case androidx.media3.common.Player.STATE_BUFFERING:
@@ -265,6 +265,26 @@ public class Plugin extends CordovaPlugin {
265
265
  }
266
266
  });
267
267
  return true;
268
+ // } else if (action.equals("isTV")) {
269
+ // cordova.getActivity().runOnUiThread(new Runnable() {
270
+ // public void run() {
271
+ // JSONObject response = DeviceDetector.isTV(cordova.getActivity());
272
+ // new CallbackResponse(callbackContext).send(PluginResult.Status.OK, response, true);
273
+ // }
274
+ // });
275
+ // return true;
276
+ } else if (action.equals("setAspectRatio")) {
277
+ if (self.player == null) {
278
+ return false;
279
+ }
280
+ final String aspectRatio = data.optString(0);
281
+ cordova.getActivity().runOnUiThread(new Runnable() {
282
+ public void run() {
283
+ JSONObject response = self.player.setAspectRatio(aspectRatio);
284
+ new CallbackResponse(callbackContext).send(PluginResult.Status.OK, response, true);
285
+ }
286
+ });
287
+ return true;
268
288
  } else {
269
289
  new CallbackResponse(callbackContext).send(PluginResult.Status.INVALID_ACTION, false);
270
290
  return false;