panjareh
Version:
Panjareh using aparat and phoenix-video-player to play videos on desktops and tvs.
10 lines (9 loc) • 401 B
JavaScript
export default function getParameterByName(name, url = window.location.href) {
if (typeof name === "undefined" || name === null) return null;
name = name.replace(/[[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return "";
return decodeURIComponent(results[2].replace(/\+/g, " "));
}