' + _tosubtitle + ' ';
var fromPack = '
' + _fromsubtitle + '
" // geçici diagnostik amaçlı $("#rmpHolder, #rmp").css("filter", "alpha(opacity=0)"); $("#rmpHolder, #rmp").css("opacity", 0); $("#rmpHolder, #rmp").css("overflow", "hidden"); var isiPad = navigator.userAgent.match(/(iPad)/) != null ? true : false; var isiPhone = navigator.userAgent.match(/(iPhone)/) != null ? true : false; var isAndroid = navigator.userAgent.match(/Android/i) != null ? true : false; var isFirefox = navigator.userAgent.indexOf("Firefox") > -1; var isMobile = isiPad || isAndroid || isiPhone; let volumeValue; //Note: Segment [2] olarak alınmasının sebebi, linklerin 724dinle üzerinden gidiyor olmasıdır var category = 'anewsradyo'; if ($("#li_" + category).length > 0) { lastSelection = $("#li_" + category); } else { lastSelection = $("#li_radyoturkuvaz"); } //var lastModified; var radioclass = "radyoturkuvaz", exradioclass = "radyoturkuvaz", port = "8520"; var dataReloadInterval = null; function IsPlaying() { try { // ilk çalıştığında getstate methodu tanımsız oluyor. if (typeof (current_player) != 'undefined') { return !current_player.getPaused(); } else return false; } catch (exception) { return false; } } function isMute() { if (typeof (current_player) != 'undefined') return current_player.getMute(); else return false; } function changeVolume(event, ui) { volumeValue = ui.value; if (typeof (current_player) != 'undefined') current_player.setVolume(volumeValue/100); ChangeVolumeIcon(!(volumeValue > 0)); } function ChangeVolumeIcon(isMute) { if (isMute) { $(".fa-volume-up", player_container).hide(); $(".fa-volume-off", player_container).show(); } else { $(".fa-volume-up", player_container).show(); $(".fa-volume-off", player_container).hide(); } } function controlsBar() { $(".volume-bar", player_container).slider({ range: "min", value: volumeValue, min: 0, max: 100, slide: changeVolume, change: changeVolume }); } function RadioStartProccess(item) { var valus = item.attr('data-val'); if (typeof valus != 'undefined') { $('.draggerList .radioActive').removeClass('true'); //if (!IsPlay() || (lastSelection.attr('data-val') != valus) || (IsPlay && currentMedia == 2)) if (current_player == undefined || lastSelection.attr('data-val') != valus || (IsPlay && currentMedia == 2)) { // Bu current media için enum yapılalacak. SetRadioInfo(valus); // url play ediyor Buranın içinde currentmedia = 1 olacak. (radyo yayını). diğeri ajaxlinkradyoda podcasta tıklamada.... lastSelection = item; // son çalınan radyoyu tutuyor SwapHeadPlayButtonState(false); // üstteki buttonu pause gösteriyor (playing) SwapSelectionRadioPlayState(false, "liItem"); // Soldaki buttonu pause gösteriyor (playing) } else { if (IsPlaying()) { current_player.pause(); SwapHeadPlayButtonState(false); SwapSelectionRadioPlayState(false, "liItem"); } else { current_player.play(); SwapHeadPlayButtonState(true); SwapSelectionRadioPlayState(true, "liItem"); } lastSelection = item; //SwapHeadPlayButtonState(false); //SwapSelectionRadioPlayState(false); } } setTimeout(function () { if (typeof valus == 'undefined') { if (IsPlaying()) { checkPlayer(1); } else { checkPlayer(2); } return; } checkPlayer(); }, 1000); } setTimeout(function () { if (isMobile) { lastSelection = $("#li_radyoturkuvaz"); CurrentRadio = "radyoturkuvaz"; $('.item.trackWrapper').prepend(''); } if (currentCategory.includes("pod") && currentCategory != "podcast") { currentCategory = currentCategory.replace("pod", ""); } //RadioStartProccess($("#li_" + currentCategory)); }, 2000); let isCountryCodeTR=null; function checkCountryCode() { if (isCountryCodeTR == null) { return fetch('https://ipcheck.tmgrup.com.tr/ipcheck/getcity') .then(response => response.json()) .then(data => { if (data.CountryCode === 'TR') { isCountryCodeTR = true; } else { isCountryCodeTR = false; } }) } else { return isCountryCodeTR; } } var lastSelection = $("#li_radyoturkuvaz"); $(document).bind('click', function (e) { // SOL RADYO LİSTESİNE TIKLAMA ve video durdurma var videoPlayerIsShow = GetHolaPlayersID(".videoPlayer div"); if (typeof (videoPlayerIsShow) != "undefined") { GetHolaPlayersID(".videoPlayer div").pause(); }; if (isCountryCodeTR == null) { checkCountryCode().then(() => { RadioStartProccess($(e.target).closest('li')) }) } else { RadioStartProccess($(e.target).closest('li')) } }); function SwapHeadPlayButtonState(state) { SetPlayState("#playerControl", state); } function SwapSelectionRadioPlayState(state,elements) { if (elements != undefined && (elements == 'playerControl' || elements == 'liItem')) { SetPlayState(lastSelection.find(".actionPlay"), state); } else { var isPlay = IsPlaying(); if (isPlay) { SetPlayState(lastSelection.find(".actionPlay"), true); } else { SetPlayState(lastSelection.find(".actionPlay"), false); } } var item = lastSelection; if (state) { $(item).addClass("active"); } } function SetPlayState(item, state) { if (state) { $(item).find('i').removeClass("fa-play"); $(item).find('i').addClass("fa-pause"); if ($(".podcastDetailList").length > 0) { $(".podcastDetailList a").each(function () { if ($(this).attr("podcast-url") == lastPodcast) { $(this).find("i").removeClass("fa-play"); $(this).find("i").addClass("fa-pause"); } }); } } else { $(item).find('i').removeClass("fa-pause"); $(item).find('i').addClass("fa-play"); if ($(".podcastDetailList").length > 0) { $(".podcastDetailList a").each(function () { if ($(this).attr("podcast-url") == lastPodcast) { $(this).find("i").removeClass("fa-pause"); $(this).find("i").addClass("fa-play"); } }); } } } $(window).on("load", function () { $("#playerControl").click(function () { // HEADER PLAY BUTTONUNA TIKLAMA var valus = lastSelection.attr('data-val') var isPlay = IsPlaying(); if (current_player != null) { if (!isPlay) { current_player.play(); } else current_player.pause(); } if (!isPlay) { if (currentMedia == 1) { SwapSelectionRadioPlayState(true,"playerControl"); } SwapHeadPlayButtonState(true); } else { if (currentMedia == 1) { SwapSelectionRadioPlayState(false, "playerControl"); } SwapHeadPlayButtonState(false); } }); //RadioStartProccess($(lastSelection).closest('li')) setTimeout(function () { if (window.HPlayer != undefined && window.HPlayer.vjs != undefined) { window.HPlayer.vjs.muted(); lastSelection.click(); } }, 1500); //$(e.target).closest('li') //$(e.target).find('.fas').toggleClass('pause'); }); function SetSelectedRadio() { $('.stationSelector .radioActive').removeClass(exradioclass); $('.stationSelector .radioActive').addClass(radioclass); exradioclass = radioclass; } function fullID(radioID) { switch (radioID) { case "radyoturkuvaz": return "rt"; case "turkuvazromantik": return "tr"; case "turkuvazefsane": return "te"; case "vavradyo": return "vr"; case "asporradyo": return "asr"; case "anewsradyo": return "anr"; case "ahaberradyo": return "ahr"; case "radyosoft": return "rs"; case "radyoenerji": return "re"; case "turkuvazanadolu": return "ta"; case "apararadyo": return "ap"; case "turkuvazmusiki": return "rm"; case "turkuvaznostalji": return "rn"; } return radioID; } function SetRadioTumb(objName, path, imgName) { $(objName + ' img').remove(); $(objName).prepend('') } function SetRadioTumbs(imgName) { SetRadioTumb('.item.trackWrapper', 'player-thumb', imgName); SetRadioTumb('.item.stationSelector .radioActive .img', 'radio', imgName); } function SetBigImagePath(imgName) { var cat = $("#currentcategory").val(); if (cat != "anasayfa") { SetRadioTumb('.categoryLogoWidget .item .logo', 'radio', imgName); } } function SetCategoryBigImagePath(imgName) { if (imgName == "") { $(".categoryLogoWidget .item .bg").empty(); } else { SetRadioTumb('.categoryLogoWidget .item .bg', 'radio', imgName); } } function SetRadioInfo(val) { if ($('.item.progressBar').is(':visible')) { $('.item.progressBar').css('display', 'none'); } if (val == "anasayfa") { val = "rt"; } var Id = "radyoturkuvaz"; // default var title = "RADYO TURKUVAZ"; // default var url = "https://trkvz-radyo.ercdn.net/radyoturkuvaz/playlist.m3u8"; // default switch (val) { case "rt": Id = "radyoturkuvaz"; title = "RADYO TURKUVAZ"; url = "https://trkvz-radyolar.ercdn.net/radyoturkuvaz/playlist.m3u8"; port = "8520"; //"8520"; SetRadioTumbs('radyo-turkuvaz.png'); SetCategoryBigImagePath('radyo-turkuvaz-kategori-bg.jpg'); SetBigImagePath('radyo-turkuvaz-big.png'); break; case "tr": Id = "turkuvazromantik"; title = "TURKUVAZ ROMANTİK"; url = "https://trkvz-radyolar.ercdn.net/turkuvazromantik/playlist.m3u8"; port = "8530"; //"8530"; SetRadioTumbs('turkuvaz-romantik.png'); SetCategoryBigImagePath('turkuvaz-romantik-kategori-bg.jpg'); SetBigImagePath('turkuvaz-romantik-big.png'); break; case "te": Id = "turkuvazefsane"; title = "TURKUVAZ EFSANE"; url = "https://trkvz-radyolar.ercdn.net/turkuvazefsane/playlist.m3u8"; port = "8540"; //"8540"; SetRadioTumbs('turkuvaz-efsane.png'); SetCategoryBigImagePath('turkuvaz-efsane-kategori-bg.jpg'); SetBigImagePath('turkuvaz-efsane-big.png'); break; case "ahr": Id = "ahaberradyo"; title = "AHABER RADYO"; url = "https://trkvz-radyolar.ercdn.net/ahaberradyo/playlist.m3u8"; port = "8500"; //"8500"; SetRadioTumbs('ahaber-radyo.png'); SetCategoryBigImagePath(''); SetBigImagePath('ahaber-radyo-big.png'); break; case "anr": Id = "anewsradyo"; title = "ANEWS RADYO"; url = "https://trkvz-radyolar.ercdn.net/anewsradyo/playlist.m3u8"; port = "8680"; //"8680"; SetRadioTumbs('anews-radio.png'); SetCategoryBigImagePath(''); SetBigImagePath('anews-radio-big.png'); break; case "asr": Id = "asporradyo"; title = "ASPOR RADYO"; url = "https://trkvz-radyolar.ercdn.net/asporradyo/playlist.m3u8"; port = "8570"; //"8570"; SetRadioTumbs('aspor-radyo.png'); SetCategoryBigImagePath(''); SetBigImagePath('aspor-radyo-big.png'); break; case "vr": Id = "vavradyo"; title = "VAV RADYO"; url = "https://trkvz-radyolar.ercdn.net/radyovav/playlist.m3u8"; port = "8550"; //"8550"; SetRadioTumbs('vav-radyo.png'); SetCategoryBigImagePath('vav-radyo-kategori-bg.jpg'); SetBigImagePath('vav-radyo-big.png'); break; case "rs": Id = "radyosoft"; title = "RADYO SOFT"; url = "https://trkvz-radyolar.ercdn.net/radyosoft/playlist.m3u8"; port = "8600"; // "8600"; SetRadioTumbs('radyo-soft.png'); SetCategoryBigImagePath('radyo-soft-kategori-bg.jpg'); SetBigImagePath('radyo-soft-big.png'); break; case "re": Id = "radyoenerji"; title = "RADYO ENERJİ"; url = "https://trkvz-radyolar.ercdn.net/radyoenergy/playlist.m3u8"; port = "8610"; //"8610"; SetRadioTumbs('radyo-enerji.png'); SetCategoryBigImagePath('radyo-enerji-kategori-bg.jpg'); SetBigImagePath('radyo-enerji-big.png'); break; case "ta": Id = "turkuvazanadolu"; title = "TURKUVAZ ANADOLU"; url = "https://trkvz-radyolar.ercdn.net/turkuvazanadolu/playlist.m3u8"; port = "8580"; //"8580"; SetRadioTumbs('turkuvaz-anadolu.png'); SetCategoryBigImagePath('turkuvaz-anadolu-kategori-bg.jpg'); SetBigImagePath('turkuvaz-anadolu-big.png'); break; case "ap": Id = "apararadyo"; title = "APARA RADYO"; url = "https://trkvz-radyolar.ercdn.net/apararadyo/playlist.m3u8"; port = "8630"; //"8630"; SetRadioTumbs('apara-radyo.png'); SetCategoryBigImagePath(''); SetBigImagePath('apara-radyo-big.png'); break; case "rn": Id = "turkuvaznostalji"; title = "TURKUVAZ NOSTALJİ"; url = "https://trkvz-radyolar.ercdn.net/turkuvaznostalji/playlist.m3u8"; port = "8710"; //"8630"; SetRadioTumbs('turkuvaz-nostalji.png'); SetCategoryBigImagePath('turkuvaz-nostalji-kategori-bg.jpg'); SetBigImagePath('turkuvaz-nostalji-big.png'); break; case "rm": Id = "turkuvazmusiki"; title = "TURKUVAZ MUSİKİ"; url = "https://trkvz-radyolar.ercdn.net/turkuvazmusiki/playlist.m3u8"; port = "8720"; //"8630"; SetRadioTumbs('turkuvaz-musiki.png'); SetCategoryBigImagePath('turkuvaz-musiki-kategori-bg.jpg'); SetBigImagePath('turkuvaz-musiki-big.png'); break; } $("#radioInfo").html(title); GetJsonUpdate(port); LoadPlayer(url, title); currentMedia = 1; CurrentRadio = Id; setTimeout(function () { GetProgramci(); }, 1000); } dataReloadInterval = setInterval(function () { if (currentPort != "0") GetJsonUpdate(currentPort); }, 1000 * 5); var previousCode = "A0"; var currentPort = "0"; function GetJsonUpdate(port) { $.ajax({ url: "https://i.tmgrup.com.tr/rt/broadcast/trackFlag-" + port + ".js", origin: true, cache:false, success: function (data) { if (currentMedia == 2) { return; } if (data != null) { try { _code = data + port; if (_code != previousCode) { DataReload(port); } previousCode = data + port; currentPort = port; } catch (err) { //alert("HATA :" + err); } } } }); } function DataReload(port) { $.ajax({ url: "https://i.tmgrup.com.tr/rt/broadcast/trackJson-" + port + ".json", origin: true, cache: false, success: function (data) { if (currentMedia == 2) { return; } if (data != null) { try { singer = data.SI; song = data.SO; } catch (err) { singer = "singer"; song = "song"; } $('#singer').text(singer); $('#song').text(song); } } }); } function GetHolaPlayersID(param) { if (typeof (videojs) != 'undefined') { var playerList = videojs.getPlayers(); var player = ""; $(param).each(function (index, element) { if ($(element).attr("aria-label") == "video player") { player = $(element); } }); return player != "" ? playerList[player.attr("id")] : null; } } var current_player; var player_container; function loadRadiantMediaPlayer(url, title) { if (current_player != null) { current_player.destroy(); var rmpDiv = document.getElementById('rmp'); rmpDiv.innerHTML = ''; } var src = {} let queryStringParams = new URLSearchParams(window.location.search); if (url.indexOf("aspor") > - 1 && queryStringParams.get('moontest') && queryStringParams.get('moontest') == 1) url = 'https://moondigitaledge2.radyotvonline.net/asporradyo/playlist.m3u8'; const urlParams = new URLSearchParams(window.location.search); const daionParam = urlParams.get('daion'); //if (url == "https://trkvz-radyolar.ercdn.net/radyoturkuvaz/playlist.m3u8" && isCountryCodeTR) { // var dataObj = { // url: "https://trkvz.daioncdn.net/radyo_turkuvaz/radyo_turkuvaz.m3u8?ce=3&app=" + (isMobile ? "95c428e1-c311-4520-ab0f-5897a758ba1d" : "8be741d2-7dec-4f48-8ed4-0225670106b5") // }; // src = { // hls: dataObj.url, // }; // $.ajax({ // url: "https://securevideotoken.tmgrup.com.tr/webtv/secure?" + Math.floor(1000000 * Math.random() + 1), // headers: { // "X-isApp": false, // "X-Rand": (new Date).getTime() // }, // crossDomain: true, // type: "get", // data: dataObj, // dataType: "json", // contentType: "text/plain", // async: false, // success: function (data) { // if (data != null) { // src = { // hls:data.Url, // daion: true, // }; // } // } // }); //} else if (title == "PODCAST") { src = { mp3: url, }; }else { src = { hls: url, }; } const settings = { licenseKey: window.location.href.includes("dev.tmd/") ? 'dm5oamJod2l2a0AxNTIwMjc3' : "Kl8lenNrY3YyeWVpP3JvbTVkYXNpczMwZGIwQSVfKg==", height: 200, src: src, autoplay: true, initialvolume: 0.5, relatedAudioOnly: true, }; //if (url == "https://trkvz-radyolar.ercdn.net/radyoturkuvaz/playlist.m3u8" && isCountryCodeTR) { // settings.hlsJSFetchXhrWithCredentials = true; //} const elementID = 'rmp'; const rmp = new RadiantMP(elementID); var isBeta = title =="PODCAST" ? true : false; var descriptionUrl = "https://www.724dinle.com/radyo"; current_player = rmp; var daion = new DaionJs(current_player, { hlsResolver: function (current_player) { return current_player.getHlsJSInstance(); }, srcMethod: "setSrc", c2a: { text: "Detaylı bilgi için tıklayınız" }, descriptionUrl: descriptionUrl, dfp: { playerType: "videojs", playerVersion: "1.71", videoHeight: 1280, videoWidth: 720 }, ads: { clickDelay: 1000, overlay: { minShrinkHeight: isMobile ? 35 : 115, animate: true, timeout: isBeta ? 30 : 12 } }, }); current_player.on("play", function (event) { if (typeof (ga) !== "undefined" && (typeof tmdCheckConsent === "undefined" || tmdCheckConsent('statistics'))) { ga('send', { hitType: 'event', eventCategory: "AudioPlayerStats", eventAction: "PLAY", eventLabel: title }); } current_player.setMute(false); current_player.play(); SwapHeadPlayButtonState(true); if (currentMedia == 2) { SwapSelectionRadioPlayState(true); var duration = Math.ceil((current_player.getDuration())/1000); $("#progressBar").slider({ range: "min", min: 0, max: duration, slide: seekPodcast }); $("#soundDuration").html(getTimeFormat(duration)); } else { SwapSelectionRadioPlayState(false); } }); current_player.on("pause", function (event) { SwapHeadPlayButtonState(false); }); current_player.on("timeupdate", function (event) { var times = current_player.getCurrentTime(); $("#progressBar").slider("option", 'value', Math.ceil(times/1000)); $("#soundCurrentTime").html(getTimeFormat(times/1000)); }); daion.on("daionAdIn", function (e, data) { }); daion.on("daionAdOut", function (e, data) { }); daion.on("daionAdClicked", function (e, data) { var win = window.open(data.url, '_blank'); win.focus(); }); daion.on("daionAdProgress", function (e, data) { if (data.ad.type == "single" || data.ad.type == "last") { seconds = Math.trunc(((data.ad.endEpoch - data.time) / 1000)); seconds = seconds < 10 ? "0" + seconds : seconds; var countdown = document.getElementById('adCountDown'); if (countdown != null) { document.getElementById('adCountDown').innerHTML = seconds; } } }); current_player.init(settings); } function LoadPlayer(url, title) { try { player_container = document.getElementById('rmp'); var el = document.createElement('div'); el.setAttribute("allow", "autoplay"); player_container.appendChild(el); loadRadiantMediaPlayer(url, title); controlsBar(); if (currentMedia == 0) { setTimeout(function (url, title) { if (isMute()) { current_player.setMute(false); } if (IsPlaying()) { current_player.play(); } }, 2000); } if (isMobile) current_player.play(); } catch (exeption) { //mes("LoadPlayer ERROR!! :" + exeption.toString()); } if (!IsPlaying()) { SwapHeadPlayButtonState(false); SwapSelectionRadioPlayState(false); } // Bu function google'ın autoplay policy si için yazıldı. setTimeout(function () { if (!IsPlaying()) { SwapHeadPlayButtonState(false); SwapSelectionRadioPlayState(false); } }, 3000); setTimeout(function () { checkPlayer(); }, 2000); } function seekPodcast(event, ui) { var seek = ui.value; current_player.seekTo(seek*1000); } /*function PodcastLoadPlayer(url, title, nameForUrl) { //burası sadece podcast detaydan çağrılıyor. fakat detay sayfası iptal olduğundan şuan çağrılmıyor. LoadPlayer(url); clearInterval(dataReloadInterval); $('#singer').text(nameForUrl); $('#song').text(title); if ($('.progressBar').length < 1) { $('
').insertBefore('.volumeControl');
}
}*/
//setup master volume
var vol = 0;
var volCtrl = true;
if (!isAndroid) {
$('.volume').click(function () {
if (volCtrl) {
current_player.setMute(true);
volCtrl = false;
} else {
current_player.setMute(false);
volCtrl = true;
}
});
$('.volProgress').bind('slide', function (event, ui) {
vol = ui['value'];
if (IsPlaying() && event.currentTarget.id != "progressBar") {
if (typeof (current_player) != 'undefined')
current_player.setVolume(vol/100);
}
})
}
function mes(mrj) {
mesaj = mesaj + mrj + "
"; document.getElementById("test").innerHTML = mesaj; } function getTimeFormat(time) { var sec_num = parseInt(time, 10); var hours = Math.floor(sec_num / 3600); var minutes = Math.floor((sec_num - (hours * 3600)) / 60); var seconds = sec_num - (hours * 3600) - (minutes * 60); if (hours < 10) { hours = "0" + hours; } if (minutes < 10) { minutes = "0" + minutes; } if (seconds < 10) { seconds = "0" + seconds; } return hours + ':' + minutes + ':' + seconds; } $(lastSelection).click();