react-native-jw-media-player
react-native-jw-media-player copied to clipboard
[Android/iOS] adVmap prop - no ads played
Hi @chaimPaneth , it seems that using the adVmap prop as described in the docs does not work neither on iOS nor Android. The vmap url is passed into native code but it seems the player is ignoring it for some reason. It works in the iOS demo app provided by JW Player.
Here's some example code (taken from the example):
<JWPlayer
style={styles.player}
playlistItem={{
mediaId: "1",
file: "http://content.bitsontherun.com/videos/3XnJSIm4-injeKYZS.mp4",
autostart: false,
adVmap: "http://playertest.longtailvideo.com/adtags/vmap2.xml"
}}
onBeforePlay={() => this.onBeforePlay()}
onPlay={() => this.onPlay()}
onSetupPlayerError={(e) => this.onSetupPlayerError(e)}
onPlayerError={(e) => this.onPlayerError(e)}
onBuffer={() => this.onBuffer()}
onTime={(time) => this.onTime(time)}
nativeFullScreen={true}
onFullScreen={() => this.onFullScreen()}
onFullScreenExit={() => this.onFullScreenExit()}
/>
If you could point me to what the problem might be, it would be much appreciated. Thank you.
Hi @davidblanar Did you try setting the adClient as well? try JWAdClientGoogima pass
playlistItem={{
mediaId: "1",
file: "http://content.bitsontherun.com/videos/3XnJSIm4-injeKYZS.mp4",
autostart: false,
adVmap: "http://playertest.longtailvideo.com/adtags/vmap2.xml",
adClient: 1
}}
Hi @chaimPaneth, we actually want to use JWAdClientVast, not JWAdClientGoogima as far as I see we do not pass adClient it defaults to JWAdClientVast.
@n1o @davidblanar
Try to use adSchedule to run ad as preroll \ middleroll
adSchedule:[{tag: 'http://playertest.longtailvideo.com/adtags/vmap2.xml', offset: 'pre'},{tag: 'http://playertest.longtailvideo.com/adtags/vmap2.xml', offset: '5'}]
Taken from https://developer.jwplayer.com/jwplayer/docs/jw8-schedule-vast-ads
In my case it works.
Hi @davidblanar
Is this still an issue in the latest versions.
Closing due to inactivity.