ovenplayer
Version:
OvenPlayer is Open-Source HTML5 Player. OvenPlayer supports WebRTC Signaling from OvenMediaEngine for Sub-Second Latency Streaming.
18 lines (16 loc) • 450 B
JavaScript
/**
* utils for webpack
*/
export const getScriptPath = function(scriptName) {
const scripts = document.getElementsByTagName('script');
for (let i = 0; i < scripts.length; i++) {
const src = scripts[i].src;
if (src) {
const index = src.lastIndexOf('/' + scriptName);
if (index >= 0) {
return src.substr(0, index + 1);
}
}
}
return '';
};