cordova-plugin-media3 1.1.10 → 1.1.12
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/plugin.xml +4 -4
- package/src/android/Payload.java +3 -3
- package/src/android/Plugin.java +0 -8
- package/src/android/DeviceDetector.java +0 -132
package/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
<framework src="androidx.media3:media3-exoplayer-hls:1.2.1"/>
|
|
24
24
|
<framework src="androidx.media3:media3-exoplayer-dash:1.2.1"/>
|
|
25
25
|
<framework src="androidx.media3:media3-exoplayer-smoothstreaming:1.2.1"/>
|
|
26
|
-
<framework src="androidx.media3:media3-ui:1.2.1"/>
|
|
26
|
+
<!-- <framework src="androidx.media3:media3-ui:1.2.1"/> -->
|
|
27
27
|
<framework src="androidx.media3:media3-common:1.2.1"/>
|
|
28
28
|
<framework src="androidx.media3:media3-datasource:1.2.1"/>
|
|
29
29
|
<framework src="androidx.media3:media3-extractor:1.2.1"/>
|
|
30
30
|
<framework src="androidx.media3:media3-decoder:1.2.1"/>
|
|
31
|
-
<framework src="androidx.media3:media3-session:1.2.1"/>
|
|
32
|
-
<framework src="org.jellyfin.media3:media3-ffmpeg-decoder:1.2.1+1"/>
|
|
31
|
+
<!-- <framework src="androidx.media3:media3-session:1.2.1"/> -->
|
|
32
|
+
<!-- <framework src="org.jellyfin.media3:media3-ffmpeg-decoder:1.2.1+1"/> -->
|
|
33
33
|
<framework src="com.squareup.picasso:picasso:2.8"/>
|
|
34
34
|
|
|
35
35
|
<config-file target="res/xml/config.xml" parent="/*">
|
|
@@ -59,6 +59,6 @@
|
|
|
59
59
|
<source-file src="src/android/Payload.java" target-dir="src/co/frontyard/cordova/plugin/exoplayer/"/>
|
|
60
60
|
<source-file src="src/android/Player.java" target-dir="src/co/frontyard/cordova/plugin/exoplayer/"/>
|
|
61
61
|
<source-file src="src/android/Plugin.java" target-dir="src/co/frontyard/cordova/plugin/exoplayer/"/>
|
|
62
|
-
<source-file src="src/android/DeviceDetector.java" target-dir="src/co/frontyard/cordova/plugin/exoplayer/"/>
|
|
62
|
+
<!-- <source-file src="src/android/DeviceDetector.java" target-dir="src/co/frontyard/cordova/plugin/exoplayer/"/> -->
|
|
63
63
|
</platform>
|
|
64
64
|
</plugin>
|
package/src/android/Payload.java
CHANGED
|
@@ -282,9 +282,9 @@ public class Payload {
|
|
|
282
282
|
audioArray.put(trackObj);
|
|
283
283
|
break;
|
|
284
284
|
case C.TRACK_TYPE_TEXT:
|
|
285
|
-
if (format.sampleMimeType == "application/vobsub") {
|
|
286
|
-
|
|
287
|
-
}
|
|
285
|
+
// if (format.sampleMimeType == "application/vobsub") {
|
|
286
|
+
// continue;
|
|
287
|
+
// }
|
|
288
288
|
|
|
289
289
|
if (format.language == null) {
|
|
290
290
|
continue;
|
package/src/android/Plugin.java
CHANGED
|
@@ -265,14 +265,6 @@ 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
268
|
} else {
|
|
277
269
|
new CallbackResponse(callbackContext).send(PluginResult.Status.INVALID_ACTION, false);
|
|
278
270
|
return false;
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
The MIT License (MIT)
|
|
3
|
-
|
|
4
|
-
Copyright (c) 2017 Nedim Cholich
|
|
5
|
-
|
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
in the Software without restriction, including without limitation the rights
|
|
9
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
furnished to do so, subject to the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
package co.frontyard.cordova.plugin.exoplayer;
|
|
25
|
-
|
|
26
|
-
import android.app.UiModeManager;
|
|
27
|
-
import android.content.Context;
|
|
28
|
-
import android.content.pm.PackageManager;
|
|
29
|
-
import android.content.res.Configuration;
|
|
30
|
-
import android.os.Build;
|
|
31
|
-
import android.util.Log;
|
|
32
|
-
|
|
33
|
-
import java.lang.*;
|
|
34
|
-
import java.util.*;
|
|
35
|
-
import org.apache.cordova.*;
|
|
36
|
-
import org.json.*;
|
|
37
|
-
|
|
38
|
-
public class DeviceDetector {
|
|
39
|
-
|
|
40
|
-
private static final String TAG = "DeviceDetector";
|
|
41
|
-
// private final CallbackContext callbackContext;
|
|
42
|
-
|
|
43
|
-
public static JSONObject isTV(Context context) {
|
|
44
|
-
JSONObject response = new JSONObject();
|
|
45
|
-
|
|
46
|
-
try {
|
|
47
|
-
// Check UI mode (most reliable)
|
|
48
|
-
UiModeManager uiModeManager = (UiModeManager) context.getSystemService(Context.UI_MODE_SERVICE);
|
|
49
|
-
boolean isTV = uiModeManager != null && uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION;
|
|
50
|
-
|
|
51
|
-
// Check Leanback feature (TV UI)
|
|
52
|
-
PackageManager pm = context.getPackageManager();
|
|
53
|
-
boolean isLeanback = pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK);
|
|
54
|
-
// boolean isTelevision = pm.hasSystemFeature(PackageManager.FEATURE_TELEVISION);
|
|
55
|
-
boolean isTelevision = pm.hasSystemFeature("android.hardware.type.television");
|
|
56
|
-
|
|
57
|
-
// Check if device has HDMIndroid_tv
|
|
58
|
-
boolean isAndroidTv = pm.hasSystemFeature("com.google.android.tv");
|
|
59
|
-
|
|
60
|
-
// Build properties
|
|
61
|
-
String manufacturer = Build.MANUFACTURER.toLowerCase();
|
|
62
|
-
String model = Build.MODEL.toLowerCase();
|
|
63
|
-
String device = Build.DEVICE.toLowerCase();
|
|
64
|
-
String product = Build.PRODUCT.toLowerCase();
|
|
65
|
-
|
|
66
|
-
// Fire TV detection
|
|
67
|
-
// boolean isFireTV = manufacturer.contains("amazon") ||
|
|
68
|
-
// model.contains("aft") ||
|
|
69
|
-
// device.contains("aft") ||
|
|
70
|
-
// product.contains("aft");
|
|
71
|
-
boolean isFireTV = pm.hasSystemFeature("amazon.hardware.fire_tv");
|
|
72
|
-
|
|
73
|
-
// Generic Android Boxes
|
|
74
|
-
boolean isBox = manufacturer.contains("amlogic") ||
|
|
75
|
-
manufacturer.contains("rockchip") ||
|
|
76
|
-
manufacturer.contains("allwinner") ||
|
|
77
|
-
model.contains("tvbox") ||
|
|
78
|
-
model.contains("android tv") ||
|
|
79
|
-
model.contains("google tv");
|
|
80
|
-
|
|
81
|
-
// Mobile / Tablet distinction
|
|
82
|
-
boolean isTablet = (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
|
|
83
|
-
if (!isTablet) {
|
|
84
|
-
isTablet = (context.getResources().getConfiguration().smallestScreenWidthDp >= 600);
|
|
85
|
-
}
|
|
86
|
-
// if (!isTablet) {
|
|
87
|
-
// isTablet = context.getResources().getBoolean(R.bool.isTablet); NO WORKING CODE
|
|
88
|
-
// }
|
|
89
|
-
|
|
90
|
-
boolean isShield = manufacturer.contains("nvidia") || model.contains("shield");
|
|
91
|
-
|
|
92
|
-
boolean isXiaomi = manufacturer.contains("xiaomi");
|
|
93
|
-
|
|
94
|
-
// boolean isOnePlus = manufacturer.contains("oneplus");
|
|
95
|
-
|
|
96
|
-
response.put("isTV", isTV ? "true" : "false");
|
|
97
|
-
response.put("isTelevision", isTelevision ? "true" : "false");
|
|
98
|
-
response.put("isLeanback", isLeanback ? "true" : "false");
|
|
99
|
-
response.put("isAndroidTv", isAndroidTv ? "true" : "false");
|
|
100
|
-
response.put("isBox", isBox ? "true" : "false");
|
|
101
|
-
response.put("isFireTV", isFireTV ? "true" : "false");
|
|
102
|
-
response.put("isTablet", isTablet ? "true" : "false");
|
|
103
|
-
response.put("isShield", isShield ? "true" : "false");
|
|
104
|
-
response.put("isXiaomi", isXiaomi ? "true" : "false");
|
|
105
|
-
// response.put("isOnePlus", isOnePlus ? "true" : "false");
|
|
106
|
-
// response.put("isSamsung", isSamsung ? "true" : "false");
|
|
107
|
-
response.put("success", true);
|
|
108
|
-
|
|
109
|
-
try {
|
|
110
|
-
String hdmi_device_type = "-1";
|
|
111
|
-
Class<?> systemProperties = Class.forName("android.os.SystemProperties");
|
|
112
|
-
hdmi_device_type = (String) systemProperties.getMethod("get", String.class, String.class)
|
|
113
|
-
.invoke(null, "ro.hdmi.device_type", "-1");
|
|
114
|
-
|
|
115
|
-
response.put("hdmi_device_type", hdmi_device_type);
|
|
116
|
-
|
|
117
|
-
} catch (Exception e) {
|
|
118
|
-
// e.printStackTrace();
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
} catch (JSONException e) {
|
|
122
|
-
try {
|
|
123
|
-
response.put("success", false);
|
|
124
|
-
response.put("error", "Failed to get PackageManager : " + e.getMessage());
|
|
125
|
-
} catch (JSONException je) {
|
|
126
|
-
Log.e(TAG, "Error creating response JSON", je);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return response;
|
|
131
|
-
}
|
|
132
|
-
}
|