Skip to content

Commit d0cc235

Browse files
committed
Merge branch 'release/0.2.42'
2 parents 8c8ee3a + 24b4d58 commit d0cc235

26 files changed

+3697
-3741
lines changed

Example/ios/Podfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
require_relative '../node_modules/react-native/scripts/react_native_pods'
22
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
33

4-
platform :ios, '12.0'
4+
platform :ios, '14.0'
55
install! 'cocoapods', :deterministic_uuids => false
66

7+
$RNJWPlayerUseGoogleIMA = true
8+
$RNJWPlayerUseGoogleCast = true
9+
710
target 'RNJWPlayer' do
811
config = use_native_modules!
912

Example/ios/Podfile.lock

+37-32
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,19 @@ PODS:
7373
- FlipperKit/FlipperKitNetworkPlugin
7474
- fmt (6.2.1)
7575
- glog (0.3.5)
76-
- google-cast-sdk (4.7.0):
77-
- google-cast-sdk/Core (= 4.7.0)
76+
- google-cast-sdk (4.5.3):
77+
- google-cast-sdk/Core (= 4.5.3)
78+
- GTMSessionFetcher/Core (~> 1.1)
7879
- Protobuf (~> 3.13)
79-
- google-cast-sdk/Core (4.7.0):
80+
- google-cast-sdk/Core (4.5.3):
81+
- GTMSessionFetcher/Core (~> 1.1)
8082
- Protobuf (~> 3.13)
81-
- JWPlayerKit (4.13.0)
83+
- GoogleAds-IMA-iOS-SDK (3.19.2)
84+
- GTMSessionFetcher/Core (1.7.2)
85+
- JWPlayerKit (4.17.0)
8286
- libevent (2.1.12)
8387
- OpenSSL-Universal (1.1.1100)
84-
- Protobuf (3.21.12)
88+
- Protobuf (3.25.1)
8589
- RCT-Folly (2021.06.28.00-v2):
8690
- boost
8791
- DoubleConversion
@@ -289,14 +293,10 @@ PODS:
289293
- React-jsinspector (0.68.1)
290294
- React-logger (0.68.1):
291295
- glog
292-
- react-native-orientation-locker (1.4.0):
296+
- react-native-orientation-locker (1.5.0):
297+
- React-Core
298+
- react-native-safe-area-context (4.7.2):
293299
- React-Core
294-
- react-native-safe-area-context (4.2.5):
295-
- RCT-Folly
296-
- RCTRequired
297-
- RCTTypeSafety
298-
- React
299-
- ReactCommon/turbomodule/core
300300
- React-perflogger (0.68.1)
301301
- React-RCTActionSheet (0.68.1):
302302
- React-Core/RCTActionSheetHeaders (= 0.68.1)
@@ -368,18 +368,19 @@ PODS:
368368
- React-Core
369369
- RNFS (2.16.6):
370370
- React
371-
- RNGestureHandler (2.4.2):
371+
- RNGestureHandler (2.12.1):
372372
- React-Core
373-
- RNJWPlayer (0.2.36):
374-
- google-cast-sdk (~> 4.7.0)
375-
- JWPlayerKit (~> 4.13.0)
376-
- React
377-
- RNScreens (3.13.1):
373+
- RNJWPlayer (0.2.42):
374+
- google-cast-sdk (~> 4.5.3)
375+
- GoogleAds-IMA-iOS-SDK (~> 3.19.1)
376+
- JWPlayerKit (~> 4.17.0)
377+
- React-Core
378+
- RNScreens (3.25.0):
378379
- React-Core
379380
- React-RCTImage
380-
- RNVectorIcons (8.1.0):
381+
- RNVectorIcons (10.0.0):
381382
- React-Core
382-
- SocketRocket (0.6.0)
383+
- SocketRocket (0.6.1)
383384
- Yoga (1.14.0)
384385
- YogaKit (1.18.1):
385386
- Yoga (~> 1.14)
@@ -464,6 +465,8 @@ SPEC REPOS:
464465
- FlipperKit
465466
- fmt
466467
- google-cast-sdk
468+
- GoogleAds-IMA-iOS-SDK
469+
- GTMSessionFetcher
467470
- JWPlayerKit
468471
- libevent
469472
- OpenSSL-Universal
@@ -570,11 +573,13 @@ SPEC CHECKSUMS:
570573
FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
571574
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
572575
glog: 476ee3e89abb49e07f822b48323c51c57124b572
573-
google-cast-sdk: 6731e9a206ce43e0f4433d15598ad8a19f0371d5
574-
JWPlayerKit: cfc3559afa6aed5314e046bce83f35973c2520db
576+
google-cast-sdk: f94c5df87564f71d4342400b8487665e9bed27c6
577+
GoogleAds-IMA-iOS-SDK: 0e817c05ab26f1b9285c80f4a75e1350a916d50b
578+
GTMSessionFetcher: 5595ec75acf5be50814f81e9189490412bad82ba
579+
JWPlayerKit: b0fd3f2abf99f40f8cf8292d550864be4b5df3f9
575580
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
576581
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
577-
Protobuf: 120350fc38646e2dedc26f49ecba778184ea1de2
582+
Protobuf: d94761c33f1239c0a43a0817ca1a5f7f7c900241
578583
RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8
579584
RCTRequired: 00581111c53531e39e3c6346ef0d2c0cf52a5a37
580585
RCTTypeSafety: 07e03ee7800e7dd65cba8e52ad0c2edb06c96604
@@ -588,8 +593,8 @@ SPEC CHECKSUMS:
588593
React-jsiexecutor: 4a4bae5671b064a2248a690cf75957669489d08c
589594
React-jsinspector: 218a2503198ff28a085f8e16622a8d8f507c8019
590595
React-logger: f79dd3cc0f9b44f5611c6c7862badd891a862cf8
591-
react-native-orientation-locker: 2da91e5391971dace445495821c899c111dcad7a
592-
react-native-safe-area-context: ebf8c413eb8b5f7c392a036a315eb7b46b96845f
596+
react-native-orientation-locker: 851f6510d8046ea2f14aa169b1e01fcd309a94ba
597+
react-native-safe-area-context: 7aa8e6d9d0f3100a820efb1a98af68aa747f9284
593598
React-perflogger: 30ab8d6db10e175626069e742eead3ebe8f24fd5
594599
React-RCTActionSheet: 4b45da334a175b24dabe75f856b98fed3dfd6201
595600
React-RCTAnimation: d6237386cb04500889877845b3e9e9291146bc2e
@@ -605,14 +610,14 @@ SPEC CHECKSUMS:
605610
RNBootSplash: 2830c475d5793d6cf12312d1e8f5f1decb0dd3e8
606611
RNDeviceInfo: 1e3f62b9ec32f7754fac60bd06b8f8a27124e7f0
607612
RNFS: 2bd9eb49dc82fa9676382f0585b992c424cd59df
608-
RNGestureHandler: 61628a2c859172551aa2100d3e73d1e57878392f
609-
RNJWPlayer: cd1846f78dc1e996fe7e93462ac140e46ca417c6
610-
RNScreens: 40a2cb40a02a609938137a1e0acfbf8fc9eebf19
611-
RNVectorIcons: 31cebfcf94e8cf8686eb5303ae0357da64d7a5a4
612-
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
613+
RNGestureHandler: c0d04458598fcb26052494ae23dda8f8f5162b13
614+
RNJWPlayer: 78ba87f0d9c4f4b39c8bbc03fe04d73587acd7e8
615+
RNScreens: 85d3880b52d34db7b8eeebe2f1a0e807c05e69fa
616+
RNVectorIcons: 8b5bb0fa61d54cd2020af4f24a51841ce365c7e9
617+
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
613618
Yoga: 17cd9a50243093b547c1e539c749928dd68152da
614619
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
615620

616-
PODFILE CHECKSUM: 72302fbb90a843c0cefdfb43fe4bd7e42dee995b
621+
PODFILE CHECKSUM: 0aa82ae79746645e542b17a02524e6691f65694a
617622

618-
COCOAPODS: 1.11.3
623+
COCOAPODS: 1.14.3

Example/ios/RNJWPlayer.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@
546546
"\"$(PODS_TARGET_SRCROOT)/include/\"",
547547
);
548548
INFOPLIST_FILE = RNJWPlayer/Info.plist;
549-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
549+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
550550
LD_RUNPATH_SEARCH_PATHS = (
551551
"$(inherited)",
552552
"@executable_path/Frameworks",
@@ -620,7 +620,7 @@
620620
"\"$(PODS_TARGET_SRCROOT)/include/\"",
621621
);
622622
INFOPLIST_FILE = RNJWPlayer/Info.plist;
623-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
623+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
624624
LD_RUNPATH_SEARCH_PATHS = (
625625
"$(inherited)",
626626
"@executable_path/Frameworks",

Example/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"react-native-fs": "2.16.6",
2020
"react-native-gesture-handler": "2.12.1",
2121
"rn-iphone-helper": "2.0.0",
22-
"react-native-jw-media-player": "0.2.39",
22+
"react-native-jw-media-player": "0.2.42",
2323
"react-native-orientation-locker": "1.5.0",
2424
"react-native-safe-area-context": "4.7.2",
2525
"react-native-screens": "3.25.0",

RNJWPlayer.podspec

+14-10
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,21 @@ Pod::Spec.new do |s|
1111
s.homepage = package['homepage']
1212
s.platform = :ios, "14.0"
1313
s.source = { :git => "https://github.com/chaimPaneth/react-native-jw-media-player.git", :tag => "v#{s.version}" }
14-
s.source_files = "ios/RNJWPlayer/*.{h,m}"
14+
s.source_files = "ios/RNJWPlayer/*.{h,m,swift}"
1515
s.dependency 'JWPlayerKit', '~> 4.17.0'
16-
s.dependency 'React'
16+
s.dependency 'React-Core'
17+
s.static_framework = true
18+
s.info_plist = {
19+
'NSBluetoothAlwaysUsageDescription' => 'We will use your Bluetooth for media casting.',
20+
'NSBluetoothPeripheralUsageDescription' => 'We will use your Bluetooth for media casting.',
21+
'NSLocalNetworkUsageDescription' => 'We will use the local network to discover Cast-enabled devices on your WiFi network.',
22+
'Privacy - Local Network Usage Description' => 'We will use the local network to discover Cast-enabled devices on your WiFi network.',
23+
'NSMicrophoneUsageDescription' => 'We will use your Microphone for media casting.'
24+
}
25+
s.xcconfig = {
26+
'OTHER_LDFLAGS': '-ObjC',
27+
}
28+
1729
if defined?($RNJWPlayerUseGoogleCast)
1830
Pod::UI.puts "RNJWPlayer: enable Google Cast"
1931
s.dependency 'google-cast-sdk', '~> 4.5.3'
@@ -28,13 +40,5 @@ Pod::Spec.new do |s|
2840
'OTHER_SWIFT_FLAGS' => '$(inherited) -D USE_GOOGLE_IMA'
2941
}
3042
end
31-
s.static_framework = true
32-
s.info_plist = {
33-
'NSBluetoothAlwaysUsageDescription' => 'We will use your Bluetooth for media casting.',
34-
'NSBluetoothPeripheralUsageDescription' => 'We will use your Bluetooth for media casting.',
35-
'NSLocalNetworkUsageDescription' => 'We will use the local network to discover Cast-enabled devices on your WiFi network.',
36-
'Privacy - Local Network Usage Description' => 'We will use the local network to discover Cast-enabled devices on your WiFi network.',
37-
'NSMicrophoneUsageDescription' => 'We will use your Microphone for media casting.'
38-
}
3943

4044
end

android/src/main/java/com/appgoalz/rnjwplayer/RNJWPlayerView.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ public void destroyPlayer() {
311311
EventType.FULLSCREEN,
312312
EventType.SEEK,
313313
EventType.SEEKED,
314+
EventType.PLAYBACK_RATE_CHANGED,
314315
EventType.CAPTIONS_LIST,
315316
EventType.CAPTIONS_CHANGED,
316317
EventType.META,
@@ -390,6 +391,7 @@ public void setupPlayerView(Boolean backgroundAudioEnabled) {
390391
EventType.FULLSCREEN,
391392
EventType.SEEK,
392393
EventType.SEEKED,
394+
EventType.PLAYBACK_RATE_CHANGED,
393395
EventType.CAPTIONS_LIST,
394396
EventType.CAPTIONS_CHANGED,
395397
EventType.META,
@@ -1336,7 +1338,7 @@ public void onSeeked(SeekedEvent seekedEvent) {
13361338
@Override
13371339
public void onPlaybackRateChanged(PlaybackRateChangedEvent playbackRateChangedEvent) {
13381340
WritableMap event = Arguments.createMap();
1339-
event.putString("message", "onRateChange");
1341+
event.putString("message", "onRateChanged");
13401342
event.putDouble("rate", playbackRateChangedEvent.getPlaybackRate());
13411343
getReactContext().getJSModule(RCTEventEmitter.class).receiveEvent(getId(), "topRateChanged", event);
13421344
}

index.d.ts

+64-24
Original file line numberDiff line numberDiff line change
@@ -232,39 +232,79 @@ declare module "react-native-jw-media-player" {
232232
enableLockScreenControls: boolean;
233233
pipEnabled: boolean;
234234
}
235-
type NativeError = (event: { nativeEvent: { code: string, error: string } }) => void;
236-
type NativeWarning = (event: { nativeEvent: { code: string, warning: string } }) => void;
235+
interface BaseEvent<T> {
236+
nativeEvent: T;
237+
}
238+
interface SeekEventProps {
239+
position: number;
240+
offset: number;
241+
}
242+
interface SeekedEventProps {
243+
position: number;
244+
}
245+
interface RateChangedEventProps {
246+
rate: number;
247+
at: number;
248+
}
249+
interface TimeEventProps {
250+
position: number;
251+
duration: number;
252+
}
253+
interface ControlBarVisibleEventProps {
254+
visible: boolean;
255+
}
256+
interface PlaylistEventProps {
257+
playlist: PlaylistItem[]
258+
}
259+
interface PlaylistItemEventProps {
260+
playlistItem: PlaylistItem
261+
}
262+
interface PlayerErrorEventProps {
263+
code: string;
264+
error: string;
265+
}
266+
interface PlayerWarningEventProps {
267+
code: string;
268+
warning: string;
269+
}
270+
interface AdEventProps {
271+
client?: string;
272+
reason?: string;
273+
type: number;
274+
}
275+
type NativeError = (event: BaseEvent<PlayerErrorEventProps>) => void;
276+
type NativeWarning = (event: BaseEvent<PlayerWarningEventProps>) => void;
237277
interface PropsType {
238278
config: Config;
239279
style?: ViewStyle;
240280
controls?: boolean;
241-
onPlayerReady?: (event: any) => void;
242-
onPlaylist?: (playlist: PlaylistItem[]) => void;
243-
onBeforePlay?: (event: any) => void;
244-
onBeforeComplete?: (event: any) => void;
245-
onPlay?: (event: any) => void;
246-
onPause?: (event: any) => void;
281+
onPlayerReady?: () => void;
282+
onPlaylist?: (event: BaseEvent<PlaylistEventProps>) => void;
283+
onBeforePlay?: () => void;
284+
onBeforeComplete?: () => void;
285+
onComplete?: () => void;
286+
onPlay?: () => void;
287+
onPause?: () => void;
288+
onSeek?: (event: BaseEvent<SeekEventProps>) => void;
289+
onSeeked?: (event?: BaseEvent<SeekedEventProps>) => void;
290+
onRateChanged?: (event?: BaseEvent<RateChangedEventProps>) => void;
247291
onSetupPlayerError?: NativeError;
248292
onPlayerError?: NativeError;
249293
onPlayerWarning?: NativeWarning;
250294
onPlayerAdError?: NativeError;
251295
onPlayerAdWarning?: NativeWarning;
252-
onAdEvent?: (event: {client: string?, reason: string?, type: number}) => void;
253-
onAdTime?: (event: {position: number, duration: number}) => void;
254-
onBuffer?: (event: any) => void;
255-
onTime?: (event: any) => void;
256-
onComplete?: (event: any) => void;
257-
onFullScreenRequested?: (event: any) => void;
258-
onFullScreen?: (event: any) => void;
259-
onFullScreenExitRequested?: (event: any) => void;
260-
onFullScreenExit?: (event: any) => void;
261-
onSeek?: (seek: { position: number; offset: number }) => void;
262-
onSeeked?: (seeked?: { position: number }) => void;
263-
onRateChanged?: (changed?: { rate: number, at: number }) => void;
264-
onPlaylistItem?: (playlistItem: PlaylistItem) => void;
265-
onControlBarVisible?: (event: any) => void;
266-
onPlaylistComplete?: (event: any) => void;
267-
onAudioTracks?: (event: any) => void;
296+
onAdEvent?: (event: BaseEvent<AdEventProps>) => void;
297+
onAdTime?: (event: BaseEvent<TimeEventProps>) => void;
298+
onBuffer?: () => void;
299+
onTime?: (event: BaseEvent<TimeEventProps>) => void;
300+
onFullScreenRequested?: () => void;
301+
onFullScreen?: () => void;
302+
onFullScreenExitRequested?: () => void;
303+
onFullScreenExit?: () => void;
304+
onControlBarVisible?: (event: BaseEvent<ControlBarVisibleEventProps>) => void;
305+
onPlaylistComplete?: () => void;
306+
onPlaylistItem?: (event: BaseEvent<PlaylistItemEventProps>) => void;
307+
onAudioTracks?: () => void;
268308
shouldComponentUpdate?: (nextProps: any, nextState: any) => boolean;
269309
}
270310

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const RNJWPlayerManager =
1717
let playerId = 0;
1818
const RCT_RNJWPLAYER_REF = 'RNJWPlayerKey';
1919

20-
const RNJWPlayer = requireNativeComponent('RNJWPlayerView', null);
20+
const RNJWPlayer = requireNativeComponent('RNJWPlayerView');
2121

2222
const JWPlayerStateIOS = {
2323
JWPlayerStateUnknown: 0,

0 commit comments

Comments
 (0)