Skip to content

Commit

Permalink
Merge branch 'release/0.2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
chaimPaneth committed Dec 4, 2021
2 parents 0ff4f55 + 1ca9c3f commit e7be473
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 19 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode, Conf
| **`onPlaylistComplete`** | Player finished playing playlist items. | `none` |
| **`onPlaylistItem`** | When starting to play a playlist item. | JW type playlist item see docs [ios](https://developer.jwplayer.com/sdk/ios/reference/Protocols/JWPlaylistItemEvent.html), [android](https://developer.jwplayer.com/sdk/android/reference/com/longtailvideo/jwplayer/events/PlaylistItemEvent.html) contains additional index of current playing item in playlist 0 for default |
| **`onAudioTracks`** | The list of available audio tracks is updated (happens shortly after a playlist item starts playing). | `none` |
| **`onControlBarVisible`** | When the visibility of the player changes. | `{nativeEvent: {visible: Boolean}}` |

### Background Audio

Expand Down
30 changes: 17 additions & 13 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ buildscript {

apply plugin: 'com.android.library'

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileSdkVersion safeExtGet('compileSdkVersion', 28)
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')

defaultConfig {
minSdkVersion 16
targetSdkVersion 28
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 28)
versionCode 1
versionName "1.0"
ndk {
Expand Down Expand Up @@ -48,22 +52,22 @@ dependencies {
implementation 'com.google.code.gson:gson:2.8.2'

// JWPlayer SDK
implementation 'com.jwplayer:jwplayer-core:4.1.0'
implementation 'com.jwplayer:jwplayer-common:4.1.0'
implementation 'com.jwplayer:jwplayer-chromecast:4.1.0'
implementation 'com.jwplayer:jwplayer-ima:4.1.0'
implementation 'com.jwplayer:jwplayer-core:4.2.0'
implementation 'com.jwplayer:jwplayer-common:4.2.0'
implementation 'com.jwplayer:jwplayer-chromecast:4.2.0'
implementation 'com.jwplayer:jwplayer-ima:4.2.0'

// Ad dependencies
implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.24.0'
implementation 'com.google.android.gms:play-services-ads-identifier:17.0.1'
implementation 'com.google.android.gms:play-services-cast-framework:20.0.0'

// ExoPlayer dependencies
implementation 'com.google.android.exoplayer:exoplayer-core:2.14.0'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.14.0'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.14.0'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.14.0'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.14.0'
implementation 'com.google.android.exoplayer:exoplayer-core:2.14.2'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.14.2'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.14.2'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.14.2'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.14.2'

// JW Player Native UI dependencies
implementation 'com.squareup.picasso:picasso:2.71828'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import com.jwplayer.pub.api.configuration.ads.VastAdvertisingConfig;
import com.jwplayer.pub.api.configuration.ads.VmapAdvertisingConfig;
import com.jwplayer.pub.api.configuration.ads.ima.ImaAdvertisingConfig;
import com.jwplayer.pub.api.configuration.ads.ima.dai.ImaDaiAdvertisingConfig;
import com.jwplayer.pub.api.configuration.ads.dai.ImaDaiAdvertisingConfig;
import com.jwplayer.pub.api.events.AdPauseEvent;
import com.jwplayer.pub.api.events.AdPlayEvent;
import com.jwplayer.pub.api.events.AudioTrackChangedEvent;
Expand Down Expand Up @@ -860,7 +860,7 @@ public void onComplete(CompleteEvent completeEvent) {
public void onControlBarVisibilityChanged(ControlBarVisibilityEvent controlBarVisibilityEvent) {
WritableMap event = Arguments.createMap();
event.putString("message", "onControlBarVisible");
event.putBoolean("controls", controlBarVisibilityEvent.isVisible());
event.putBoolean("visible", controlBarVisibilityEvent.isVisible());
getReactContext().getJSModule(RCTEventEmitter.class).receiveEvent(getId(), "topControlBarVisible", event);

updateWakeLock(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ public Map getExportedCustomBubblingEventTypeConstants() {
MapBuilder.of(
"phasedRegistrationNames",
MapBuilder.of("bubbled", "onAudioTracks")))
.put("topControlBarVisible",
MapBuilder.of(
"phasedRegistrationNames",
MapBuilder.of("bubbled", "onControlBarVisible")))
.build();
}

Expand Down
2 changes: 1 addition & 1 deletion ios/RNJWPlayer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Pod::Spec.new do |s|
s.platform = :ios, "10.0"
s.source = { :git => "https://github.com/chaimPaneth/react-native-jw-media-player.git", :tag => "v#{s.version}" }
s.source_files = "RNJWPlayer/*.{h,m}"
s.dependency 'JWPlayerKit', '~> 4.1.1'
s.dependency 'JWPlayerKit', '~> 4.2.0'
s.dependency 'google-cast-sdk', '~> 4.5.1'
s.dependency 'React'
# s.static_framework = true
Expand Down
4 changes: 2 additions & 2 deletions ios/RNJWPlayer/RNJWPlayerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ - (void)jwplayer:(id<JWPlayer>)player didLoadPlaylistItem:(JWPlayerItem *)item a
NSMutableDictionary* schedDict = [[NSMutableDictionary alloc] init];
for (JWAdBreak* sched in item.adSchedule) {
[schedDict setObject:sched.offset forKey:@"offset"];
[schedDict setObject:sched.tagArray forKey:@"tags"];
[schedDict setObject:sched.tags forKey:@"tags"];
[schedDict setObject:@(sched.type) forKey:@"type"];
}

Expand Down Expand Up @@ -1097,7 +1097,7 @@ - (void)jwplayer:(id<JWPlayer>)player didLoadPlaylist:(NSArray<JWPlayerItem *> *
NSMutableDictionary* schedDict = [[NSMutableDictionary alloc] init];
for (JWAdBreak* sched in item.adSchedule) {
[schedDict setObject:sched.offset forKey:@"offset"];
[schedDict setObject:sched.tagArray forKey:@"tags"];
[schedDict setObject:sched.tags forKey:@"tags"];
[schedDict setObject:@(sched.type) forKey:@"type"];
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-jw-media-player",
"version": "0.2.3",
"version": "0.2.4",
"description": "React-native Android/iOS plugin for JWPlayer SDK (https://www.jwplayer.com/)",
"main": "index.js",
"types": "./index.d.ts",
Expand Down

0 comments on commit e7be473

Please sign in to comment.