Since exo add API changed removed the ads media source implementation.
This commit is contained in:
parent
112310c38d
commit
7a1bc64c08
@ -92,8 +92,7 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
BecomingNoisyListener,
|
||||
AudioManager.OnAudioFocusChangeListener,
|
||||
MetadataOutput,
|
||||
DefaultDrmSessionEventListener,
|
||||
AdsMediaSource.MediaSourceFactory {
|
||||
DefaultDrmSessionEventListener {
|
||||
|
||||
private static final String TAG = "ReactExoplayerView";
|
||||
|
||||
@ -446,7 +445,7 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
player = ExoPlayerFactory.newSimpleInstance(getContext(), renderersFactory,
|
||||
trackSelector, defaultLoadControl, drmSessionManager, bandwidthMeter);
|
||||
player.addListener(self);
|
||||
player.addMetadataOutput(self);
|
||||
player.addMetadataOutput(self); //a random comment here
|
||||
adsLoader.setPlayer(player);
|
||||
exoPlayerView.setPlayer(player);
|
||||
audioBecomingNoisyReceiver.setListener(self);
|
||||
@ -508,18 +507,6 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
}
|
||||
return new DefaultDrmSessionManager<>(uuid,
|
||||
FrameworkMediaDrm.newInstance(uuid), drmCallback, null, false, 3);
|
||||
// AdsMediaSource.MediaSourceFactory implementation.
|
||||
}
|
||||
|
||||
@Override
|
||||
public MediaSource createMediaSource(Uri uri) {
|
||||
return buildMediaSource(uri, extension);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSupportedTypes() {
|
||||
// IMA does not support Smooth Streaming ads.
|
||||
return new int[] {C.TYPE_DASH, C.TYPE_HLS, C.TYPE_OTHER};
|
||||
}
|
||||
|
||||
private MediaSource buildMediaSource(Uri uri, String overrideExtension) {
|
||||
|
@ -135,7 +135,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':react-native-video')
|
||||
implementation project(':react-native-video-inc-ads')
|
||||
implementation "com.facebook.react:react-native:+" // From node_modules
|
||||
implementation 'org.webkit:android-jsc:+'
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
rootProject.name = 'VideoPlayer'
|
||||
|
||||
include ':react-native-video'
|
||||
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
|
||||
include ':react-native-video-inc-ads'
|
||||
project(':react-native-video-inc-ads').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video-inc-ads/android-exoplayer')
|
||||
|
||||
include ':app'
|
||||
|
@ -2,4 +2,14 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
module.exports = {
|
||||
reactNativePath: fs.realpathSync(path.resolve(require.resolve('react-native-windows/package.json'), '..')),
|
||||
dependencies: {
|
||||
'react-native-video-inc-ads': {
|
||||
platforms: {
|
||||
android: {
|
||||
sourceDir:
|
||||
'../node_modules/react-native-video-inc-ads/android-exoplayer',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user