var _playedContent, trackTitle, trackAlbum, playingDiv, mediaStream, get_playable_song, trackId = 0, playCurrentSong = !1, playerClosed = !1, messageShown = !1, isPopupShown = !1, repeatCoutner = !1, isBannerClicked = !1; !(function (e) { "function" == typeof define && define.amd ? define(["jquery"], e) : e("object" == typeof exports ? require("jquery") : jQuery); })(function (e) { var t = /\+/g; function a(e) { return s.raw ? e : encodeURIComponent(e); } function i(e) { return s.raw ? e : decodeURIComponent(e); } function n(a, i) { var n = s.raw ? a : (function e(a) { 0 === a.indexOf('"') && (a = a.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\")); try { return (a = decodeURIComponent(a.replace(t, " "))), s.json ? JSON.parse(a) : a; } catch (i) { } })(a); return e.isFunction(i) ? i(n) : n; } var s = (e.cookie = function (t, o, l) { if (arguments.length > 1 && !e.isFunction(o)) { if ("number" == typeof (l = e.extend({}, s.defaults, l)).expires) { var r, d = l.expires, c = (l.expires = new Date()); c.setTime(+c + 864e5 * d); } return (document.cookie = [ a(t), "=", ((r = o), a(s.json ? JSON.stringify(r) : String(r))), l.expires ? "; expires=" + l.expires.toUTCString() : "", l.path ? "; path=" + l.path : "", l.domain ? "; domain=" + l.domain : "", l.secure ? "; secure" : "", ].join("")); } for (var p = t ? void 0 : {}, u = document.cookie ? document.cookie.split("; ") : [], y = 0, m = u.length; y < m; y++) { var g = u[y].split("="), f = i(g.shift()), v = g.join("="); if (t && t === f) { p = n(v, o); break; } t || void 0 === (v = n(v)) || (p[f] = v); } return p; }); (s.defaults = {}), (e.removeCookie = function (t, a) { return void 0 !== e.cookie(t) && (e.cookie(t, "", e.extend({}, a, {expires: -1})), !e.cookie(t)); }); }), (function (e) { "use strict"; e(document).ready(function () { try { "song" == getPathVariableByIndex(1) && ((playCurrentSong = !0), setTimeout(function () { getParameterByName("clickcode") && isMobile && contentToStream && (e(".contro-close-player").hide(), e(".footer-player").addClass("top-fixed"), e(".top-fixed") .fadeIn() .css({top: 500}) .animate({top: 0}, 50, function () {}), e(".contro-down-player").removeClass("contro_show").addClass("contro_hide"), e(".contro-up-player").removeClass("contro_hide").addClass("contro_show")); }, 200)); } catch (t) { } if ( (e(document).on("click", ".contro-close-player", function () { s(), (playerClosed = !0), e(".footer-player").hide(), e(".supportfix").css("bottom", "60px"), (trackId = 0); }), e(document).on("click", ".contro-down-player", function () { e(".footer-player").removeClass("contro-play"), e("body").addClass("no_padding"), e(this).addClass("contro_hide"), e(".contro-up-player").addClass("contro_show"), isMobile && contentToStream ? (e(".contro-close-player").hide(), e(".footer-player").addClass("top-fixed"), e(".top-fixed") .fadeIn() .css({top: 500}) .animate({top: 0}, 50, function () {}), e(".contro-down-player").removeClass("contro_show").addClass("contro_hide"), e(".contro-up-player").removeClass("contro_hide").addClass("contro_show")) : e(".supportfix").css("bottom", "130px"); }), e(document).on("click", ".contro-up-player", function () { e(".footer-player").addClass("contro-play"), e("body").removeClass("no_padding"), e(".contro-down-player").removeClass("contro_hide"), e(this).removeClass("contro_show"), isMobile && contentToStream ? (e(".contro-close-player").show(), e(".footer-player").css("top", "auto"), e(".top-fixed").css("background-image", "none"), e(".footer-player").removeClass("top-fixed").removeClass("banner-wrap-on").removeClass("artist-banner"), e(".contro-up-player").addClass("contro_hide"), e(".contro-down-player").addClass("contro_show")) : e(".supportfix").css("bottom", "60px"); }), "yes" == e.cookie("check-contro-class2")) ) e("body").addClass("no_padding"), e(".contro-down-player").addClass("contro_hide"), e(".contro-up-player").addClass("contro_show"); else { var a = e(".footer-player"); a.removeClass("contro-play"), e("body").removeClass("no_padding"), e(".contro-down-player").removeClass("contro_hide"), e(".contro-up-player").removeClass("contro_show"), a.addClass("contro-play"); } var i = function (t) { var a = !0, i = [], n = []; e.cookie("playlist-content") && (n = e.parseJSON(e.cookie("playlist-content"))), e.cookie("noo-playlist") && (i = e.parseJSON(e.cookie("noo-playlist"))), n.forEach(function (e) { e.contentId === t.contentId && (a = !1); }), a && (n.push(t), e.cookie("playlist-content", JSON.stringify(n), {expires: 3600, path: "/"})), -1 == e.inArray(t.contentId, i) && (i.push(t.contentId), e.cookie("noo-playlist", JSON.stringify(i), {expires: 3600, path: "/"})); }, n = function (t) { var a = [], a = []; e.cookie("noo-playlist") && (a = e.parseJSON(e.cookie("noo-playlist"))); var i = e.inArray(parseInt(t), a); i > -1 && a.splice(i, 1), e.cookie("noo-playlist", JSON.stringify(a), {expires: 3600, path: "/"}); var n = []; if ((e.cookie("playlist-content") && (n = e.parseJSON(e.cookie("playlist-content"))), n.length > 0)) { for (var s = 0, o = 0; o < n.length; o++) n[o].contentId === t && (s = o); n.splice(s, 1), e.cookie("playlist-content", JSON.stringify(n), {expires: 3600, path: "/"}); } }, s = function () { m(), e(".footer-player").find("li.album-playlist-item").remove(), e.removeCookie("noo-playlist", {path: "/"}), e.removeCookie("playing-data", {path: "/"}); }, o = function (t) { var a = []; if ((e.cookie("noo-playlist") && (a = e.parseJSON(e.cookie("noo-playlist"))), e.inArray(parseInt(t), a) > -1)) { if (e.cookie("playing-data")) { var i = e.parseJSON(e.cookie("playing-data")); if (!e.cookie("playing-data") || i.song != t) { var n = {song: t, time: 0, status: !1}; e.cookie("playing-data", JSON.stringify(n), {expires: 3600, path: "/"}); } } else { var n = {song: t, time: 0, status: !1}; e.cookie("playing-data", JSON.stringify(n), {expires: 3600, path: "/"}); } } }, l = function (t) { if (e.cookie("noo-playlist") && e.cookie("playing-data")) { var a = e.parseJSON(e.cookie("playing-data")); (a.time = t), e.cookie("playing-data", JSON.stringify(a), {expires: 3600, path: "/"}); } }, r = function (t) { if (e.cookie("noo-playlist") && e.cookie("playing-data")) { var a = e.parseJSON(e.cookie("playing-data")); (a.status = t), e.cookie("playing-data", JSON.stringify(a), {expires: 3600, path: "/"}); } }; get_playable_song = function (t, a) { e.ajax({type: "POST", data: "vdoId=" + t + "&quality=32", url: "/api/content/stream?siteid=" + getParameterByName("siteid"), dataType: "json"}) .done(function (t) { if (t.isSuccess && t.respData && "" != t.respData) { fbq("trackCustom", "Stream"); try { var i = "0"; if (userProfile && "" != userProfile) { var n = userProfile.likedContentIdsMap; n && n[t.respData.contentId] && (i = "1"); } } catch (s) { } isPopupShown = !1; var o = t.respData; (contentToStream = o), p(o); var l = o.contentId; if (l) { e("#audioPlayer").attr("src", o.audioStreamLink), e("#audioPlayer_html5").attr("src", o.audioStreamLink); var r = e(".footer-player"), d = !1; try { userProfile && o.audioStreamLinks && (o.audioStreamLinks.links[64] && o.audioStreamLinks.links[64].indexOf("/64/") > -1 ? (e(".standardQ").attr("data-src", o.audioStreamLinks.links[64]), e(".standardQ").parent().removeClass("hidden"), (d = !0)) : e(".standardQ").parent().addClass("hidden"), o.audioStreamLinks.links[128] && o.audioStreamLinks.links[128].indexOf("/128/") > -1 ? (e(".betterQ").attr("data-src", o.audioStreamLinks.links[128]), e(".betterQ").parent().removeClass("hidden"), (d = !0)) : e(".betterQ").parent().addClass("hidden"), o.audioStreamLinks.links[256] && o.audioStreamLinks.links[256].indexOf("/256/") > -1 ? (e(".bestQ256").attr("data-src", o.audioStreamLinks.links[256]), e(".bestQ256").parent().removeClass("hidden"), (d = !0)) : e(".bestQ256").parent().addClass("hidden"), o.audioStreamLinks.links[320] && o.audioStreamLinks.links[320].indexOf("/320/") > -1 ? (e(".bestQ320").attr("data-src", o.audioStreamLinks.links[320]), e(".bestQ320").parent().removeClass("hidden"), (d = !0)) : e(".bestQ320").parent().addClass("hidden")); } catch (c) { } if ((d ? e(".setting-player").removeClass("hidden") : e(".setting-player").addClass("hidden"), r.find("li#" + l).length)) { if ( (r.find(".current-playing").removeClass("current-playing"), r.find(".current-paused").removeClass("current-paused"), r.find("li#" + l + " ").addClass("current-paused"), v(r.find("li#" + l + " .playlist-play > a")), "" == a) ) { if (e.cookie("playing-data") && e.parseJSON(e.cookie("playing-data")).status) { e(".footer-player").show(), e(".footer-player").removeClass("contro-play"), e(".footer-player").hasClass("contro-play") || isMobile || (e(".contro-down-player").addClass("contro_hide").removeClass("contro_show"), e(".contro-up-player").addClass("contro_show").removeClass("contro_hide")), g(), e(".supportfix").css("bottom", "130px"); try { var y = new Date(); firebaseObj.analytics().logEvent("play_song", {description: "" + o.contentTitle, contentId: o.contentId}), logDBEvent("play_song", "event", o.contentTitle); } catch (m) { console.log("Error logging firebase events" + m); } } } else { g(); try { var y = new Date(); firebaseObj.analytics().logEvent("play_song", {description: "" + o.contentTitle, timestamp: y.toIsoString(), contentId: o.contentId}), logDBEvent("play_song", "event", o.contentTitle); } catch (f) { console.log("Error logging firebase events" + f); } e(".supportfix").css("bottom", "130px"), setTimeout(function () { e(".footer-player") .find("audio") .each(function () { var e; (e = void 0 === this.player ? this : this.player).play(); }); }, 1e3); } } 0 !== o.videoId ? e(".camera")[0] ? (e(".camera").replaceWith( "
" ), e(".camera").show()) : e(".mejs__controls").append( "
" ) : (e(".camera")[0] ? e(".camera").replaceWith( "
" ) : e(".mejs__controls").append( "
" ), e(".videolike-icon").hide()); } u(o); } }) .always(function () { isMobile && t && loadSimilarAudioContent(t, "FULLTRACK"); }); }; var d = function () { try { var t = e.parseJSON(e.cookie("playing-data")); t && "song" !== getPathVariableByIndex(1) && get_playable_song(t.song, ""); } catch (a) { } }, c = function (t) { e( '
  • ' + t.artistTitle + '' + t.albumTitle + '
  • ' ).appendTo(e(".footer-player .album-playlist ul")), e(".footer-player") .find("li#" + t.contentId) .data("thumb", ""), e(".footer-player") .find("li#" + t.contentId) .data("name", t.contentTitle), e(".footer-player") .find("li#" + t.contentId) .data("artist", " " + t.albumTitle + ""), e(".footer-player") .find("li#" + t.contentId) .data("id", t.contentId), e(".footer-player") .find("li#" + t.contentId) .data("album", "/album/" + t.albumId + "/" + t.albumTitle.toLowerCase()); }, p = function (t) { e(".footer-player").find("li#" + t.contentId).length || (c(t), i(t)); }, u = function (e) {}; e(".footer-player") .find(".playlist-delete > a") .off("click") .click(function (t) { t.stopPropagation(), t.preventDefault(), n(e(this).closest("li").data("id")), f(e(this)); }), e(".footer-player") .find(".playlist-play > a") .off("click") .click(function (t) { return ( t.stopPropagation(), t.preventDefault(), e(this).closest("li").siblings("li").removeClass("current-playing current-paused"), e(this).closest("li").hasClass("current-playing") ? (e(this).closest("li").removeClass("current-playing").addClass("current-paused"), m()) : e(this).closest("li").hasClass("current-paused") ? (e(this).closest("li").removeClass("current-paused").addClass("current-playing"), g()) : (e(this).closest("li").addClass("current-playing"), v(e(this)), g()), !1 ); }); var y = function (t) { if ("play" === t) { e(".footer-player").find(".current-paused").removeClass("current-paused").addClass("current-playing"), e(".footer-player").removeClass("contro-play"), e('.single-album-playlist tr[data-id="' + e(".mejs-playpause-button").data("id") + '"]').length && (e(".single-album-playlist .current-playing").removeClass("current-playing"), e('.single-album-playlist tr[data-id="' + e(".mejs-playpause-button").data("id") + '"]').addClass("current-playing")), r(!0); try { contentToStream && contentToStream.contentTitle ? firebaseObj.analytics().logEvent("play_song", {description: "" + contentToStream.contentTitle}) : firebaseObj.analytics().logEvent("play_song", {description: ""}); } catch (a) { } } else { e(".footer-player").find(".current-playing").removeClass("current-playing").addClass("current-paused"), e(".footer-player").removeClass("contro-play"), e('.single-album-playlist tr[data-id="' + e(".mejs-playpause-button").data("id") + '"]').length && e(".single-album-playlist .current-playing").removeClass("current-playing"), r(!1); try { contentToStream && contentToStream.contentTitle ? firebaseObj.analytics().logEvent("pause_song", {description: "" + contentToStream.contentTitle}) : firebaseObj.analytics().logEvent("pause_song", {description: ""}); } catch (i) { } } }, m = function () { e(".footer-player") .find("audio") .each(function () { var e; (e = void 0 === this.player ? this : this.player).pause(); }), r(!1); }, g = function () { e(".footer-player") .find("audio") .each(function () { var e; (e = void 0 === this.player ? this : this.player).play(); }), r(!0); }, f = function (t) { e(t).closest("li").remove(), e(".footer-player") .find("audio") .each(function () { if (e(t).closest("li").hasClass("current-playing")) { var a; (a = void 0 === this.player ? this : this.player).pause(), a.setSrc(""); } }); }, v = function (t, a) { t.attr("href") && [].push({src: t.attr("href"), type: "audio/mpeg"}); var i = t.closest("li").attr("id"); e(".mejs-playpause-button").data("id", i), t.closest("li").data("thumb") && e(".mejs__track-cover").html(t.closest("li").data("thumb")), t.closest("li").data("name") && e(".mejs__track-title").html(t.closest("li").data("name")), t.closest("li").data("artist") && e(".mejs__track-artist").html(" - " + t.closest("li").data("artist")), t.closest("li").data("album") && (e(".mejs__track-artist a").attr("href", "javascript:void(0)"), e(".mejs__track-cover").attr("href", "javascript:void(0)")), e(".footer-player") .find("audio") .each(function () { var e; (e = void 0 === this.player ? this : this.player).pause(), e.load(); }), o(i); }, h = !1; if (playCurrentSong && getPathVariableByIndex(2)) { e(".loader-generic").show(); var k = e(".contentDataDiv"); e.removeCookie("playing-data", {path: "/"}), getPathVariableByIndex(2); var C = "vdoId=" + getPathVariableByIndex(2) + "&quality=32"; e.ajax({type: "POST", data: C, url: "/api/content/stream?siteid=" + getParameterByName("siteid"), dataType: "json"}) .done(function (t) { if ((e(".chat-span").animate({bottom: "140px"}, 400), e(".loader-generic").hide(), e(".loader2").removeClass("hidden"), t.isSuccess && t.respData)) { fbq("trackCustom", "Stream"); try { if (getPathVariableByIndex(2) == '7942369') { const audioElement = document.getElementById('audioPlayer'); // Check if HLS.js is supported in the current browser if (Hls.isSupported()) { // Create an instance of Hls.js const hls = new Hls(); // Load the HLS stream hls.loadSource(t.respData.audioStreamLink); // Handle HLS.js events hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) { // Attach HLS.js to the media element once manifest is parsed hls.attachMedia(audioElement); // Play the video once HLS stream is attached audioElement.play(); }); } else if (audioElement.canPlayType('application/vnd.apple.mpegurl')) { // For Safari and Edge, use the native HLS support audioElement.src = t.respData.audioStreamLink; audioElement.addEventListener('loadedmetadata', function () { // Play the video once native HLS stream is loaded audioElement.play(); }); } else { // If HLS is not supported, display an error message console.error('HLS is not supported in this browser'); } e(".playing-img").addClass("hidden"), e(".tile__media").removeClass("playing-media"), e(".side-recent-content").removeClass("sidelist-playing"), e(playingDiv).addClass("sidelist-playing"), e(playingDiv).find(".playing-img").removeClass("hidden"), e(playingDiv).find(".tile__media").addClass("playing-media"); e(".footer-player").show(); e(".mejs__track-cover img").attr("src", l.thumbnailList.square.replace(".webp", ".jpg")); return; } var a = "0"; if (userProfile && "" != userProfile) { var i = userProfile.likedContentIdsMap; i && i[t.respData.contentId] && (a = "1"); } } catch (n) { } isPopupShown = !1; var s = t.respData; if ( ("" == s.audioStreamLink && displayErrorNoty("Something went wrong.", !1, 1500), e(".playing-img").addClass("hidden"), e(".tile__media").removeClass("playing-media"), e(".side-recent-content").removeClass("sidelist-playing"), e(playingDiv).addClass("sidelist-playing"), e(playingDiv).find(".playing-img").removeClass("hidden"), e(playingDiv).find(".tile__media").addClass("playing-media"), e("#audioPlayer").attr("src", s.audioStreamLink), e("#audioPlayer_html5").attr("src", s.audioStreamLink), (messageShown = !1), (_playedContent = k), k.hasClass("current-playing")) ) { m(), k.removeClass("current-playing").addClass("current-paused"); return; } if (k.hasClass("current-paused")) { g(), k.removeClass("current-paused").addClass("current-playing"); return; } k.closest(".single-album-playlist"), k.closest(".single-album-playlist").find(".current-playing").removeClass("current-playing"), (contentToStream = s); var o = !1; try { userProfile && s.audioStreamLinks && (s.audioStreamLinks.links[64] && s.audioStreamLinks.links[64].indexOf("/64/") > -1 ? (e(".standardQ").attr("data-src", s.audioStreamLinks.links[64]), e(".standardQ").parent().removeClass("hidden"), (o = !0)) : e(".standardQ").parent().addClass("hidden"), s.audioStreamLinks.links[128] && s.audioStreamLinks.links[128].indexOf("/128/") > -1 ? (e(".betterQ").attr("data-src", s.audioStreamLinks.links[128]), e(".betterQ").parent().removeClass("hidden"), (o = !0)) : e(".betterQ").parent().addClass("hidden"), s.audioStreamLinks.links[256] && s.audioStreamLinks.links[256].indexOf("/256/") > -1 ? (e(".bestQ256").attr("data-src", s.audioStreamLinks.links[256]), e(".bestQ256").parent().removeClass("hidden"), (o = !0)) : e(".bestQ256").parent().addClass("hidden"), s.audioStreamLinks.links[320] && s.audioStreamLinks.links[320].indexOf("/320/") > -1 ? (e(".bestQ320").attr("data-src", s.audioStreamLinks.links[320]), e(".bestQ320").parent().removeClass("hidden"), (o = !0)) : e(".bestQ320").parent().addClass("hidden")); } catch (l) { } o ? e(".setting-player").removeClass("hidden") : e(".setting-player").addClass("hidden"); try { var r = new Date(); firebaseObj.analytics().logEvent("play_song", {description: "" + s.contentTitle, timestamp: r.toIsoString(), contentId: s.contentId}); } catch (d) { console.log("Error logging firebase events" + d); } p(s), k.addClass("current-playing"); var c = e(".footer-player").find("li#" + s.contentId); c.addClass("current-playing"), v(c.find(".playlist-play > a")), e(".footer-player").removeClass("contro-play"), isMobile || (e(".contro-down-player").addClass("contro_hide"), e(".contro-up-player").addClass("contro_show")), e(".footer-player").show(), e(".supportfix").css("bottom", "130px"), g(), 0 !== s.videoId ? e(".camera")[0] ? (e(".camera").replaceWith( "
    " ), e(".camera").show()) : e(".mejs__controls").append( "
    " ) : (e(".camera")[0] ? e(".camera").replaceWith( "
    " ) : e(".mejs__controls").append( "
    " ), e(".videolike-icon").hide()), u(s); } else t.respCode ? ("01" == t.respCode && e(".title-user") && "LOGIN" === e(".title-user").html().trim() && showLoginMenu(), "03" == t.respCode && e(".btnSubscribe").trigger("click")) : displayErrorNoty(t.msg, !1, 1500); e(".loader-generic").hide(); }) .fail(function (t) { e(".loader-generic").hide(), displayErrorNoty("Please check your internet connection.", !1, 1500); }) .always(function () { return isMobile && getPathVariableByIndex(2) && loadSimilarAudioContent(getPathVariableByIndex(2), "FULLTRACK"), !1; }); } e("body").on("click", ".bannerClick", function (e) { e.preventDefault(), e.stopPropagation(), (isBannerClicked = !0); }), e("body").on("click", ".contentToPlay, .linkshort ", function (t) { if ((console.log("contentToPlayClicked"), t.stopPropagation(), t.preventDefault(), !h)) { (h = !0), setTimeout(function () { h = !1; }, 200); var a = e(this).data("content"); // Check if 'a' exists and has a valid 'href' if (a && a.href && a.href.trim() !== "") { window.location.href = a.href; return; } if (a && a.type == 'STREAM_URL_AUDIO') { window.location.href = "/song/7942369/live_streaming"; return; } if ( (a || (a = e(this).closest(".contentDataDiv").data("content")), a || (a = e(this).parent().parent().data("content")), a || (a = e(this).parent().parent().parent().data("content")), a && a.bannerContent && (a = a.bannerContent), a && a.respData && (a = a.respData), a || (a = e(this).closest("tr").find(".contentDataDiv").data("content")), !a && contentToStream && (a = contentToStream), !0 === isBannerClicked) ) try { firebaseObj.analytics().logEvent("banner_clicked", {description: "" + a.title}), logDBEvent("play_banner", "event", a.title); } catch (i) { } var n = e(this).closest(".contentDataDiv"); if (a && 0 == a.contentId) { if (!a.type) return displayWarningNoty("" + a.contentTitle + "
    This song is not available in your territory.", !0, 2500), !1; } else { var s = e(this).attr("href"); if (s && !e(this).hasClass("side-recent-content") && !e(this).hasClass("table-content")) return (window.location.href = s), !1; } if ((a && trackId !== a.contentId) || a.type) { if ((a && "FULLTRACK" === a.contentType) || "FULLTRACK" === l) { e(".footer-player").removeClass("contro-play"), isMobile || (e(".contro-down-player").addClass("contro_hide"), e(".contro-up-player").addClass("contro_show")), e(".footer-player").show(), e(".single-album-playlist").removeClass("current-playing"); var o = parseInt(a.contentId), l = a.contentType; l || (l = a.type), e(".album-playlist-item").removeClass("current-playing"); var r = ""; ((isRqtSent = 0), e("#sideRecentContent>div>div>div"), (playingDiv = e(this)), a) ? ((r = "vdoId=" + a.contentId + "&quality=32"), (trackTitle = a.contentTitle), (trackAlbum = a.albumTitle), e(".current-playing-track").removeClass("hidden"), e(".current-playing-track").addClass("contro-down-player"), e("#sideTrackTitle").html(trackTitle + " (Listening)"), e("#sideTrackAlbum").html(trackAlbum)) : (r = "vdoId=" + o + "&quality=32"), e(".footer-player").show(), e(".top-fixed").css("background-image", "url('" + a.thumbnailList.vertical + "')"), !e(".footer-player").hasClass("contro-play") && !isMobile && (e(".contro-up-player").hasClass("contro_hide") || e(".contro-down-player").hasClass("contro_show")) && (e(".contro-down-player").addClass("contro_hide").removeClass("contro_show"), e(".contro-up-player").addClass("contro_show").removeClass("contro_hide")), isMobile && a && loadSimilarAudioContent(a.contentId, "FULLTRACK"), e.removeCookie("playing-data", {path: "/"}), e(".loader-generic").show(), e .ajax({type: "POST", data: r, url: "/api/content/stream?siteid=" + getParameterByName("siteid"), dataType: "json"}) .done(function (t) { if ((e(".chat-span").animate({bottom: "140px"}, 400), e(".loader-generic").hide(), e(".loader2").removeClass("hidden"), t.isSuccess && t.respData)) { fbq("trackCustom", "Stream"); try { var a = "0"; if (userProfile && "" != userProfile) { var i = userProfile.likedContentIdsMap; i && i[t.respData.contentId] && (a = "1"); } } catch (s) { } isPopupShown = !1; var l = t.respData; "" == l.audioStreamLink && displayErrorNoty("Something went wrong.", !1, 1500); try { l.thumbnailList && e(".mejs__track-cover img").attr("src", l.thumbnailList.square.replace(".webp", ".jpg")); } catch (r) { } if (getPathVariableByIndex(2) == '7942369') { const audioElement = document.getElementById('audioPlayer'); // Check if HLS.js is supported in the current browser if (Hls.isSupported()) { // Create an instance of Hls.js const hls = new Hls(); // Load the HLS stream hls.loadSource(l.audioStreamLink); // Handle HLS.js events hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) { // Attach HLS.js to the media element once manifest is parsed hls.attachMedia(audioElement); // Play the video once HLS stream is attached audioElement.play(); }); } else if (audioElement.canPlayType('application/vnd.apple.mpegurl')) { // For Safari and Edge, use the native HLS support audioElement.src = l.audioStreamLink; audioElement.addEventListener('loadedmetadata', function () { // Play the video once native HLS stream is loaded audioElement.play(); }); } else { // If HLS is not supported, display an error message console.error('HLS is not supported in this browser'); } e(".playing-img").addClass("hidden"), e(".tile__media").removeClass("playing-media"), e(".side-recent-content").removeClass("sidelist-playing"), e(playingDiv).addClass("sidelist-playing"), e(playingDiv).find(".playing-img").removeClass("hidden"), e(playingDiv).find(".tile__media").addClass("playing-media"); e(".footer-player").show(); e(".mejs__track-cover img").attr("src", l.thumbnailList.square.replace(".webp", ".jpg")); return; } else { if ( (e(".playing-img").addClass("hidden"), e(".tile__media").removeClass("playing-media"), e(".side-recent-content").removeClass("sidelist-playing"), e(playingDiv).addClass("sidelist-playing"), e(playingDiv).find(".playing-img").removeClass("hidden"), e(playingDiv).find(".tile__media").addClass("playing-media"), e("#audioPlayer").attr("src", l.audioStreamLink), e("#audioPlayer_html5").attr("src", l.audioStreamLink), (messageShown = !1), (_playedContent = n), n.hasClass("current-playing")) ) { m(), n.removeClass("current-playing").addClass("current-paused"); return; } } if (n.hasClass("current-paused")) { g(), n.removeClass("current-paused").addClass("current-playing"); return; } var d = !1; try { userProfile && l.audioStreamLinks && (l.audioStreamLinks.links[64] && l.audioStreamLinks.links[64].indexOf("/64/") > -1 ? (e(".standardQ").attr("data-src", l.audioStreamLinks.links[64]), e(".standardQ").parent().removeClass("hidden"), (d = !0)) : e(".standardQ").parent().addClass("hidden"), l.audioStreamLinks.links[128] && l.audioStreamLinks.links[128].indexOf("/128/") > -1 ? (e(".betterQ").attr("data-src", l.audioStreamLinks.links[128]), e(".betterQ").parent().removeClass("hidden"), (d = !0)) : e(".betterQ").parent().addClass("hidden"), l.audioStreamLinks.links[256] && l.audioStreamLinks.links[256].indexOf("/256/") > -1 ? (e(".bestQ256").attr("data-src", l.audioStreamLinks.links[256]), e(".bestQ256").parent().removeClass("hidden"), (d = !0)) : e(".bestQ256").parent().addClass("hidden"), l.audioStreamLinks.links[320] && l.audioStreamLinks.links[320].indexOf("/320/") > -1 ? (e(".bestQ320").attr("data-src", l.audioStreamLinks.links[320]), e(".bestQ320").parent().removeClass("hidden"), (d = !0)) : e(".bestQ320").parent().addClass("hidden")); } catch (c) { } d ? e(".setting-player").removeClass("hidden") : e(".setting-player").addClass("hidden"), n.closest(".single-album-playlist"), n.closest(".single-album-playlist").find(".current-playing").removeClass("current-playing"), (contentToStream = l); try { var y = new Date(); firebaseObj.analytics().logEvent("play_song", {description: "" + l.contentTitle, timestamp: y.toIsoString(), contentId: l.contentId}), logDBEvent("play_song", "event", l.contentTitle); } catch (f) { console.log("Error logging firebase events" + f); } p(l), n.addClass("current-playing"); var h = e(".footer-player").find("li#" + l.contentId); return ( h.addClass("current-playing"), v(h.find(".playlist-play > a")), e(".footer-player").removeClass("contro-play"), g(), e(".supportfix").css("bottom", "130px"), 0 !== l.videoId ? e(".camera")[0] ? (e(".camera").replaceWith( "
    " ), e(".camera").show()) : e(".mejs__controls").append( "
    " ) : (e(".camera")[0] ? e(".camera").replaceWith( "
    " ) : e(".mejs__controls").append( "
    " ), e(".videolike-icon").hide()), playingDiv.is("td") || playingDiv.parent().is("td") || playingDiv.hasClass("side-recent-content") || (window.location = "/song/" + (l ? l.contentId : o) + "/" + l.contentTitle.replace(/\s+/g, "-").replace(/[^\w\s]/gi, "-")), u(l), !1 ); } t.respCode ? ("01" == t.respCode && e(".title-user") && "LOGIN" === e(".title-user").html().trim() && showLoginMenu(), "03" == t.respCode && e(".btnSubscribe").trigger("click"), "05" == t.respCode && displayErrorNoty(t.msg, !1, 1500)) : displayErrorNoty(t.msg, !1, 1500), e(".loader-generic").hide(); }) .fail(function (t) { logEvent("exception", "Unable to play song due to network error."), e(".loader-generic").hide(), displayErrorNoty("Please check your internet connection.", !1, 1500); }); } else "ALBUM" == l || "ALBUM" == a.type ? (a.type, switchContent("albumTab/" + a.albumId + "/" + a.title.replace(/\s+/g, "-").replace(/[^\w\s]/gi, "-"))) : "ARTIST" == l || "ARTIST" == a.type ? (a.type, switchContent("artistTab/" + a.artistId + "/" + a.title.replace(/\s+/g, "-").replace(/[^\w\s]/gi, "-"))) : "PLAYLIST" == l || "PLAYLIST" == a.type ? (a.type, switchContent("playlist/" + a.id + "/" + a.title.replace(/\s+/g, "-").replace(/[^\w\s]/gi, "-"))) : "FULLTRACK" == l || "FULLTRACK" == a.type ? a.contentId ? (window.location.href = "/song/" + (a ? a.contentId : o) + "/" + a.title.replace(/\s+/g, "-").replace(/[^\w\s]/gi, "-")) : a.albumId && (window.location.href = "/album/" + (a ? a.albumId : o) + "/" + a.title.replace(/\s+/g, "-").replace(/[^\w\s]/gi, "-")) : (window.location.href = "/video/" + (a ? a.contentId : o) + "/" + (a && a.title ? a.title.replace(/\s+/g, "-").replace(/[^\w\s]/gi, "-") : a.contentTitle.replace(/\s+/g, "-").replace(/[^\w\s]/gi, "-"))); } } }); var b = function () { e("body").on("click", ".add-to-playlist-btn", function (t) { t.stopPropagation(), t.preventDefault(); var a = e(this).closest("tr").data(); a && p(a); }); }; b(), e(document).bind("album-list-changed", function () { b(); }); var $ = {}; ($.features = ["playpause", "progress", "current", "duration", "volume"]), ($.audioWidth = "100%"), ($.audioHeight = 76), "undefined" != typeof _wpmejsSettings && ($.pluginPath = _wpmejsSettings.pluginPath), ($.success = function (t) { var a = Math.floor(100 * t.volume); e(".mejs__horizontal-volume-slider").append('"), t.addEventListener("volumechange", function (a) { var i = Math.floor(100 * t.volume); e(".mejs__horizontal-volume-slider") .find(".mejs__volumn-percent") .text(i + "%"); }), t.addEventListener("ended", function () { if (repeatCurrent) mediaStream && (mediaStream.setCurrentTime(0), mediaStream.play(), (repeatCoutner = !0)); else { repeatCoutner = !1; var t = e("#content-table").find(".current-playing").length ? e("#content-table").find(".current-playing") : e("#content-table").find(".current-paused"), a = t.length ? t.next(".single-album-playlist") : []; a.length ? a.find(".contentToPlay").trigger("click") : e("#content-table").first(".single-album-playlist").find(".contentToPlay").trigger("click"); } }), t.addEventListener( "timeupdate", function (a) { mediaStream = t; var i = t.getCurrentTime(); if (contentToStream) { if ((i > 0 && !playerClosed && (trackId = contentToStream.contentId), playingDiv)) { var n = (100 * i) / contentToStream.duration; playingDiv.find(".progress-bar").css("width", n + "%"); } i > 10 && !messageShown && 0 !== contentToStream.videoId && ("" == userProfile || (userProfile && 0 == userProfile.status) || !isMobile) && ((messageShown = !0), displayMessageNoty("From " + contentToStream.albumTitle, !1, 4e3, "Watch Video", contentToStream)); } if (userProfile && contentToStream && parseInt(i) % 5 == 0 && 0 !== parseInt(i) && isRqtSent !== parseInt(i)) { isRqtSent = parseInt(i); var s = "contentId=" + contentToStream.contentId + "&duration=" + parseInt(i); e.ajax({type: "POST", data: s, url: "/api/stream/updateduration?isRepeat=" + repeatCoutner + "&siteid=" + getParameterByName("siteid"), dataType: "json"}); } if (userProfile && userProfile.userId) { if (1 == userProfile.status) l(t.currentTime); else if ( contentToStream && 1 != contentToStream.isFree && (null == contentToStream.freeStream || "" == contentToStream.freeStream || "0" == contentToStream.freeStream || 0 == contentToStream.freeStream) && i > contentToStream.freeStreamDuration && !isPopupShown ) { try { m(), (t.src = ""), e("#audioPlayer").attr("src", ""), e("#audioPlayer_html5").attr("src", ""), g(), m(); } catch (o) { } "" == e("#packgText").html().trim() && loadPackages(), (isPopupShown = !0), e("#subcribemodal2").modal("show"); } } }, !1 ), t.addEventListener("paused", function () { y("pse"); }), t.addEventListener("pause", function () { y("pse"); }), t.addEventListener("play", function () { y("play"); }), t.addEventListener("playing", function () { y("play"); }); var i = e(t).parent(".mejs__mediaelement").siblings(".mejs__controls"), n = i.children(".mejs__playpause-button"); n.children("button").remove(), n.append(''), i.children(".mejs__volume-button"); var s = e(''); s.append(''), s.appendTo(i); var o = e( '
    ' ); o.appendTo(i); var r = e('
    '); i.prepend(r); var c = e('
    '); c.click(function () { var t = !0; if (userProfile && userProfile.userId && 1 == userProfile.status) v(0); else { var a = f(); a > 7 ? (displayWarningNoty("Subscribe for Unlimited Skips", !1, 4e3), (t = !1)) : v(++a); } if (t) { var i = e("#content-table").find(".current-playing").length ? e("#content-table").find(".current-playing") : e("#content-table").find(".current-paused"), n = i.length ? i.prev(".single-album-playlist") : []; if (n.length) n.find(".contentToPlay").trigger("click"); else if (playAll) { var i = e("#content-table").find(".current-playing").length ? e("#content-table").find(".current-playing") : e("#content-table").find(".current-paused"), s = i.length ? i.next(".single-album-playlist") : []; if (s.length) s.find(".contentToPlay").trigger("click"); else if (e.cookie("noo-playlist")) { var o = []; if (((o = e.parseJSON(e.cookie("noo-playlist"))), e.cookie("playing-data"))) { var l = e.parseJSON(e.cookie("playing-data")).song, r = e.inArray(parseInt(l), o); r > 0 && get_playable_song(o[r - 1], "0"); } return o[0]; } } else { var i = e(".playing-media").length ? e(".playing-media").closest(".owl-item") : [], n = i.length ? i.prev(".owl-item") : []; if (n.length) n.find(".contentToPlay").trigger("click"); else { var i = e("#content-table-sim").find(".current-playing").length ? e("#content-table-sim").find(".current-playing") : e("#content-table-sim").find(".current-paused"), n = i.length ? i.prev(".single-album-playlist") : []; if (n.length) n.find(".contentToPlay").trigger("click"); else { var i = e(".side-recent-content").hasClass("sidelist-playing") ? e(".sidelist-playing") : [], n = i.length ? i.prev(".contentToPlay") : []; n.length ? n.trigger("click") : e("#content-table .contentToPlay:eq('1')").trigger("click"); } } } return (repeatCurrent = !1), e(".retweet-icon").css("color", "#FFF"), e(".retweet-icon").css("border", "none"), !1; } }); var p = e(''); c.append(p), p.click(function (t) { return ( repeatCurrent ? ((repeatCurrent = !1), e(this).css("color", "#FFF"), e(this).css("border", "none")) : ((repeatCurrent = !0), e(this).css("color", "#d33676"), e(this).css("border", "1px groove #d33676"), e(this).css("border-radius", "0%")), !1 ); }), c.append(''), c.appendTo(r); var u = e('
    '); function f() { return window.localStorage.getItem("nsc"); } function v(e) { window.localStorage.setItem("nsc", e); } u.click(function () { var t = !0; if (userProfile && userProfile.userId && 1 == userProfile.status) v(0); else { var a = f(); a > 7 ? (displayWarningNoty("Subscribe for Unlimited Skips", !1, 4e3), (t = !1)) : v(++a); } if (t) { var i = e("#content-table").find(".current-playing").length ? e("#content-table").find(".current-playing") : e("#content-table").find(".current-paused"), n = i.length ? i.next(".single-album-playlist") : []; if (n.length) n.find(".contentToPlay").trigger("click"); else if (playAll) { var i = e("#content-table").find(".current-playing").length ? e("#content-table").find(".current-playing") : e("#content-table").find(".current-paused"), n = i.length ? i.next(".single-album-playlist") : []; if (n.length) n.find(".contentToPlay").trigger("click"); else if (e.cookie("noo-playlist")) { var s = []; if (((s = e.parseJSON(e.cookie("noo-playlist"))), e.cookie("playing-data"))) { var o = e.parseJSON(e.cookie("playing-data")).song, l = e.inArray(parseInt(o), s); l > -1 && get_playable_song(s[l + 1], "0"); } return s[0]; } } else { var i = e(".playing-media").length ? e(".playing-media").closest(".owl-item") : [], n = i.length ? i.next(".owl-item") : []; if (n.length) n.find(".contentToPlay").trigger("click"); else { var i = e("#content-table-sim").find(".current-playing").length ? e("#content-table-sim").find(".current-playing") : e("#content-table-sim").find(".current-paused"), n = i.length ? i.next(".single-album-playlist") : []; if (n.length) n.find(".contentToPlay").trigger("click"); else { var i = e(".side-recent-content").hasClass("sidelist-playing") ? e(".sidelist-playing") : [], n = i.length ? i.next(".contentToPlay") : []; n.length ? n.trigger("click") : e("#content-table .contentToPlay:eq('2')").trigger("click"); } } } return (repeatCurrent = !1), e(".retweet-icon").css("color", "#FFF"), e(".retweet-icon").css("border", "none"), !1; } }), u.append(''); var h = e(''); u.append(h), h.click(function () {}), u.appendTo(r); var k = e('
    '); k.click(function () { return e(this).toggleClass("queue-active"), e(this).closest(".footer-player").find(".album-playlist").toggle(), !1; }), k.append(''), k.appendTo(o), d(); }), e(".album-audio-embed").mediaelementplayer($), void 0 === e.cookie("noo-playlist") && e.cookie("noo-playlist", "", {expires: 3600, path: "/"}); }); })(jQuery);