Giter Site home page Giter Site logo

radiantmediaplayer / rmp-vast Goto Github PK

View Code? Open in Web Editor NEW
93.0 9.0 35.0 9.1 MB

A client-side JavaScript solution to load, parse and display VAST 2, 3 & 4 resources with HTML5 video

Home Page: https://www.radiantmediaplayer.com/rmp-vast/app/

License: Other

JavaScript 89.20% CSS 2.37% HTML 7.82% Less 0.52% Handlebars 0.09%
vast video javascript html5 advertisement ads vast-player outstream-video-ads

rmp-vast's People

Contributors

radiantmediaplayer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rmp-vast's Issues

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

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.

Incorrect adVerifications parameters in omsdk.js

Please correct omsdk.js.

Incorrect verification parameter:
const resources = this.adVerifications.map((verification) => {
return new VerificationScriptResource(
verification.resource,
verification.vendor,
verification.verificationParameters,
ACCESS_MODE
);
});

Correct verification parameter:
const resources = this.adVerifications.map((verification) => {
return new VerificationScriptResource(
verification.resource,
verification.vendor,
verification.parameters,
ACCESS_MODE
);
});

References:
rmp-vast/src/assets/@dailymotion/vast-client/src/ad_verification.js

export function createAdVerification() {
return {
resource: null,
vendor: null,
browserOptional: false,
apiFramework: null,
type: null,
parameters: null,
trackingEvents: {},
};
}

Failed to fire an event because of console.dir()

In v6.0.0, createApiEvent() in utils.js is below
static createApiEvent(event) {
if (Array.isArray(event)) {
event.forEach(currentEvent => {
if (currentEvent) {
if (this.debug) {
FW.log(currentEvent);
}
FW.createStdEvent(currentEvent, this.container);
}
});
} else if (event) {
if (this.debug) {
FW.log(event);
}
FW.createStdEvent(event, this.container);
}
}

In v7.1.0, createApiEvent() in utils.js is below
static createApiEvent(event) {
if (Array.isArray(event)) {
event.forEach(currentEvent => {
if (currentEvent) {
console.dir(currentEvent);
FW.createStdEvent(currentEvent, this.container);
}
});
} else if (event) {
console.dir(event);
FW.createStdEvent(event, this.container);
}
}

In v7.1.0, I got an error "Could not complete the operation due to error 80020101." for an event, such as adfirstquartile.

After I removed both console.dir(currentEvent); and console.dir(event);, I didn't have an error.

Issue playing VAST tags InApp

Hello,
I'm trying to use rmp-vast to run vast tags inside a Webview in my Android app.The tag runs successfully if tested in Chrome, but in app it shows a weird grey image as placeholder.
Logcat shows the following messages:

12-19 16:57:23.548 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: loadAds starts", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: on user interaction - player needs to be initialized", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: init called", source: about:blank (1939) 12-19 16:57:23.558 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: try to load VAST tag at https://mydomain.com/vasttag/v1/VAST1TESTINTERNA?key=pub-23564-android-4499&vh=480&vw=640&vpos=1&vmin=1&vmax=90&vfmt=1&vplay=1&os=android&ip=72.229.28.185&ab=com.dianxinos.optimizer.duplay&test=1&source=app", source: about:blank (1939) 12-19 16:57:23.568 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: _filterAdPod", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: _parseCreatives", source: about:blank (1939) [INFO:CONSOLE(1941)] "[object HTMLCollection]", source: about:blank (1941) [INFO:CONSOLE(1939)] "rmp-vast: available linear creative follows", source: about:blank (1939) 12-19 16:57:23.578 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1941)] "[object Object]", source: about:blank (1941) [INFO:CONSOLE(1939)] "rmp-vast: selected linear creative follows", source: about:blank (1939) [INFO:CONSOLE(1941)] "[object Object]", source: about:blank (1941) [INFO:CONSOLE(1939)] "rmp-vast: update vast player for linear creative of type video/mp4 located at https://mydomain.com/vasttag/video_flip_def.mp4", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: wire tracking events", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: detected VAST events follow", source: about:blank (1939) [INFO:CONSOLE(1941)] "[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]", source: about:blank (1941) 12-19 16:57:23.658 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: content player event - loadstart", source: about:blank (1939) 12-19 16:57:23.658 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1941)] "[object DOMException]", source: about:blank (1941) [INFO:CONSOLE(1939)] "rmp-vast: playPromise on content player has been rejected", source: about:blank (1939) 12-19 16:57:23.668 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: vast player event - loadstart", source: about:blank (1939) 12-19 16:57:24.888 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: vast player event - durationchange", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: durationchange for VAST player reached", source: about:blank (1939) 12-19 16:57:24.898 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: vast player event - loadedmetadata", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: loadedmetadata for VAST player reached", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: pause content player", source: about:blank (1939) 12-19 16:57:24.908 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: play VAST player", source: about:blank (1939) 12-19 16:57:24.938 13037-13212/com.dev.android.apptest4 I/cr_MediaCodecBridge: create MediaCodec video decoder, mime video/avc 12-19 16:57:24.948 13037-13212/com.dev.android.apptest4 I/ACodec: [] Now uninitialized 12-19 16:57:24.988 13037-13216/com.dev.android.apptest4 I/OMXClient: Using client-side OMX mux. 12-19 16:57:25.138 13037-13216/com.dev.android.apptest4 I/ACodec: [OMX.qcom.video.decoder.avc] Now Loaded 12-19 16:57:25.148 13037-13215/com.dev.android.apptest4 I/MediaCodec: [OMX.qcom.video.decoder.avc] setting surface generation to 13349889 12-19 16:57:25.148 13037-13216/com.dev.android.apptest4 W/ExtendedACodec: Failed to get extension for PASSINPUTBUFFERFD 12-19 16:57:25.148 13037-13216/com.dev.android.apptest4 I/ExtendedACodec: setupVideoDecoder() vpp-enable search is 0 and value is 0 12-19 16:57:25.158 13037-13216/com.dev.android.apptest4 I/ExtendedACodec: Decoder will be in frame by frame mode 12-19 16:57:25.158 13037-13216/com.dev.android.apptest4 I/ACodec: [OMX.qcom.video.decoder.avc] OMX_QCOM_FramePacking_OnlyOneCompleteFrame is setting 12-19 16:57:25.168 13037-13216/com.dev.android.apptest4 I/ACodec: [OMX.qcom.video.decoder.avc] Now Loaded->Idle 12-19 16:57:25.188 13037-13216/com.dev.android.apptest4 D/SurfaceUtils: set up nativeWindow 0x96f47008 for 640x400, color 0x7fa30c04, rotation 0, usage 0x42002900 12-19 16:57:25.198 13037-13216/com.dev.android.apptest4 I/ACodec: [OMX.qcom.video.decoder.avc] configureOutputBuffersFromNativeWindow setBufferCount : 23, minUndequeuedBuffers : 5 12-19 16:57:25.208 13037-13216/com.dev.android.apptest4 I/ACodec: [OMX.qcom.video.decoder.avc] Now Idle->Executing [OMX.qcom.video.decoder.avc] Now Executing 12-19 16:57:25.238 13037-13216/com.dev.android.apptest4 I/ACodec: [OMX.qcom.video.decoder.avc] Now handling output port settings change 12-19 16:57:25.238 13037-13216/com.dev.android.apptest4 D/SurfaceUtils: set up nativeWindow 0x96f47008 for 640x400, color 0x7fa30c04, rotation 0, usage 0x42002900 12-19 16:57:25.248 13037-13216/com.dev.android.apptest4 I/ACodec: [OMX.qcom.video.decoder.avc] configureOutputBuffersFromNativeWindow setBufferCount : 15, minUndequeuedBuffers : 5 12-19 16:57:25.258 13037-13216/com.dev.android.apptest4 I/ACodec: [OMX.qcom.video.decoder.avc] Now Executing 12-19 16:57:25.288 13037-13216/com.dev.android.apptest4 W/ExtendedACodec: Failed to get Profile and Level from Component 12-19 16:57:25.288 13037-13216/com.dev.android.apptest4 W/ExtendedACodec: Failed to get Entropy from Component 12-19 16:57:25.298 13037-13175/com.dev.android.apptest4 D/libEGL: eglInitialize EGLDisplay = 0x978bee6c 12-19 16:57:25.308 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: vast player event - loadeddata", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: vast player event - canplay", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: ping tracking for impression VAST event", source: about:blank (1939) 12-19 16:57:25.318 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: VAST tracking requesting ping at URL http://mydomain.com/vasttag/tracker/impression?tag=VAST1TESTINTERNA", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: ping tracking for start VAST event", source: about:blank (1939) 12-19 16:57:25.328 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: VAST tracking requesting ping at URL http://mydomain.com/vasttag/tracker/start?tag=VAST1TESTINTERNA", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: initial play promise on vast player has succeeded", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: vast player event - canplaythrough", source: about:blank (1939) 12-19 16:57:25.448 13037-13175/com.dev.android.apptest4 D/libEGL: eglInitialize EGLDisplay = 0x978beecc 12-19 16:57:25.508 13037-13175/com.dev.android.apptest4 D/libEGL: eglInitialize EGLDisplay = 0x978beecc 12-19 16:57:25.538 13037-13175/com.dev.android.apptest4 D/libEGL: eglInitialize EGLDisplay = 0x978beecc 12-19 16:57:25.598 13037-13175/com.dev.android.apptest4 D/libEGL: eglInitialize EGLDisplay = 0x978beeac 12-19 16:57:25.618 13037-13175/com.dev.android.apptest4 D/libEGL: eglInitialize EGLDisplay = 0x978beecc 12-19 16:57:25.668 13037-13175/com.dev.android.apptest4 D/libEGL: eglInitialize EGLDisplay = 0x978beecc 12-19 16:57:25.708 13037-13175/com.dev.android.apptest4 D/libEGL: eglInitialize EGLDisplay = 0x978beecc 12-19 16:57:25.758 13037-13175/com.dev.android.apptest4 D/libEGL: eglInitialize EGLDisplay = 0x978beeac 12-19 16:57:25.788 13037-13175/com.dev.android.apptest4 D/libEGL: eglInitialize EGLDisplay = 0x978beecc 12-19 16:57:25.798 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: VAST tracker failed loading http://mydomain.com/vasttag/tracker/impression?tag=VAST1TESTINTERNA", source: about:blank (1939) 12-19 16:57:25.798 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: VAST tracker failed loading http://mydomain.com/vasttag/tracker/start?tag=VAST1TESTINTERNA", source: about:blank (1939) 12-19 16:57:25.838 13037-13175/com.dev.android.apptest4 D/libEGL: eglInitialize EGLDisplay = 0x978beecc 12-19 16:57:25.868 13037-13175/com.dev.android.apptest4 D/libEGL: eglInitialize EGLDisplay = 0x978beecc 12-19 16:57:35.568 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: ping tracking for firstQuartile VAST event", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: VAST tracking requesting ping at URL http://mydomain.com/vasttag/tracker/firstquartile?tag=VAST1TESTINTERNA", source: about:blank (1939) 12-19 16:57:35.848 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: VAST tracker failed loading http://mydomain.com/vasttag/tracker/firstquartile?tag=VAST1TESTINTERNA", source: about:blank (1939) 12-19 16:57:45.558 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: ping tracking for midpoint VAST event", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: VAST tracking requesting ping at URL http://mydomain.com/vasttag/tracker/midpoint?tag=VAST1TESTINTERNA", source: about:blank (1939) 12-19 16:57:45.808 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: VAST tracker failed loading http://mydomain.com/vasttag/tracker/midpoint?tag=VAST1TESTINTERNA", source: about:blank (1939) 12-19 16:57:54.518 13037-13037/com.dev.android.apptest4 V/ActivityThread: updateVisibility : ActivityRecord{8033b43 token=android.os.BinderProxy@a4d598e {com.dev.android.apptest4/com.tappx.sdk.android.InterstitialAdActivity}} show : true 12-19 16:57:55.558 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: ping tracking for thirdQuartile VAST event", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: VAST tracking requesting ping at URL http://mydomain.com/vasttag/tracker/thirdquartile?tag=VAST1TESTINTERNA", source: about:blank (1939) 12-19 16:57:55.798 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: VAST tracker failed loading http://mydomain.com/vasttag/tracker/thirdquartile?tag=VAST1TESTINTERNA", source: about:blank (1939) 12-19 16:57:56.508 13037-13037/com.dev.android.apptest4 I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@a4d598e time:25153445 12-19 16:58:05.568 13037-13212/com.dev.android.apptest4 W/cr_MediaCodecBridge: Releasing: OMX.qcom.video.decoder.avc 12-19 16:58:05.568 13037-13216/com.dev.android.apptest4 I/ACodec: [OMX.qcom.video.decoder.avc] Now Executing->Idle 12-19 16:58:05.568 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: ping tracking for pause VAST event", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: VAST tracking requesting ping at URL http://mydomain.com/vasttag/tracker/pause?tag=VAST1TESTINTERNA", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: ping tracking for complete VAST event", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: VAST tracking requesting ping at URL http://mydomain.com/vasttag/tracker/complete?tag=VAST1TESTINTERNA", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: resumeContent", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: start destroying vast player", source: about:blank (1939) [INFO:CONSOLE(1939)] "rmp-vast: reset - unwireVastPlayerEvents", source: about:blank (1939) 12-19 16:58:05.598 13037-13216/com.dev.android.apptest4 I/ACodec: [OMX.qcom.video.decoder.avc] Now Idle->Loaded [OMX.qcom.video.decoder.avc] Now Loaded 12-19 16:58:05.608 13037-13216/com.dev.android.apptest4 I/ACodec: [OMX.qcom.video.decoder.avc] Now uninitialized [] Now kWhatShutdownCompleted event : 6949 12-19 16:58:05.608 13037-13215/com.dev.android.apptest4 D/libEGL: eglTerminate EGLDisplay = 0x8b04247c eglTerminate EGLDisplay = 0x8b04247c eglTerminate EGLDisplay = 0x8b04247c eglTerminate EGLDisplay = 0x8b04247c eglTerminate EGLDisplay = 0x8b04247c eglTerminate EGLDisplay = 0x8b04247c eglTerminate EGLDisplay = 0x8b04247c eglTerminate EGLDisplay = 0x8b04247c eglTerminate EGLDisplay = 0x8b04247c eglTerminate EGLDisplay = 0x8b04247c eglTerminate EGLDisplay = 0x8b04247c 12-19 16:58:05.608 13037-13215/com.dev.android.apptest4 I/MediaCodec: Codec shutdown complete 12-19 16:58:05.608 13037-13212/com.dev.android.apptest4 W/cr_MediaCodecBridge: Codec released 12-19 16:58:05.618 13037-13175/com.dev.android.apptest4 D/libEGL: eglTerminate EGLDisplay = 0x978bf1ec 12-19 16:58:05.618 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: flushing vastPlayer buffer after ad", source: about:blank (1939) 12-19 16:58:05.638 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1941)] "[object DOMException]", source: about:blank (1941) [INFO:CONSOLE(1939)] "rmp-vast: playPromise on content player has been rejected", source: about:blank (1939) 12-19 16:58:05.818 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: VAST tracker failed loading http://mydomain.com/vasttag/tracker/pause?tag=VAST1TESTINTERNA", source: about:blank (1939) 12-19 16:58:05.858 13037-13037/com.dev.android.apptest4 I/chromium: [INFO:CONSOLE(1939)] "rmp-vast: VAST tracker failed loading http://mydomain.com/vasttag/tracker/complete?tag=VAST1TESTINTERNA", source: about:blank (1939)

Support for Mime Types filter

Hi,
Thanks for the V3. It's an amazing upgrade.
Like the Google IMA SDK, it would be nice to add parameters allowing the filtering of MIME types & Bitrate for linear videos.

params.mimeTypes = ['video/mp4', 'video/webm'];
params.bitrate = 200;

Thank you

Pause event not firing at all

The "pause" event on an ad that is paused is not fired even if the "adpaused" event is correctly fired (see screenshot below):
Capture d’écran 2022-09-02 à 12 05 43

However, the "resume" event seems to be working correctly.

Support VASTAdTagURI>

I thoroughly examined the XML of my source and noticed that it produces a list of other external XML.
The tag is called VASTAdTagURI.
And if we go there, there will already be MediaFiles
can you please support this tag?

How to allow auto height of the rmp-container

How to allow auto height of the rmp-container ?
sometimes video ads have 1x1 proportion, sometime 16:9
I'm trying to get always 100% width with auto height

in most of the cases VAST does not provide height so rmpVast.getAdMediaHeight() gives -1

it looks that rmp-container required declared initial, fixed value

How to properly retry failed fill

What is the proper way to retry if failed to fill/impression due to no available ad inventory? If I call loadAds when adError event is triggered it causes a memory increase (leak?) with each call of loadAds.

Adds full support for creatives delivered with HLS

Currently this only work where native HLS to HTML5 video is supported (iOS, macOS, Android, MS Edge). We would like to extend support for HLS for all devices through hls.js if this feature is reasonable to implement in terms of workload.
Also add test for HLS creatives.

Check for this.container before querySelector call

When searching for a container element by id, it may not exist and return null, so when searching for a contentWrapper element (line 26), querySelector may cause an exception:

this.container = document.getElementById(this.id);
this.contentWrapper = this.container.querySelector('.rmp-content');
this.contentPlayer = this.container.querySelector('.rmp-video');
if (this.container === null || this.contentWrapper === null || this.contentPlayer === null) {
if (DEBUG) {
FW.log('invalid DOM layout - exit');
}
return;
}

Maybe it would be more reliable to check for this.container === null before contentWrapper assignment.

shaka support

Is there any plugin for Shaka player? We are using shaka to play our video content and although shaka provides integration for google ima [0] we would love to use an open source VAST plugin/player instead of Google IMA.

Custom Ad Manager Implementations
architecture supports custom ad manager implementations. Every ad manager should implement the shaka.extern.IAdManager interface. To make the player use a custom ad manager implementation, invoke the code to set it before instantiating the player.

// myapp.CustomAdManager is a placeholder name for your ad manager implementation.
shaka.Player.setAdManagerFactory(() => new myapp.CustomAdManager());

[0] https://shaka-player-demo.appspot.com/docs/api/tutorial-ad_monetization.html

Units in VPAID.getAdRemainingTime(), VAST_PLAYER.getCurrentTime(), VAST_PLAYER.getDuration()

In v.6.0.0 index.js,
getAdRemainingTime() {
if (this.adOnStage && this.creative && this.creative.isLinear) {
if (this.isVPAID) {
return VPAID.getAdRemainingTime.call(this);
} else {
const currentTime = VAST_PLAYER.getCurrentTime.call(this);
const duration = VAST_PLAYER.getDuration.call(this);
if (currentTime === -1 || duration === -1 || currentTime > duration) {
return -1;
}
return (duration - currentTime) * 1000;
}
}
return -1;
}

In v.7.0.0 index.js,
getAdRemainingTime() {
if (this.adOnStage && this.creative && this.creative.isLinear) {
if (this.isVPAID) {
return VPAID.getAdRemainingTime.call(this) * 1000;
} else {
const currentTime = VAST_PLAYER.getCurrentTime.call(this);
const duration = VAST_PLAYER.getDuration.call(this);
if (currentTime === -1 || duration === -1 || currentTime > duration) {
return -1;
}
return duration - currentTime;
}
}
return -1;
}

What is correct unit in VPAID.getAdRemainingTime(), VAST_PLAYER.getCurrentTime(), VAST_PLAYER.getDuration()? seconds? milliseconds?

According to readme.md, getAdCurrentTime() should return milliseconds. Then, v7.0.0 should correct getAdRemainingTime().

getAdCurrentTime(): return Number in ms, representing the current timestamp in the selected linear creative. -1 is returned if this value is not available.

How about this.isVPAID is FALSE, what is the correct value of duration - currentTime?

No way to "preload" Vast Tag without internals force starting it through loadAds() ... break down loadAds()

loadAds() does too much and should be broken down into loadAds() and startAds() , loadAds() doing what the name suggest - loading the ad, while startAds() starts the ad.

currently there is no way to preload ads without having the player starting the ad. This has several unwanted side effects. There is currently no way to tap into the internal sequence, let's say after the "adtagloaded" event, and prevent the ad from being started. Even if immediately pausing the ad via pause() after the "adstarted" event , it is not clear if the the impression tracking request has already been submitted, and firing the tracking pixel prematurely is not desirable, if the goal is to postpone ad start after it has loaded.

Add new macros?

Investigate macros that may be available in the industry but not part of the VAST 3 spec.

setMute not working

I created an unmute button for users to click since the video is set to autoplay. This click triggers the setMute(false) function. Unfortunately it's not working. I made it work once... i do not know what happened.

Rmp player mecanism loading ads depending on screen resolution and not bitrate

Hello guys :D

I'm would like to get informations about rmp player mecanism when loading an ad.
In xml files, you can define several media, with specific resolution/bitrate in order to serve an ad depending your connexion speed. More bandwidth you have, better ad resolution you have.
I'm making some test and for high or slow bandwidth i got the same ad resolution. But If i'm making the same processus on a different screen ( for example 4K, and previous test in 1080p display), i will always have the highest ad quality displayed, even if i am a slow connexion.

Am i wrong somewhere in my code ? Or the bitrate is not take account in rmp-player ?

Example of vast xml loaded:

<MediaFiles>
              <MediaFile id="5241" delivery="progressive" type="video/mp4" bitrate="2000" width="1280" height="720" minBitrate="1500" maxBitrate="2500" scalable="1" maintainAspectRatio="1" codec="H.264">
                <![CDATA[https://iab-publicfiles.s3.amazonaws.com/vast/VAST-4.0-Short-Intro.mp4]]>
              </MediaFile>
              <MediaFile id="5244" delivery="progressive" type="video/mp4" bitrate="1000" width="854" height="480" minBitrate="700" maxBitrate="1500" scalable="1" maintainAspectRatio="1" codec="H.264">
                <![CDATA[https://iab-publicfiles.s3.amazonaws.com/vast/VAST-4.0-Short-Intro-mid-resolution.mp4]]>
              </MediaFile>
              <MediaFile id="5246" delivery="progressive" type="video/mp4" bitrate="600" width="640" height="360" minBitrate="500" maxBitrate="700" scalable="1" maintainAspectRatio="1" codec="H.264">
                <![CDATA[https://iab-publicfiles.s3.amazonaws.com/vast/VAST-4.0-Short-Intro-low-resolution.mp4]]>
             </MediaFile>
</MediaFiles>

Thanks in advance and have a great day,
Bastien

Cannot build with grunt

Hi,

i would like to build your package using Grunt, but during the build i get a fatal error :
image

I am working on Macbook pro/Monterey, but got the same issue on Macbookpro/Catalina, with nodeJS 14.18.3 and npm 6

I would like to understand how to use this library in an React app.

Thanks in advance,
Bastien

vastXmlInput doesn't appear to work

I have downloaded the example (raw-xml-input.html/js) and am running it on localhost. However I am receiving this error:
xhr_url_handler.js:58
GET http://localhost:9001/%3C?xml%20version=%221.0%22%20encoding=%22UTF-8%22?%3…/Linear%3E%3C/Creative%3E%3C/Creatives%3E%3C/InLine%3E%3C/Ad%3E%3C/VAST%3E

It's trying to do a GET call on the xml being passed into the loadAds call, completely ignoring the vastXmlInput parameter.

I tested this on the latest available version, 14.0.1. Please see attached for the files I'm using, I simply stripped away the jasmine code. I feel like this is the most basic use case and should work, what am I missing?

raw-xml-input.zip

Adds support for audio ads

Will need to assess what changes are necessary and what would be the scope of this feature.
Feedback or PR welcome.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.