@jwplayer/jwplayer-react-native 1.1.3 → 1.3.0

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.
Files changed (36) hide show
  1. package/README.md +114 -21
  2. package/RNJWPlayer.podspec +1 -1
  3. package/android/build.gradle +14 -1
  4. package/android/src/main/java/com/jwplayer/rnjwplayer/RNJWPlayerModule.java +27 -0
  5. package/android/src/main/java/com/jwplayer/rnjwplayer/RNJWPlayerView.java +373 -204
  6. package/android/src/main/java/com/jwplayer/rnjwplayer/RNJWPlayerViewManager.java +16 -0
  7. package/android/src/main/java/com/jwplayer/rnjwplayer/Util.java +13 -1
  8. package/badges/version.svg +1 -1
  9. package/docs/CONFIG-REFERENCE.md +747 -0
  10. package/docs/MIGRATION-GUIDE.md +617 -0
  11. package/docs/PLATFORM-DIFFERENCES.md +693 -0
  12. package/docs/props.md +15 -3
  13. package/index.d.ts +225 -216
  14. package/index.js +34 -0
  15. package/ios/RNJWPlayer/RNJWPlayerView.swift +365 -10
  16. package/ios/RNJWPlayer/RNJWPlayerViewController.swift +45 -16
  17. package/ios/RNJWPlayer/RNJWPlayerViewManager.m +2 -0
  18. package/ios/RNJWPlayer/RNJWPlayerViewManager.swift +13 -0
  19. package/package.json +2 -2
  20. package/types/advertising.d.ts +514 -0
  21. package/types/index.d.ts +21 -0
  22. package/types/legacy.d.ts +82 -0
  23. package/types/platform-specific.d.ts +641 -0
  24. package/types/playlist.d.ts +410 -0
  25. package/types/unified-config.d.ts +591 -0
  26. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  27. package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
  28. package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
  29. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  30. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  31. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  32. package/android/.gradle/8.9/gc.properties +0 -0
  33. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  34. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  35. package/android/.gradle/vcs-1/gc.properties +0 -0
  36. package/docs/types.md +0 -254
@@ -46,6 +46,22 @@ public class RNJWPlayerViewManager extends SimpleViewManager<RNJWPlayerView> {
46
46
  view.mPlayerView.getPlayer().setControls(controls);
47
47
  }
48
48
 
49
+ /**
50
+ * Recreates the player with a new configuration, handling cleanup and PiP state.
51
+ * This method ensures proper cleanup and state restoration during configuration changes.
52
+ *
53
+ * @param view The RNJWPlayerView instance
54
+ * @param config The new configuration to apply
55
+ */
56
+ @ReactProp(name = "recreatePlayerWithConfig")
57
+ public void recreatePlayerWithConfig(RNJWPlayerView view, ReadableMap config) {
58
+ if (view == null || view.mPlayerView == null) {
59
+ return;
60
+ }
61
+ view.mPlayerView.getPlayer().stop();
62
+ view.setConfig(config);
63
+ }
64
+
49
65
  public Map getExportedCustomBubblingEventTypeConstants() {
50
66
  return MapBuilder.builder()
51
67
  .put(
@@ -55,6 +55,14 @@ public class Util {
55
55
  out.close();
56
56
  }
57
57
  }
58
+
59
+ // Check response code before reading
60
+ int responseCode = urlConnection.getResponseCode();
61
+
62
+ if (responseCode != HttpURLConnection.HTTP_OK) {
63
+ throw new IOException("HTTP POST failed with code " + responseCode);
64
+ }
65
+
58
66
  // Read and return the response body.
59
67
  InputStream inputStream = urlConnection.getInputStream();
60
68
  try {
@@ -62,6 +70,9 @@ public class Util {
62
70
  } finally {
63
71
  inputStream.close();
64
72
  }
73
+ } catch (IOException e) {
74
+ Log.e("Util", "❌ [HTTP POST] Exception: " + e.getMessage(), e);
75
+ throw e;
65
76
  } finally {
66
77
  if (urlConnection != null) {
67
78
  urlConnection.disconnect();
@@ -194,7 +205,8 @@ public class Util {
194
205
  }
195
206
 
196
207
  if (playlistItem.hasKey("authUrl")) {
197
- itemBuilder.mediaDrmCallback(new WidevineCallback(playlistItem.getString("authUrl")));
208
+ String authUrl = playlistItem.getString("authUrl");
209
+ itemBuilder.mediaDrmCallback(new WidevineCallback(authUrl));
198
210
  }
199
211
 
200
212
  if (playlistItem.hasKey("adSchedule")) {
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="90" height="20" role="img" aria-label="version: 1.1.3"><title>version: 1.1.3</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="90" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="51" height="20" fill="#555"/><rect x="51" width="39" height="20" fill="#007ec6"/><rect width="90" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="265" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="410">version</text><text x="265" y="140" transform="scale(.1)" fill="#fff" textLength="410">version</text><text aria-hidden="true" x="695" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="290">1.1.3</text><text x="695" y="140" transform="scale(.1)" fill="#fff" textLength="290">1.1.3</text></g></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="90" height="20" role="img" aria-label="version: 1.3.0"><title>version: 1.3.0</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="90" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="51" height="20" fill="#555"/><rect x="51" width="39" height="20" fill="#007ec6"/><rect width="90" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="265" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="410">version</text><text x="265" y="140" transform="scale(.1)" fill="#fff" textLength="410">version</text><text aria-hidden="true" x="695" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="290">1.3.0</text><text x="695" y="140" transform="scale(.1)" fill="#fff" textLength="290">1.3.0</text></g></svg>