react-native-jw-media-player icon indicating copy to clipboard operation
react-native-jw-media-player copied to clipboard

[Android/iOS] adVmap prop - no ads played

Open davidblanar opened this issue 5 years ago • 3 comments

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.

davidblanar avatar Sep 02 '20 14:09 davidblanar

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
}}

chaimPaneth avatar Sep 06 '20 14:09 chaimPaneth

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 avatar Sep 07 '20 08:09 n1o

@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.

sergey-derevjanko avatar Oct 01 '20 07:10 sergey-derevjanko

Hi @davidblanar

Is this still an issue in the latest versions.

chaimPaneth avatar Oct 23 '23 13:10 chaimPaneth

Closing due to inactivity.

chaimPaneth avatar Feb 08 '24 07:02 chaimPaneth