@nlo/ping-video-loader
Advanced tools
Comparing version 0.0.1-alpha.72 to 0.0.1-alpha.76
declare global { | ||
interface Window { | ||
pingVpLoader?: () => void; | ||
pingvp?: { | ||
PingVpVideoScriptsCollection?: { | ||
jsonObject?: (...args: any) => any; | ||
script?: (...args: any) => any; | ||
select?: (...args: any) => void; | ||
_scripts?: { | ||
h: { | ||
[videoName: string]: any; | ||
}; | ||
}; | ||
}; | ||
Webplayer?: (...args: any) => void; | ||
}; | ||
pingvp?: any; | ||
} | ||
} | ||
declare class PingVideoPlayerLoader { | ||
loadVideo(elementId: string, videoName: string): Promise<unknown>; | ||
loadVideo(targetElement: HTMLElement, videoName: string, autoStart: boolean): Promise<unknown>; | ||
private awaitElementLoad; | ||
@@ -22,0 +10,0 @@ private createScriptTag; |
@@ -9,14 +9,12 @@ "use strict"; | ||
} | ||
PingVideoPlayerLoader.prototype.loadVideo = function (elementId, videoName) { | ||
PingVideoPlayerLoader.prototype.loadVideo = function (targetElement, videoName, autoStart) { | ||
var _this = this; | ||
return new Promise(function (resolve) { | ||
// Change empty div into a PingVP element | ||
var targetElement = document.getElementById(elementId); | ||
if (!targetElement) { | ||
return; | ||
} | ||
targetElement.setAttribute('data-video', videoName); | ||
targetElement.setAttribute('data-language', 'Dutch'); | ||
targetElement.setAttribute('data-controls', 'inside'); | ||
targetElement.setAttribute('data-autoStart', 'true'); | ||
if (autoStart) { | ||
targetElement.setAttribute('data-autoStart', 'true'); | ||
} | ||
targetElement.classList.add('PingVP'); | ||
@@ -41,7 +39,3 @@ _this.loadPingVpAsync(); | ||
tag.src = "https://www.pingvp.com/p/aXNejdEHiu"; | ||
var firstScriptTag = document.getElementsByTagName('script')[0]; | ||
if (!firstScriptTag || !firstScriptTag.parentNode) { | ||
return; | ||
} | ||
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); | ||
document.body.appendChild(tag); | ||
scriptIsCreated = true; | ||
@@ -48,0 +42,0 @@ }; |
{ | ||
"name": "@nlo/ping-video-loader", | ||
"version": "0.0.1-alpha.72+7e1127d", | ||
"version": "0.0.1-alpha.76+9fcfb38", | ||
"description": "", | ||
@@ -23,3 +23,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "7e1127da48190ff0eedbbd4edf8a4fdee0d6fddb" | ||
"gitHead": "9fcfb383be8c387620b664030fd1ec71f4ed522a" | ||
} |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
3942
83