radiantmediaplayer / rmp-vast

A client-side JavaScript solution to load, parse and display VAST 2, 3 & 4 resources with HTML5 video
https://www.radiantmediaplayer.com/rmp-vast/app/
Other
95 stars 37 forks source link

No event fired when calling the "stopAds()" method #53

Closed RaphaelLEMAS closed 2 years ago

RaphaelLEMAS commented 2 years ago

Hello, it is more a question than an issue, shouldn't there be an event fired when we call the "stopAds()" method ? I thought it would trigger the "adclosed" event at least. Tell me if I'm wrong and if yes, is there a way to skip a linear ad that is unskippable and get an event fired for it ?

In addition, is there a way to disable the debug mode when using the library only as an ES2015 module ? It was possible easily in version 6.0.0 with a boolean in the constructor, but it seems to be gone now. I precise that I know there is a compiled library that can be included in the DOM and removes the debug mode but it does not suit my needs.

radiantmediaplayer commented 2 years ago

When you call stopAds, a addestroyed event will fire to indicate that the stop process has completed. stopAds method can be used on skippable or not creatives alike. It will always stop the creative immediately. There is another method call skipAd. skipAd will only stop the ad if it is a skippable ad and it is in skippable state.

If you want to remove the debug logs from the ES2015 module version of rmp-vast v7 you need to use a minifier and remove console.log and console.warn like we do here with terser. The debug setting is no longer available as we ship the library compiled now (and we do not want the logs in the final rmp-vast.min.js file) - you can still use rmp-vast.js file to get logs from the compiled version.