Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Implementing Ads in JwPlayerView using Android SDK


I am trying to implement the ads using Android SDK. But unfortunately the ad is not playing during the video playback and also it does not throw any errors. I am using AdSource as VAST by waterfalling it. Below is the code I am using. Please have a look. Thanks in advance.


tag1 = "https://playertest.longtailvideo.com/vast-30s-ad.xml";
String tag1Encoded = tag1.replaceAll(" ", "%20");
String[] waterfall = new String[]{tag1Encoded};
List<AdBreak> adSchedule = new ArrayList<AdBreak>();

Ad ad = new Ad(AdSource.VAST, waterfall);
AdBreak adBreak = new AdBreak("pre", ad);
adSchedule.add(adBreak);

mAdvertising = new Advertising(AdSource.VAST, adSchedule);
mAdvertising.setSkipText(getString(R.string.skip_ad));
mAdvertising.setSkipMessage(getString(R.string.ad_skip_message));
mAdvertising.setSkipOffset(3);

final PlayerConfig playerConfig = new PlayerConfig.Builder()
.file(videoUrl)
.autostart(false)
.controls(true)
.mute(false)
.image(thumbNailUrl)
.advertising(mAdvertising)
.build();
jwPlayerView.setup(playerConfig);
jwPlayerView.play();
jwPlayerView.addOnBeforeCompleteListener(new AdvertisingEvents.OnBeforeCompleteListener() {
@Override
public void onBeforeComplete() {
final PlayerConfig playerConfig = new PlayerConfig.Builder()
.file(videoUrl)
.autostart(false)
.controls(true)
.mute(false)
.image(thumbNailUrl)
.build();
jwPlayerView.setup(playerConfig);
}
});

1 Community Answers

George

JW Player Support Agent  
0 rated :

Hi,

Please submit your support case via the dashboard. You need a paid account with an ads entitlement get advertising to work.

In your email to support please include the following:
For me to reproduce this issue reliably I will need this information about your application:

Device’s Android Version:
JW Player SDK for Android version number:
Device make and model where you are experiencing this issue:
Provide step by step instructions on how to reproduce your issue:
JW Player Demo Application Source Code that is also experiencing the issue:

As the last field suggests, please replicate this issue using the JW Player Demo Application and send us a link to a zipped version of the entire Android Studio Project for testing which can be found here:
https://github.com/jwplayer/jwplayer-sdk-android-demo

This question has received the maximum number of answers.