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

Error on loading new video while ad is playing


I'm getting this error thrown:

Uncaught (in promise) DOMException: The play() request was interrupted by a new load request.

This happens when I load a new video through the JS API while an ad is playing (preroll ad)


ps can't figure out how to post this question in the JS API section so I listed it here

5 Community Answers

Alex

JW Player Support Agent  
0 rated :

Hi, there.

Can you please supply a link to a reproduction page so we can take a look at your issue?

Thank you.

geek

User  
0 rated :

I was able to resolve the problems I had, there was bad communication within my code. The error still exists, but it doesn't appear to affect my code at this time.

I have a fiddle here
https://jsfiddle.net/1rzts2j1/

and the raw code in the format requested from the test page doc

<!doctype html>
<html>
<head>
<script src="http://content.jwplatform.com/libraries/k3jXTR3V.js"></script>
</head>
<body>
<b>Issue:</b> Error when loading a new video that has an ad playing
<br><br>
<b>Reproduction steps:</b> While ad is playing, click next
<br><br>
<b>Expected behavior:</b> No error messages
<br><br>
<b>Actual outcome:</b> Error message in console
<br><br><br>
<div id="player">Loading your player...</div>
<!-- if you click this button before -->
<div style="text-align:center">
<button onclick="playNext()" style="font-size:1.2em;padding:5px 15px;margin-top:10px;border:none;background:#000;color:#fff;cursor:pointer;">next</button>
</div>
<script>
var player = jwplayer('player');
player.setup({
playlist: [{
file: 'http://clips.vorwaerts-gmbh.de/VfE_html5.mp4',
adschedule: {
one: {
offset: 'pre',
tag: 'http://www.adotube.com/php/services/player/OMLService.php?avpid=oRYYzvQ&platform_version=vast20&ad_type=linear&groupbypass=1&HTTP_REFERER=http://www.longtailvideo.com&video_identifier=longtailvideo.com,test'
}
}
}],
// docs do not mention that advertising.client is required for using per playlist adscheduling
advertising: {
client: 'vast' // this is required
}
});

window.playNext = function() {
player.load([{
file: 'http://techslides.com/demos/sample-videos/small.mp4'
}]);
}
</script>
</body>
</html>

Alex

JW Player Support Agent  
0 rated :

Is there any issue or odd behavior with the playback or is it just that you are seeing the error in the console? If the playback is fine, I would recommend ignoring the error – it is simply saying that the player is ready to call play() after the ad is complete but it is interrupted in doing so because .load() is being called.

geek

User  
0 rated :

Yeah it doesn't affect my code in any way that I can tell, so I just ignore the error. I'll continue to ignore it till there's a problem.

Thanks for the help!

Alex

JW Player Support Agent  
0 rated :

Not a problem. Just so you know, I do believe our engineers are looking into not having that error get sent to the console, but since it is not affecting the performance of the player, it is kind of a low priority.

This question has received the maximum number of answers.