Skip to content

Commit

Permalink
fix: fix error for missing ios command
Browse files Browse the repository at this point in the history
Bump the Google mobile ads SDK to higher version.
Fix for a version tag in podfile.
Bump to gradle to support queries tag.
  • Loading branch information
matejdr committed Feb 12, 2022
1 parent c56fb65 commit 37e3a4d
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 35 deletions.
2 changes: 1 addition & 1 deletion android/constants.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project.ext {
BRIGHTCOVE_VERSION = '6.17.3'
PLAY_SERVICES_VERSION = '19.2.0'
PLAY_SERVICES_VERSION = '20.3.0'
GOOGLE_IMA_SDK_VERSION = '3.19.4'
ANDROIDX_LEGACY_SUPPORT_V4 = '1.0.0'
ANDROIDX_MEDIA = '1.1.0'
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
jcenter()
}
dependencies {
classpath('com.android.tools.build:gradle:3.5.3')
classpath('com.android.tools.build:gradle:3.5.4')

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
78 changes: 48 additions & 30 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,54 @@ PODS:
- DoubleConversion
- glog
- glog (0.3.5)
- Google-Mobile-Ads-SDK (7.55.1):
- GoogleAppMeasurement (~> 6.0)
- Google-Mobile-Ads-SDK (8.11.0):
- GoogleAppMeasurement (< 9.0, >= 7.0)
- GoogleUserMessagingPlatform (>= 1.1)
- GoogleAds-IMA-iOS-SDK (3.14.4)
- GoogleAppMeasurement (6.9.0):
- GoogleUtilities/AppDelegateSwizzler (~> 6.7)
- GoogleUtilities/MethodSwizzler (~> 6.7)
- GoogleUtilities/Network (~> 6.7)
- "GoogleUtilities/NSData+zlib (~> 6.7)"
- nanopb (~> 1.30906.0)
- GoogleUtilities/AppDelegateSwizzler (6.7.2):
- GoogleAppMeasurement (8.12.0):
- GoogleAppMeasurement/AdIdSupport (= 8.12.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/MethodSwizzler (~> 7.7)
- GoogleUtilities/Network (~> 7.7)
- "GoogleUtilities/NSData+zlib (~> 7.7)"
- nanopb (~> 2.30908.0)
- GoogleAppMeasurement/AdIdSupport (8.12.0):
- GoogleAppMeasurement/WithoutAdIdSupport (= 8.12.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/MethodSwizzler (~> 7.7)
- GoogleUtilities/Network (~> 7.7)
- "GoogleUtilities/NSData+zlib (~> 7.7)"
- nanopb (~> 2.30908.0)
- GoogleAppMeasurement/WithoutAdIdSupport (8.12.0):
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/MethodSwizzler (~> 7.7)
- GoogleUtilities/Network (~> 7.7)
- "GoogleUtilities/NSData+zlib (~> 7.7)"
- nanopb (~> 2.30908.0)
- GoogleUserMessagingPlatform (2.0.0)
- GoogleUtilities/AppDelegateSwizzler (7.7.0):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (6.7.2):
- PromisesObjC (~> 1.2)
- GoogleUtilities/Logger (6.7.2):
- GoogleUtilities/Environment (7.7.0):
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.7.0):
- GoogleUtilities/Environment
- GoogleUtilities/MethodSwizzler (6.7.2):
- GoogleUtilities/MethodSwizzler (7.7.0):
- GoogleUtilities/Logger
- GoogleUtilities/Network (6.7.2):
- GoogleUtilities/Network (7.7.0):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (6.7.2)"
- GoogleUtilities/Reachability (6.7.2):
- "GoogleUtilities/NSData+zlib (7.7.0)"
- GoogleUtilities/Reachability (7.7.0):
- GoogleUtilities/Logger
- nanopb (1.30906.0):
- nanopb/decode (= 1.30906.0)
- nanopb/encode (= 1.30906.0)
- nanopb/decode (1.30906.0)
- nanopb/encode (1.30906.0)
- PromisesObjC (1.2.12)
- nanopb (2.30908.0):
- nanopb/decode (= 2.30908.0)
- nanopb/encode (= 2.30908.0)
- nanopb/decode (2.30908.0)
- nanopb/encode (2.30908.0)
- PromisesObjC (2.0.0)
- RCTRequired (0.63.4)
- RCTTypeSafety (0.63.4):
- FBLazyVector (= 0.63.4)
Expand Down Expand Up @@ -228,9 +244,9 @@ PODS:
- React-cxxreact (= 0.63.4)
- React-jsi (= 0.63.4)
- React-jsinspector (0.63.4)
- react-native-brightcove-ima-player (2.0.0):
- react-native-brightcove-ima-player (2.1.1):
- Brightcove-Player-IMA (= 6.10.2)
- Google-Mobile-Ads-SDK (~> 7.55.0)
- Google-Mobile-Ads-SDK (~> 8.11.0)
- React-Core
- React-RCTActionSheet (0.63.4):
- React-Core/RCTActionSheetHeaders (= 0.63.4)
Expand Down Expand Up @@ -334,6 +350,7 @@ SPEC REPOS:
- Google-Mobile-Ads-SDK
- GoogleAds-IMA-iOS-SDK
- GoogleAppMeasurement
- GoogleUserMessagingPlatform
- GoogleUtilities
- nanopb
- PromisesObjC
Expand Down Expand Up @@ -403,12 +420,13 @@ SPEC CHECKSUMS:
FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e
Folly: b73c3869541e86821df3c387eb0af5f65addfab4
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
Google-Mobile-Ads-SDK: f206aff290f26fde422495c6cd187e50efbed57e
Google-Mobile-Ads-SDK: be2192b51b74d74a6ed70590c2e8275412f1b71e
GoogleAds-IMA-iOS-SDK: c190284044e9a28b3e7422ba9886db015c71a84f
GoogleAppMeasurement: a6a3a066369828db64eda428cb2856dc1cdc7c4e
GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3
nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc
PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
GoogleAppMeasurement: ae033c3aad67e68294369373056b4d74cc8ae0d6
GoogleUserMessagingPlatform: ab890ce5f6620f293a21b6bdd82e416a2c73aeca
GoogleUtilities: e0913149f6b0625b553d70dae12b49fc62914fd1
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58
RCTRequired: 082f10cd3f905d6c124597fd1c14f6f2655ff65e
RCTTypeSafety: 8c9c544ecbf20337d069e4ae7fd9a377aadf504b
React: b0a957a2c44da4113b0c4c9853d8387f8e64e615
Expand All @@ -419,7 +437,7 @@ SPEC CHECKSUMS:
React-jsi: a0418934cf48f25b485631deb27c64dc40fb4c31
React-jsiexecutor: 93bd528844ad21dc07aab1c67cb10abae6df6949
React-jsinspector: 58aef7155bc9a9683f5b60b35eccea8722a4f53a
react-native-brightcove-ima-player: 2af8b65ce3d07d20f622978aab38ccb37f59e38c
react-native-brightcove-ima-player: 0c6c39b1a1d8d5e9c9be6ec73f4a4940a86e4725
React-RCTActionSheet: 89a0ca9f4a06c1f93c26067af074ccdce0f40336
React-RCTAnimation: 1bde3ecc0c104c55df246eda516e0deb03c4e49b
React-RCTBlob: a97d378b527740cc667e03ebfa183a75231ab0f0
Expand Down
10 changes: 9 additions & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import { StyleSheet, View, Text } from 'react-native';
import { StyleSheet, View, Text, Button } from 'react-native';
import {
BrightcoveIMAPlayer,
BrightcoveIMAPlayerPoster,
Expand All @@ -24,6 +24,12 @@ const gam_video_url =
'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&cmsid=496&vid=short_onecue&correlator=';

export default function App() {
const videoPlayer = React.useRef<BrightcoveIMAPlayer>(null);

function stopPlayback() {
videoPlayer?.current?.stopPlayback();
}

return (
<View style={styles.container}>
<View>
Expand All @@ -39,6 +45,7 @@ export default function App() {
</View>
<View style={styles.videoBg}>
<BrightcoveIMAPlayer
ref={videoPlayer}
style={styles.video}
accountId={accountId}
policyKey={policyKey}
Expand All @@ -53,6 +60,7 @@ export default function App() {
}}
/>
</View>
<Button title={'Stop Playback'} onPress={stopPlayback} />
</View>
);
}
Expand Down
1 change: 1 addition & 0 deletions ios/BrightcoveIMAPlayerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
-(void) toggleFullscreen:(BOOL)isFullscreen;
-(void) pause;
-(void) play;
-(void) stopPlayback;
-(void) dispose;

@end
9 changes: 9 additions & 0 deletions ios/BrightcoveIMAPlayerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,15 @@ -(void) play {
}
}

-(void) stopPlayback {
if (self.playbackController) {
if (_adsPlaying) {
[self.playbackController pauseAd];
}
[self.playbackController pause];
}
}

-(void)dispose {
[self.playbackController setVideos:@[]];
self.playbackController = nil;
Expand Down
9 changes: 9 additions & 0 deletions ios/BrightcoveIMAPlayerViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ - (dispatch_queue_t)methodQueue {
}];
}

RCT_EXPORT_METHOD(stopPlayback:(nonnull NSNumber *)reactTag) {
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
BrightcoveIMAPlayerView *player = (BrightcoveIMAPlayerView*)viewRegistry[reactTag];
if ([player isKindOfClass:[BrightcoveIMAPlayerView class]]) {
[player stopPlayback];
}
}];
}

RCT_EXPORT_METHOD(dispose:(nonnull NSNumber *)reactTag) {
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
BrightcoveIMAPlayerView *player = (BrightcoveIMAPlayerView*)viewRegistry[reactTag];
Expand Down
4 changes: 2 additions & 2 deletions react-native-brightcove-ima-player.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Pod::Spec.new do |s|
s.authors = package["author"]

s.platforms = { :ios => "10.0" }
s.source = { :git => "https://github.com/NZME/react-native-brightcove-ima-player.git", :tag => "#{s.version}" }
s.source = { :git => "https://github.com/NZME/react-native-brightcove-ima-player.git", :tag => "v#{s.version}" }

s.source_files = "ios/**/*.{h,m,mm}"

s.dependency "React-Core"
s.dependency "Brightcove-Player-IMA", '6.10.2'
s.dependency 'Google-Mobile-Ads-SDK', '~> 7.55.0'
s.dependency 'Google-Mobile-Ads-SDK', '~> 8.11.0'
end

0 comments on commit 37e3a4d

Please sign in to comment.