1/** 2* 3* @package qtmplayer 4* @subpackage qtmplayer-radiofeed 5* 6*/ 7 8(function($) { 9 "use strict"; 10 function isXML(xml){ 11 try { 12 xmlDoc = $.parseXML(xml); //is valid XML 13 return true; 14 } catch (err) { 15 // was not XML 16 return false; 17 } 18 } 19 20 21 22 $.qtmplayerRadioFeedObj = { 23 body: $("body"), 24 window: $(window), 25 document: $(document), 26 htmlAndbody: $('html,body'), 27 qtFeedData: {}, 28 timeInterval: 15000, 29 /** 30 * ======================================================================================================================================== | 31 * | 32 * | 33 * START SITE FUNCTIONS | 34 * | 35 * | 36 * ======================================================================================================================================== | 37 */ 38 fn: { 39 cachedThumbsArray: [], // when this changes, we fetch a new cover 40 updateMediaData(){ 41 console.log( 'updateMediaData: ' ); 42 console.log( $.qtMplayerGlobalSongData ); 43 if ('mediaSession' in navigator) { 44 if($.qtMplayerGlobalSongData.thumbnail && false !== $.qtMplayerGlobalSongData.thumbnail){ 45 console.log('Yes art'); 46 navigator.mediaSession.metadata = new MediaMetadata({ 47 title: $.qtMplayerGlobalSongData.title, 48 artist: $.qtMplayerGlobalSongData.artist, 49 artwork: [ 50 { src: $.qtMplayerGlobalSongData.thumbnail, type: "image/jpeg" } 51 ] 52 }); 53 } else { 54 console.log('No art'); 55 navigator.mediaSession.metadata = new MediaMetadata({ 56 title: $.qtMplayerGlobalSongData.title, 57 artist: $.qtMplayerGlobalSongData.artist 58 }); 59 } 60 } 61 }, 62 // ----------------------------------------------- FEED READERS END ------------------------------------ 63 getThumbnail: function(that, termArray, callBack){ 64 65 66 var preclean = termArray.split('<!--'); 67 if(preclean.length > 1){ 68 termArray = preclean[0]; 69 } 70 71 termArray = termArray.split(' - ').join('-').split(' ').join('+'); 72 73 var thumb; // image from itunes 74 var apiUrl = 'https://itunes.apple.com/search?term='+termArray; 75 76 if(termArray == 'Song title unavailable' || termArray == 'No Titles Available'){ 77 thumb = $.qtmplayerRadioFeedObj.qtFeedData.cover; 78 that.cachedThumbsArray[termArray] = thumb; 79 $.qtMplayerGlobalSongData.thumbnail = thumb; 80 callBack(thumb); 81 return; 82 } 83 84 85 if( undefined === that.cachedThumbsArray[termArray] ) { 86 87 if( $.qtmplayerRadioFeedObj.qtFeedData.artwork ){ 88 termArray = termArray.toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g, ''); 89 callBack($.qtmplayerRadioFeedObj.qtFeedData.artwork+'?song='+termArray); 90 } else { 91 92 $.ajax({ 93 type: 'GET', 94 cache: true, 95 url: apiUrl, 96 async: true, 97 dataType: 'jsonp', 98 context: this, 99 success: function(json) { 100 if('object' !== typeof( json )){ 101 json = JSON.parse(json); 102 } 103 if(json.resultCount > 0){ 104 thumb = json.results[0].artworkUrl100.split('100x100bb.jpg').join('1000x1000bb.jpg'); 105 that.cachedThumbsArray[termArray] = thumb; 106 $.qtMplayerGlobalSongData.thumbnail = thumb; 107 108 109 callBack(thumb); 110 return; 111 } 112 } 113 }); 114 } 115 } else { 116 // return cached image 117 $.qtMplayerGlobalSongData.thumbnail = that.cachedThumbsArray[termArray]; 118 callBack( that.cachedThumbsArray[termArray] ); 119 return; 120 } 121 $.qtmplayerRadioFeedObj.fn.updateMediaData(); 122 }, 123 124 125 126 /**==================================================================== 127 * 128 * 129 * Marquee for longer texts 130 * 131 * 132 ====================================================================*/ 133 marqueeInstances: [], 134 marqueeText: function(that) { 135 if('function' !== typeof( $.fn.marquee ) ){ // missing marquee library? quit 136 return; 137 } 138 var marquees = $('body').find('.proradio-marquee'); 139 // Destroy any old instance of the marquee 140 if( that.marqueeInstances.length > 0 ){ 141 for( var mi = 0; mi < that.marqueeInstances.length; mi++ ){ 142 if( 'undefined' !== typeof( that.marqueeInstances[mi] )){ 143 that.marqueeInstances[mi].marquee('destroy'); 144 } 145 } 146 that.marqueeInstances = []; // reset 147 } 148 $.each(marquees, function(i,c){ 149 var item = $(c); 150 if(item.find('.marquee').length === 0){ 151 item.html('<span class="marquee">'+item.html()+'</span>'); 152 } 153 if( item.outerWidth() > item.find('.marquee').outerWidth() ){ // the title is short? quit! 154 return; 155 } 156 that.marqueeInstances[i] = item.marquee({ 157 duration: 20000, 158 gap: 150, 159 delayBeforeStart: 0, 160 direction: 'left', 161 duplicated: true, 162 pauseOnCycle: 0, 163 startVisible: true 164 }); 165 }); 166 }, 167 168 /** 169 * =======================================================
170 * Display listeners when available 171 * @since 2022 06 21 172 * ======================================================= 173 * */ 174 qtApplyListeners: function(listeners, listener_peak){ 175 if($.qtmplayerRadioFeedObj.qtFeedData.listeners || $.qtmplayerRadioFeedObj.qtFeedData.listenerspeak){ 176 if(listeners || listener_peak){ 177 $(".qtmplayer__stats").addClass('show'); 178 if(listeners && $.qtmplayerRadioFeedObj.qtFeedData.listeners){ 179 $('.qtmplayer-listeners span').html(listeners); 180 $('.qtmplayer-listeners').show(); 181 } else { 182 $('.qtmplayer-listeners').hide(); 183 } 184 if(listener_peak && $.qtmplayerRadioFeedObj.qtFeedData.listenerspeak){ 185 $('.qtmplayer-listener_peak span').html(listener_peak); 186 $('.qtmplayer-listener_peak').show(); 187 } else { 188 $('.qtmplayer-listener_peak').hide(); 189 } 190 return true; 191 } 192 } 193 $(".qtmplayer__stats").removeClass('show'); 194 $('.qtmplayer-listeners span').html(''); 195 $('.qtmplayer-listener_peak span').html(''); 196 return; 197 }, 198 199 200 qtApplyTitle: function(result, callBack){ 201 var that = this; 202 if(result && result !== ''){ 203 204 var dmes = '>>>>> qtApplyTitle : '+result; 205 $.qtmplayerRadioFeedObj.fn.log(dmes); 206 207 // result = decodeURIComponent(escape(result)); 208 var feedsplit = result.split(" - "); 209 var artist; 210 var title; 211 if(feedsplit.length > 1){ 212 artist = feedsplit[0], 213 title = feedsplit[1]; 214 } else { 215 feedsplit = result.split("-"); 216 if(feedsplit.length > 1){ 217 artist = feedsplit[0], 218 title = feedsplit[1]; 219 } else { 220 artist = ""; 221 title = result; 222 } 223 } 224 var artistSplit = artist.split('['); 225 if( artistSplit.length > 1 ){ 226 artist = artistSplit[0]; 227 } 228 artistSplit = artist.split(' : '); 229 if( artistSplit.length > 1 ){ 230 artist = artistSplit[1]; 231 } 232 var titleSplit = title.split('['); 233 if( titleSplit.length > 1 ){ 234 title = titleSplit[0]; 235 } 236 title = $.trim(title); 237 artist = $.trim(artist); 238 239 $(".qtmplayer-feed").show(); 240 $('.qtmplayer__title').html(title); 241 $('.qtmplayer__artist').html(artist); 242 243 244 245 246 that.marqueeText( that ); 247 var termArray = artist+'-'+title; 248 249 if( callBack ){ 250 this.getThumbnail(that, termArray, callBack ); 251 } 252 253 254 // Update media data ============================== 255 if (window.screen.width < 670 ) { 256 var uA = navigator.userAgent || navigator.vendor || window.opera; 257 if ( /Googlebot/i.test(uA) || /Bing/i.test(uA) || /Yandex/i.test(uA) || /Apple Bot/i.test(uA) || /DuckDuck Bot/i.test(uA) ){ 258 // Do nothing 259 } else { 260 jQuery(document).prop('title', artist+' - '+title); 261 } 262 } 263 $.qtMplayerGlobalSongData.title = title; 264 $.qtMplayerGlobalSongData.artist = artist; 265 $.qtmplayerRadioFeedObj.fn.updateMediaData(); 266 267 } else { 268 $(".qtmplayer-feed").hide(); 269 } 270 return; 271 }, 272 newFeedReading: function(){ 273 274 275 // debug: fix title not changing after pause 276 277 $.qtmplayerRadioFeedObj.fn.log('newFeedReading = REITERATE - '+$.now()); 278 // console.log( $.qtmplayerRadioFeedObj.qtFeedData ); 279 var o = $.qtmplayerRadioFeedObj, 280 fd = o.qtFeedData, 281 callBack = fd.callBack, 282 fn = o.fn, 283 qtradiofeedHost = (undefined !== fd.host) ? fd.host : '', 284 qtradiofeedPort = (undefined !== fd.port) ? fd.port : '', 285 qtradiofeedProtocol = (undefined !== fd.protocol) ? fd.protocol : 'http', 286 theChannel = (undefined !== fd.channel) ? fd.channel : '', 287 qticecasturl = (undefined !== fd.icecasturl) ? fd.icecasturl : '', 288 qticecastmountpoint = (undefined !== fd.icecastmountpoint) ? fd.icecastmountpoint : '', 289 qticecastchannel = (undefined !== fd.icecastchannel) ? fd.icecastchannel : '', 290 qtradiodotco = (undefined !== fd.radiodotco) ? fd.radiodotco : '', 291 qtairtime = (undefined !== fd.airtime) ? fd.airtime : '', 292 qtradionomy = (undefined !== fd.radionomy) ? fd.radionomy : '', 293 qttextfeed = (undefined !== fd.textfeed) ? fd.textfeed : '', 294 qtUseProxy = (undefined !== fd.useproxy) ? fd.useproxy : '', 295 qtlive365 = (undefined !== fd.live365) ? fd.live365 : '', 296 qtradioking = (undefined !== fd.radioking) ? fd.radioking : '', 297 qtazuracast = (undefined !== fd.azuracast) ? fd.azuracast : '', 298 qtsecuresystems = (undefined !== fd.securesystems) ? fd.securesystems : '', 299 qtradiojar = (undefined !== fd.radiojar) ? fd.radiojar : '', 300 qtradioboss = (undefined !== fd.radioboss) ? fd.radioboss : '', 301 qtmaxcast = (undefined !== fd.maxcast) ? fd.maxcast : '', 302 qtsonicpanel = (undefined !== fd.sonicpanel) ? fd.sonicpanel : '', 303 qtsonicpaneldj = (undefined !== fd.sonicpaneldj) ? fd.sonicpaneldj : '', 304 qtjazler = (undefined !== fd.jazler) ? fd.jazler : '', 305 qteverestcast = (undefined !== fd.everestcast) ? fd.everestcast : '', 306 qtstreamerr = (undefined !== fd.streamerr) ? fd.streamerr : '', 307 qtstreamguys_api = (undefined !== fd.streamguys_api) ? fd.streamguys_api : '', 308 qtstreamguys_uuid = (undefined !== fd.streamguys_uuid) ? fd.streamguys_uuid : '', 309 qtradiocult = (undefined !== fd.radiocult) ? fd.radiocult : '', 310 qtFeedPlayerTrack = $('#qtFeedPlayerTrack'), 311 qtFeedPlayerAuthor = $('#qtFeedPlayerAuthor'), 312 qtPlayerTrackInfo = $("#qtPlayerTrackInfo"), 313 author, title, result, feedsplit; 314 o = $.qtmplayerRadioFeedObj; 315 var proxyURL = $("#qtmplayer-radiofeed-proxyurl").data('proxyurl'); 316 var timestamp = new Date().getUTCMilliseconds(); 317 var listener_peak = false;
318 var listeners = false; 319 /** 320 * =================================================================== 321 * 322 * RadioCult 323 * 324 * =================================================================== 325 */ 326 if( fd.servertype == 'type-radiocult' && qtradiocult ){ 327 // if(qtUseProxy){ 328 qtradiocult = proxyURL+'?qtproxycall='+window.btoa(qtradiocult); //REQUIRED 329 // } 330 $.ajax({ 331 type: 'GET', 332 cache: false, 333 url: qtradiocult, 334 async: true, 335 jsonp: true, 336 success: function(data) { 337 if('object' !== typeof( data )){ 338 data = JSON.parse(data); 339 } 340 if(!data.result.metadata){ 341 fn.log("Missing data for Radiocult song title"); 342 return; 343 } 344 title = data.result.metadata.title; 345 346 if(data.result.metadata.artist ){ 347 title = title +' - ' + data.result.metadata.artist; 348 } 349 if( 'undefined' !== typeof(data.result.metadata.artwork) && data.result.metadata.artwork && 'function' === typeof(callBack) ){ 350 if( 'undefined' !== typeof(data.result.metadata.artwork.original ) ){ 351 if( data.result.metadata.artwork.original ){ 352 var img = data.result.metadata.artwork.original; 353 $.qtMplayerGlobalSongData.thumbnail = img; 354 callBack( img ); 355 callBack = false; 356 } 357 } 358 } 359 fn.qtApplyTitle(title, callBack); 360 }, 361 error: function(e){ 362 console.log('Streamguys feed not loaded - error ahead:'); 363 console.log(e); 364 } 365 }); 366 return; 367 } 368 /** 369 * =================================================================== 370 * 371 * SteamGuys 372 * 373 * =================================================================== 374 */ 375 if( fd.servertype == 'type-streamguys' && qtstreamguys_api && qtstreamguys_uuid ){ 376 var apiurl = 'https://jetapi.streamguys.com/'+qtstreamguys_api+'/scraper/'+qtstreamguys_uuid+'/metadata/raw/'; 377 378 if(qtUseProxy){ 379 apiurl = proxyURL+'?qtproxycall='+window.btoa(apiurl); 380 } 381 $.ajax({ 382 type: 'GET', 383 cache: false, 384 url: apiurl, 385 async: true, 386 jsonp: true, 387 success: function(text) { 388 if(text == '{"error":"API Key not found."}'){ 389 return; 390 } 391 // Regular expression to match the StreamTitle value 392 var match = text.match(/StreamTitle='(.*?)'/); 393 var title = match ? match[1] : ""; 394 fn.qtApplyTitle(title, callBack); 395 }, 396 error: function(e){ 397 console.log('Streamguys feed not loaded - error ahead:'); 398 console.log(e); 399 } 400 }); 401 return; 402 } 403 404 /** 405 * =================================================================== 406 * 407 * EverestCast 408 * 409 * =================================================================== 410 */ 411 if( fd.servertype == 'type-everestcast' ){ 412 fn.log(qteverestcast); 413 if(qtUseProxy){ 414 qteverestcast = proxyURL+'?qtproxycall='+window.btoa(qteverestcast); 415 } 416 $.ajax({ 417 type: 'GET', 418 cache: false, 419 url: qteverestcast, 420 async: true, 421 jsonp: true, 422 success: function(data) { 423 if('object' !== typeof( data )){ 424 data = JSON.parse(data); 425 } 426 427 if(!data.current_track.title){ 428 fn.log("Missing data for Everestcast song title"); 429 return; 430 } 431 title = data.current_track.title; 432 if(data.current_track.image && 'function' === typeof(callBack)){ 433 434 $.qtMplayerGlobalSongData.thumbnail = data.current_track.image; 435 callBack( data.current_track.image ); 436 callBack = false; 437 } 438 fn.qtApplyTitle(title, callBack); 439 }, 440 error: function(e){ 441 console.log('MediaCP feed not loaded - error ahead:'); 442 console.log(e); 443 } 444 }); 445 return; 446 } 447 448 449 /** 450 * =================================================================== 451 * 452 * MediaCP 453 * 454 * =================================================================== 455 */ 456 if( fd.servertype == 'type-mediacp' ){ 457 fn.log(qtmediacp); 458 if(qtUseProxy){ 459 qtmediacp = proxyURL+'?qtproxycall='+window.btoa(qtmediacp); 460 } 461 $.ajax({ 462 type: 'GET', 463 cache: false, 464 url: qtmediacp, 465 async: true, 466 jsonp: true, 467 success: function(data) { 468 if('object' !== typeof( data )){ 469 data = JSON.parse(data); 470 } 471 fn.log(data); 472 title = data.nowplaying; 473 if(data.coverart && 'function' === typeof(callBack)){ 474 $.qtMplayerGlobalSongData.thumbnail = data.coverart; 475 callBack( data.coverart ); 476 477 callBack = false;
478 } 479 fn.qtApplyTitle(title, callBack); 480 }, 481 error: function(e){ 482 console.log('MediaCP feed not loaded - error ahead:'); 483 console.log(e); 484 } 485 }); 486 return; 487 } 488 489 490 491 /** 492 * =================================================================== 493 * 494 * Streamerr 495 * 496 * =================================================================== 497 */ 498 if( fd.servertype == 'type-streamerr' ){ 499 fn.log(qtstreamerr); 500 if(qtUseProxy){ 501 qtstreamerr = proxyURL+'?qtproxycall='+window.btoa(qtstreamerr); 502 } 503 $.ajax({ 504 type: 'GET', 505 cache: false, 506 url: qtstreamerr, 507 async: true, 508 jsonp: true, 509 success: function(data) { 510 511 if('object' !== typeof( data )){ 512 data = JSON.parse(data); 513 } 514 515 fn.log(data); 516 title = data.nowplaying; 517 if(data.coverart && 'function' === typeof(callBack)){ 518 $.qtMplayerGlobalSongData.thumbnail = data.coverart; 519 callBack( data.coverart ); 520 521 callBack = false; 522 } 523 fn.qtApplyTitle(title, callBack); 524 }, 525 error: function(e){ 526 console.log('Streamerr not working - error ahead:'); 527 console.log(e); 528 } 529 }); 530 return; 531 } 532 533 534 535 /** 536 * =================================================================== 537 * 538 * sonicpanel 539 * 540 * =================================================================== 541 */ 542 if( fd.servertype == 'type-sonicpanel' ){ 543 if( qtsonicpanel !== ''){ 544 if ( qtsonicpanel.indexOf("?") > -1 ) { 545 qtsonicpanel = qtsonicpanel + '&rand='+timestamp; 546 } else { 547 qtsonicpanel = qtsonicpanel + '?rand='+timestamp; 548 } 549 if(qtUseProxy){ 550 qtsonicpanel = proxyURL+'?qtproxycall='+window.btoa(qtsonicpanel); 551 } 552 $.ajax({ 553 type: 'GET', 554 cache: false, 555 url: qtsonicpanel, 556 async: true, 557 success: function(data) { 558 if('object' !== typeof( data )){ 559 data = JSON.parse(data); 560 } 561 var titles = 'Now live - Streaming'; 562 if(data.title){ 563 titles = data.title; 564 if(data.artist){ 565 titles = data.artist+' - '+data.title; 566 } 567 } 568 if(data.art && 'function' === typeof(callBack)){ 569 if(data.title){ 570 data.art = data.art + '?title=' + data.title.toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g, ''); 571 } 572 $.qtMplayerGlobalSongData.thumbnail = data.art; 573 callBack(data.art); 574 575 callBack = false; 576 } 577 if(data.thumb && 'function' === typeof(callBack)){ 578 $.qtMplayerGlobalSongData.thumbnail = data.thumb+'#.jpg'; 579 callBack(data.thumb+'#.jpg'); 580 581 callBack = false; 582 } 583 if( '1' == qtsonicpaneldj && data.djusername !== 'No DJ'){ 584 titles = data.title.split(' - ').join(' / ')+' - '+data.djusername; 585 } 586 if(data.listn){ 587 listeners = data.listn; 588 } 589 if(data.peaklistn){ 590 listener_peak = data.peaklistn; 591 } 592 fn.qtApplyListeners(listeners, listener_peak); 593 fn.qtApplyTitle(titles, callBack); 594 }, 595 error: function(e){ 596 console.log(e); 597 } 598 }); 599 } 600 } 601 602 603 /** 604 * =================================================================== 605 * 606 * qtjazler 607 * 608 * =================================================================== 609 */ 610 if( fd.servertype == 'type-jazler' ){ 611 var qtjazlerFolder = qtjazler.split('NowOnAir.xml').join('AlbumsCache/'); 612 if(qtUseProxy){ 613 qtjazler = proxyURL+'?qtproxycall='+window.btoa(qtjazler); 614 } 615 fn.log('=============================================================='); 616 fn.log(qtjazler); 617 $.ajax({ 618 type: "GET", 619 url:qtjazler, 620 dataType: "xml", 621 async: true, 622 cache: false, 623 success: function(xml) { 624 fn.log(xml); 625 $(xml).find('Event').each(function(){ 626 fn.log($(this)); 627 var CacheImageFile = $(this).find('CacheImageFile').html(); 628 $(this).find('Announcement').each(function(){ 629 var title = $(this).attr('Display'); 630 fn.log(title); 631 if(CacheImageFile && 'function' === typeof(callBack) ){ 632 fn.log(qtjazlerFolder + CacheImageFile); 633 634 $.qtMplayerGlobalSongData.thumbnail = qtjazlerFolder + CacheImageFile; 635 callBack( qtjazlerFolder + CacheImageFile ); 636 callBack = false;
637 } 638 fn.qtApplyTitle(title , callBack); 639 }); 640 641 }); 642 }, 643 error: function(e){ 644 console.log('Jazler source unreachable - please check your channel settings'); 645 console.log(e); 646 } 647 }); 648 return; 649 } 650 651 652 /** 653 * =================================================================== 654 * 655 * laut.FM 656 * 657 * =================================================================== 658 */ 659 if( fd.servertype == 'type-lautfm' ){ 660 fn.log('Server type: LAUT.FM'); 661 fn.log('Stream URL: '+fd.file); 662 if( fd.file.indexOf('/stream.laut.fm/') != -1 ){ 663 fn.log('Laut.FM reading titles'); 664 var radioname = fd.file.split('https').join('http').split('http://stream.laut.fm/').join(''); 665 var radiourl = 'https://api.laut.fm/station/'+radioname+'/current_song'; 666 // if ( radiourl.indexOf("?") > -1 ) { 667 // radiourl = radiourl + '&rand='+timestamp; 668 // } else { 669 // radiourl = radiourl + '?rand='+timestamp; 670 // } 671 if(qtUseProxy){ 672 radiourl = proxyURL+'/?qtproxycall='+window.btoa(radiourl); 673 } 674 // console.log(radiourl); 675 $.ajax({ 676 type: 'GET', 677 url: radiourl, 678 async: true, 679 cache: false, 680 success: function(data) { 681 fn.log('Laut.FM Success'); 682 if('object' !== typeof( data )){ 683 data = JSON.parse(data); 684 } 685 var titles = 'Now live - Streaming'; 686 687 if(data.type){ 688 if(data.type !== 'jingle'){ 689 if(data.title){ 690 titles = data.title; 691 if(data.artist){ 692 if(data.artist.name){ 693 titles = data.artist.name +' - '+ titles; 694 } 695 } 696 } 697 fn.qtApplyTitle( titles, callBack ); 698 } 699 } 700 701 }, 702 error: function(e){ 703 fn.log(e); 704 console.log(e); 705 fn.qtApplyTitle('Laut FM API error - Titles not available'); 706 } 707 }); 708 } 709 return; 710 } // IF servertype end 711 712 713 714 if( fd.servertype === 'type-icy' ){ 715 716 717 fn.log('type-icy'); 718 fn.log( proxyURL+"?qtproxycall="+ window.btoa(fd.file) + '&icymetadata=1' ); 719 $.ajax({ 720 type: 'GET', 721 url: proxyURL, 722 jsonpCallback: 'parseMusic', 723 async: true, 724 cache: false, 725 data: { "qtproxycall": window.btoa(fd.file), 'icymetadata': '1' }, 726 success: function(data) { 727 if(data === 'Song title unavailable' || data === 'Cannot open the stream' ){ 728 fn.log('ERROR OPENING THE STREAM OR GETTING THE TITLES: '+data); 729 fn.qtApplyTitle( $.qtmplayerRadioFeedObj.qtFeedData.title, false ); 730 callBack( $.qtmplayerRadioFeedObj.qtFeedData.cover ); 731 return; 732 } 733 fn.qtApplyTitle( data, callBack ); 734 fn.log(data); 735 }, 736 error: function(e){ 737 console.log('Error'); 738 fn.log(e); 739 console.log(e); 740 } 741 }); 742 } 743 744 745 746 /** 747 * =================================================================== 748 * 749 * Auto or HTTPS shoutcast 750 * 751 * =================================================================== 752 */ 753 if( fd.servertype == 'type-auto' ){ 754 if(fd.file.indexOf('/proxy/') != -1 && fd.file.indexOf('https') != -1 && fd.file.indexOf('?mp=/') != -1){ 755 fn.log('type-auto TYPE 1 - GET MOUNTPOINT'); 756 757 qtradiofeedHost = fd.file.split('?mp=/'); 758 qtradiofeedHost = qtradiofeedHost[0] + '?mp=/stats' + '&rand='+timestamp; 759 if(qtUseProxy){ 760 qtradiofeedHost = proxyURL+'?qtproxycall='+window.btoa(qtradiofeedHost); 761 } 762 $.ajax({ 763 type: 'GET', 764 url: qtradiofeedHost, 765 async: true, 766 cache: false, 767 dataType: "xml", 768 success: function(data) { 769 770 771 fn.qtApplyTitle( $(data).find('SONGTITLE').html() , callBack); 772 773 // Listeners ====================================== 774 if($(data).find('CURRENTLISTENERS')){ 775 listeners = $(data).find('CURRENTLISTENERS').html(); 776 } 777 if($(data).find('PEAKLISTENERS')){ 778 listener_peak = $(data).find('PEAKLISTENERS').html(); 779 } 780 fn.qtApplyListeners(listeners, listener_peak); 781 782 }, 783 error: function(e){ 784 fn.log(e); 785 console.log(e); 786 } 787 }); 788 } else if(fd.file.indexOf('/proxy/') == -1 && fd.file.indexOf('https') != -1 && fd.file.endsWith('/stream') && fd.file.indexOf('/mp3') == -1 ){ 789 790 fn.log('type-auto TYPE 2 - XML:'+fd.file.endsWith('/stream')+'? ----> '+fd.file); 791 792 793 794 // OLD system 795 // qtradiofeedHost = fd.file.split('/stream'); 796 // qtradiofeedHost = qtradiofeedHost[0] + '/stats'; // no random here
797 // NEW - replace only the last occurrence of /stream 798 qtradiofeedHost = fd.file.replace(/\/stream$/, '/stats','$1');// fd.file.split('/stream').join('/stats'); 799 800 801 fn.log('Stats link: <a href="'+qtradiofeedHost+'">'+qtradiofeedHost+'</a>'); 802 803 if(qtUseProxy){ 804 qtradiofeedHost = proxyURL+'?qtproxycall='+window.btoa(qtradiofeedHost); 805 } 806 fn.log('Proxy stats link: <a href="'+qtradiofeedHost+'">'+qtradiofeedHost+'</a>'); 807 $.ajax({ 808 type: 'GET', 809 url: qtradiofeedHost, 810 async: true, 811 //cache: false, 812 //dataType: "xml", 813 success: function(data) { 814 815 816 if(data === 'Song title unavailable' ){ 817 fn.qtApplyTitle( $.qtmplayerRadioFeedObj.qtFeedData.title , false); 818 callBack( $.qtmplayerRadioFeedObj.qtFeedData.cover ); 819 return; 820 } 821 822 823 fn.qtApplyTitle( $(data).find('SONGTITLE').html() , callBack); 824 825 826 // Listeners ====================================== 827 if($(data).find('CURRENTLISTENERS')){ 828 listeners = $(data).find('CURRENTLISTENERS').html(); 829 } 830 if($(data).find('PEAKLISTENERS')){ 831 listener_peak = $(data).find('PEAKLISTENERS').html(); 832 } 833 fn.qtApplyListeners(listeners, listener_peak); 834 835 }, 836 error: function(e){ 837 fn.log(e); 838 console.log(e); 839 } 840 }); 841 842 } else { 843 fn.log('type-auto TYPE 3 ICY METADATA'); 844 845 846 fn.log( proxyURL+"?qtproxycall="+ window.btoa(fd.file) + '&icymetadata=1' ); 847 $.ajax({ 848 type: 'GET', 849 url: proxyURL, 850 jsonpCallback: 'parseMusic', 851 async: true, 852 cache: false, 853 data: { "qtproxycall": window.btoa(fd.file), 'icymetadata': '1' }, 854 success: function(data) { 855 if(data === 'Song title unavailable' ){ 856 fn.qtApplyTitle( $.qtmplayerRadioFeedObj.qtFeedData.title, false ); 857 callBack( $.qtmplayerRadioFeedObj.qtFeedData.cover ); 858 return; 859 } 860 fn.qtApplyTitle( data, callBack ); 861 fn.log(data); 862 } 863 }); 864 865 } 866 return; 867 } 868 869 /** 870 * Maxcast 871 */ 872 /** 873 * =================================================================== 874 * 875 * Maxcast 876 * 877 * =================================================================== 878 */ 879 // Demo feeds: 880 //https://s05.maxcast.com.br/api/status/brasitaliawebradio/current.json 881 //https://s16.maxcast.com.br/api/status/bocadoacreatualjt/current.json 882 if( fd.servertype == 'type-maxcast' ){ 883 fn.log('Maxcast '+ qtmaxcast); 884 qtmaxcast = qtmaxcast + '?rand='+timestamp; 885 if(qtUseProxy){ 886 qtmaxcast = proxyURL+'?qtproxycall='+window.btoa(qtmaxcast); // working without proxy. Leave here just in case 887 } 888 $.ajax({ 889 type: 'GET', 890 cache: false, 891 url: qtmaxcast, 892 async: true, 893 jsonpCallback: "parseMusic", 894 jsonp: false, 895 data: songdata, 896 success: function(data) { 897 if('object' !== typeof(data)){ 898 data = JSON.parse(data); 899 } 900 if(data.playing){ 901 title = data.playing.current; 902 } 903 if(data.song_data && 'function' === typeof(callBack)){ 904 905 $.qtMplayerGlobalSongData.thumbnail = data.song_data.cover; 906 callBack( data.song_data.cover ); 907 callBack = false; 908 } 909 fn.qtApplyTitle(title, callBack); 910 }, 911 error: function(e){ 912 console.log(e); 913 } 914 }); 915 return; 916 } 917 918 if(qtradioboss === '' && qtsecuresystems === '' && qtradiojar === '' && qtradioking === '' && qtazuracast === '' && qttextfeed === '' && qtradionomy === '' && qtlive365 === '' && qtairtime === '' && (qtradiofeedHost === '' || qtradiofeedPort === '' || typeof(qtradiofeedHost) === 'undefined') && qticecasturl === '' && qtradiodotco === '') { 919 fn.qtApplyTitle(); 920 return; 921 } else { 922 923 924 925 926 927 /** 928 * =================================================================== 929 * 930 * Radioboss 931 * 932 * =================================================================== 933 */ 934 if( qtradioboss !== ''){ 935 qtradioboss = qtradioboss;// + '?rand='+timestamp; 936 fn.log(qtradioboss); 937 938 if(qtUseProxy){ 939 qtradioboss = proxyURL+'?qtproxycall='+window.btoa(qtradioboss); 940 } 941 942 // qtradioboss = proxyURL+'?qtproxycall='+window.btoa(qtradioboss); 943 $.ajax({ 944 type: 'GET', 945 cache: false, 946 url: qtradioboss, 947 async: true, 948 // contentType: "application/json", 949 // jsonp: true, 950 success: function(data) { 951 if('object' !== typeof( data )){ 952 data = JSON.parse(data); 953 } 954 title = data['nowplaying']; 955 fn.qtApplyTitle(title, callBack); 956 }, 957 error: function(e){ 958 console.log(e); 959 } 960 }); 961 return; 962 } 963 964 965 966 967 968 /** 969 * =================================================================== 970 * 971 * Radiojar 972 * 973 * =================================================================== 974 */ 975 if( qtradiojar !== ''){ 976 if ( qtradiojar.indexOf("?") > -1 ) { 977 qtradiojar = qtradiojar + '&rand='+timestamp; 978 } else { 979 qtradiojar = qtradiojar + '?rand='+timestamp; 980 } 981 if(qtUseProxy){ 982 qtradiojar = proxyURL+'?qtproxycall='+window.btoa(qtradiojar); 983 } 984 $.ajax({ 985 type: 'GET', 986 cache: false, 987 url: qtradiojar, 988 async: true, 989 success: function(data) { 990 if('object' !== typeof( data )){ 991 data = JSON.parse(data); 992 } 993 var titles = 'Now live - Streaming'; 994 if(data.title){ 995 titles = data.title; 996 if(data.artist){ 997 titles = data.artist+' - '+data.title; 998 } 999 } 1000 if(data.art && 'function' === typeof(callBack)){ 1001 if(data.title){ 1002 data.art = data.art + '?title=' + data.title.toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g, ''); 1003 } 1004 1005 $.qtMplayerGlobalSongData.thumbnail = data.art; 1006 callBack(data.art); 1007 callBack = false;
1008 } 1009 if(data.thumb && 'function' === typeof(callBack)){ 1010 1011 $.qtMplayerGlobalSongData.thumbnail = data.thumb+'#.jpg'; 1012 callBack(data.thumb+'#.jpg'); 1013 callBack = false; 1014 } 1015 fn.qtApplyTitle(titles, callBack); 1016 }, 1017 error: function(e){ 1018 console.log(e); 1019 } 1020 }); 1021 } 1022 1023 1024 1025 1026 /** 1027 * =================================================================== 1028 * 1029 * SecureSystems 1030 * 1031 * =================================================================== 1032 */ 1033 if( qtsecuresystems !== ''){ 1034 qtsecuresystems =qtsecuresystems; 1035 if(qtUseProxy){ 1036 qtsecuresystems = proxyURL+'?qtproxycall='+window.btoa(qtsecuresystems); 1037 } 1038 $.ajax({ 1039 type: 'GET', 1040 cache: false, 1041 url: qtsecuresystems, 1042 async: true, 1043 dataType: "xml", 1044 success: function(data) { 1045 if( $(data).find('cover').length > 0 ){ 1046 if($(data).find('cover').html() !== '' && 'function' === typeof(callBack)){ 1047 1048 $.qtMplayerGlobalSongData.thumbnail = $(data).find('cover').html(); 1049 callBack($(data).find('cover').html()); 1050 callBack = false; 1051 } 1052 } 1053 var title = $(data).find('title').html(); 1054 if( 'undefined' == typeof(title) || 'undefined' == title ){ 1055 title = $(data).find('name').html(); 1056 } 1057 fn.qtApplyTitle( $(data).find('artist').html()+ ' - ' +title , callBack); 1058 }, 1059 error: function(e){ 1060 console.log(e); 1061 } 1062 }); 1063 return; 1064 } 1065 1066 1067 1068 1069 1070 /** 1071 * =================================================================== 1072 * 1073 * qtlive365 1074 * 1075 * =================================================================== 1076 */ 1077 if( qtlive365 !== ''){ 1078 qtlive365 = 'https://api.live365.com/station/'+qtlive365; 1079 if(qtUseProxy){ 1080 qtlive365 = proxyURL+'?qtproxycall='+window.btoa(qtlive365); 1081 } 1082 1083 $.ajax({ 1084 type: 'GET', 1085 cache: false, 1086 url: qtlive365, 1087 async: true, 1088 jsonpCallback: "parseMusic", 1089 jsonp: false, 1090 success: function(data) { 1091 // console.log(data); 1092 jsondata = data; 1093 // console.log(json); 1094 if('object' !== typeof( data )){ 1095 data = JSON.parse(data); 1096 } 1097 if( data['current-track'].art ){ 1098 var art = data['current-track'].art; 1099 if( art != ''){ 1100 1101 // console.log(art); 1102 $.qtMplayerGlobalSongData.thumbnail = art; 1103 callBack(art); 1104 callBack = false; 1105 } 1106 } 1107 fn.qtApplyTitle(data['current-track'].artist+' - '+data['current-track'].title, callBack); 1108 }, 1109 error: function(e){ 1110 console.log(e); 1111 } 1112 }); 1113 } 1114 1115 /** 1116 * =================================================================== 1117 * 1118 * Text 1119 * 1120 * =================================================================== 1121 */ 1122 else if(qttextfeed !== ''){ 1123 var tfeedurl,jsondata, title, proxyURL, mydata; 1124 if(qtUseProxy){ 1125 tfeedurl = $("#qtmplayer-radiofeed-proxyurl").data('proxyurl'); 1126 mydata = { 1127 "qtproxycall": window.btoa(qttextfeed), 1128 }; 1129 } else { 1130 tfeedurl = qttextfeed; 1131 } 1132 $.ajax({ 1133 type: 'GET', 1134 cache: false, 1135 url: tfeedurl, 1136 async: true, 1137 data: mydata, 1138 dataType: "html", 1139 success: function(data) { 1140 fn.qtApplyTitle( data, callBack ); 1141 }, 1142 error: function(e){ 1143 console.log(e); 1144 } 1145 }); 1146 return; 1147 } 1148 /** 1149 * =================================================================== 1150 * 1151 * Radionomy 1152 * 1153 * =================================================================== 1154 */ 1155 else if(qtradionomy !== '' ) { 1156 $.ajax({ 1157 type: 'GET', 1158 url: qtradionomy, 1159 async: true, 1160 cache: false, 1161 dataType: "xml", 1162 success: function(data) { 1163 fn.qtApplyTitle( $(data).find('artists').html()+ ' - ' + $(data).find('title').html() ); 1164 }, 1165 error: function(e){ 1166 console.log(e); 1167 } 1168 }); 1169 } 1170 1171 /** 1172 * =================================================================== 1173 * 1174 * AirTime 1175 * 1176 * =================================================================== 1177 */ 1178 else if(qtairtime !== '' && qtairtime !== 'undefined' && qtairtime !== undefined && typeof(qtairtime) !== 'undefined'){ 1179 var jsondata, title; 1180 $.ajax({ 1181 type: 'GET', 1182 cache: false, 1183 url: qtairtime,//proxyURL, 1184 async: true, 1185 data: { 1186 "qtproxycall": window.btoa(qtairtime), 1187 }, 1188 jsonpCallback: "parseMusic", 1189 jsonp: true,//jsonp: true, 1190 // contentType: "application/json", 1191 success: function(data) { 1192 // console.log(data); 1193 if(typeof(data) !== 'object'){ 1194 data = JSON.parse(data); 1195 } 1196 title = data.tracks.current.name; 1197 fn.qtApplyTitle(title); 1198 }, 1199 error: function(e) { 1200 } 1201 }); 1202 } 1203 1204 /** 1205 * =================================================================== 1206 * 1207 * Icecast 1208 * 1209 * =================================================================== 1210 */ 1211 else if(qticecasturl !== '' && typeof(qticecasturl) !== 'undefined') { 1212 var feedurl = qticecasturl; 1213 var source; 1214 var title; 1215 var songdata; 1216 var listeners = false;
1217 var listener_peak = false; 1218 if(qtUseProxy){ 1219 feedurl = proxyURL; 1220 songdata = { 1221 "qtproxycall": window.btoa(qticecasturl), 1222 }; 1223 } 1224 // beta 1225 fn.log('Radio feed - Icecast '+ qticecasturl); 1226 // generally ok, not working for LN Soulr Icecast 1227 // console.log( proxyURL+'?qtproxycall='+window.btoa(qticecasturl) ); 1228 $.ajax({ 1229 type: 'GET', 1230 cache: false, 1231 url: feedurl, 1232 async: true, 1233 jsonpCallback: "parseMusic", 1234 jsonp: false,//jsonp: true, 1235 // dataType: 'jsonp', // not working with some radios 1236 data: songdata, 1237 // contentType: "application/json", 1238 success: function(json) { 1239 fn.log('Ajax response'); 1240 fn.log( json ); 1241 1242 // console.log(json); 1243 if('object' !== typeof( json )){ 1244 json = JSON.parse(json); 1245 } 1246 if('undefined' === typeof(json.icestats)){ 1247 // This is Icecast HK 1248 1249 if(qticecastmountpoint){ 1250 source = json[qticecastmountpoint]; 1251 } else { 1252 1253 $.each(json, function(index, element) { 1254 source = element; 1255 if(index == 0){ 1256 source = element; 1257 } 1258 }); 1259 // console.log(source); 1260 } 1261 } else { 1262 source = json.icestats.source; 1263 } 1264 1265 if('undefined' === typeof(source)){ 1266 return; 1267 } 1268 if(qticecastmountpoint){ 1269 source = source[qticecastmountpoint]; 1270 } 1271 if(qticecastchannel){ 1272 // console.log("set source to 0"); 1273 source = source[qticecastchannel]; 1274 } 1275 // since PR.3.2.3 1276 // If there is no channel and there is no title, channel must be 0 1277 if(!qticecastchannel && 'undefined' === typeof(source.title)){ 1278 source = source[0]; 1279 } 1280 title = source.title; 1281 if( source.artist ){ 1282 title = title + ' - ' + source.artist; 1283 } 1284 fn.qtApplyTitle(title, callBack); 1285 // Listeners ====================================== 1286 if(source.listeners){ 1287 listeners = source.listeners; 1288 } 1289 if(source.listener_peak){ 1290 listener_peak = source.listener_peak; 1291 } 1292 fn.qtApplyListeners(listeners, listener_peak); 1293 1294 },error: function(e) { 1295 console.log(e); 1296 fn.log('Ajax response'); 1297 fn.log( e ); 1298 } 1299 }); 1300 } 1301 /** 1302 * =================================================================== 1303 * 1304 * ShoutCast 1305 * 1306 * =================================================================== 1307 */ 1308 else if (qtradiofeedHost !== '' && qtradiofeedPort !== '' && typeof(qtradiofeedHost) !== 'undefined'){ 1309 // to tide up 1310 var feedData = { 1311 shoutcast_host: qtradiofeedHost, 1312 shoutcast_port: qtradiofeedPort, 1313 shoutcast_protocol: qtradiofeedProtocol, 1314 shoutcast_channel: theChannel 1315 }; 1316 var channel = feedData.shoutcast_channel || 1; 1317 var protocol = 'http'; 1318 if(feedData.shoutcast_port === '443' || feedData.shoutcast_protocol === 'https' ){ 1319 protocol = 'https'; 1320 } 1321 var shoutcastUrl = protocol+'://'+feedData.shoutcast_host+':'+feedData.shoutcast_port+'/stats?sid='+channel+'&json=1'; 1322 var feedurl = shoutcastUrl; 1323 1324 if(qtUseProxy){ 1325 feedurl = proxyURL; 1326 songdata = { 1327 "qtproxycall": window.btoa(shoutcastUrl), 1328 }; 1329 } 1330 1331 /** 1332 * @since PR.3.4.6 2021 02 27 added fallback 1333 */ 1334 try{ 1335 1336 $.ajax({ 1337 type: 'GET', 1338 cache: false, 1339 url: feedurl, 1340 async: true, 1341 data: songdata, 1342 dataType: $.qtmplayerRadioFeedObj.qtFeedData.dataType, 1343 contentType: "application/json", 1344 success: function(json) { 1345 if('object' !== typeof( json )){ 1346 json = JSON.parse(json); 1347 } 1348 fn.qtApplyTitle( json.songtitle, callBack); 1349 // Listeners ====================================== 1350 if(json.currentlisteners){ 1351 listeners = json.currentlisteners; 1352 } 1353 if(json.peaklisteners){ 1354 listener_peak = json.peaklisteners; 1355 } 1356 fn.qtApplyListeners(listeners, listener_peak); 1357 },error: function(e) { 1358 if($.qtmplayerRadioFeedObj.qtFeedData.dataType !== 'jsonp'){ 1359 $.qtmplayerRadioFeedObj.qtFeedData.dataType = 'jsonp'; 1360 $.qtmplayerRadioFeedObj.fn.newFeedReading(); 1361 } 1362 } 1363 }); 1364 } catch(e){ 1365 dataType = 'jsonp'; 1366 console.log(e); 1367 } 1368 1369 return; 1370 } 1371 /** 1372 * =================================================================== 1373 * 1374 * Radio.co 1375 * 1376 * =================================================================== 1377 */ 1378 else if (qtradiodotco !== '' && typeof(qtradiodotco) !== 'undefined'){ 1379 var rUrl = 'https://public.radio.co/stations/'+qtradiodotco+'/status' 1380 $.ajax({ 1381 type: 'GET', 1382 cache: false, 1383 url: rUrl, 1384 async: true, 1385 contentType: "application/json", 1386 success: function(data) { 1387 if( data['current_track'] ){ 1388 title = data['current_track']['title']; 1389 fn.log( 'Radio.co artwork: '+ data['current_track']['artwork_url_large'] ); 1390 if( data['current_track']['artwork_url_large'] && 'function' === typeof(callBack) ){ 1391 var art = data['current_track']['artwork_url_large']; 1392 if( art !== ''){ 1393 1394 $.qtMplayerGlobalSongData.thumbnail = art; 1395 callBack( art ); 1396 callBack = false;
1397 } 1398 } 1399 } else { 1400 title = 'Song title currently unavailable - Please check your radio settings'; 1401 } 1402 fn.qtApplyTitle(title, callBack); 1403 }, 1404 error: function(e) { 1405 } 1406 }); 1407 } 1408 /** 1409 * =================================================================== 1410 * 1411 * Radioking 1412 * 1413 * =================================================================== 1414 */ 1415 else if (fd.servertype == 'type-radioking' && qtradioking !== '' ){ 1416 var rUrl = 'https://api.radioking.io/widget/radio/'+qtradioking+'/track/current'; 1417 $.ajax({ 1418 type: 'GET', 1419 cache: false, 1420 url: rUrl, 1421 async: true, 1422 contentType: "application/json", 1423 success: function(data) { 1424 title = data.artist+' - '+data.title; 1425 if(data.cover && 'function' === typeof(callBack)){ 1426 1427 $.qtMplayerGlobalSongData.thumbnail = data.cover; 1428 callBack(data.cover); 1429 callBack = false; 1430 } 1431 fn.qtApplyTitle(title, callBack); 1432 }, 1433 error: function(e) { 1434 console.log(e); 1435 } 1436 }); 1437 } 1438 /** 1439 * =================================================================== 1440 * 1441 * Azuracast 1442 * 1443 * =================================================================== 1444 */ 1445 else if (fd.servertype == 'type-azuracast' && qtazuracast !== '' ){ 1446 var rUrl = ''; 1447 var feedurl = qtazuracast + '?rand='+timestamp; 1448 1449 if(qtUseProxy){ 1450 feedurl = proxyURL+'?qtproxycall='+window.btoa(qtazuracast); 1451 } 1452 $.ajax({ 1453 type: 'GET', 1454 cache: false, 1455 url: feedurl, 1456 async: true, 1457 contentType: "application/json", 1458 success: function(data) { 1459 if("string" == typeof(data)){ 1460 data = jQuery.parseJSON( data ); 1461 } 1462 if( 'undefined' === typeof( data.now_playing ) ){ 1463 data = data[0]; 1464 } 1465 author = data.now_playing.song.artist; 1466 title = data.now_playing.song.title; 1467 if('' !== author){ 1468 title = author+' - '+title; 1469 } 1470 if(data.now_playing.song.cover && 'function' === typeof(callBack)){ 1471 $.qtMplayerGlobalSongData.thumbnail = data.now_playing.song.cover; 1472 callBack(data.now_playing.song.cover); 1473 1474 callBack = false; 1475 } 1476 if(data.now_playing.song.art && 'function' === typeof(callBack)){ 1477 // console.log(data.now_playing.song.art); 1478 $.qtMplayerGlobalSongData.thumbnail = data.now_playing.song.art; 1479 callBack(data.now_playing.song.art); 1480 1481 callBack = false; 1482 } 1483 1484 if(data.cover && 'function' === typeof(callBack)){ 1485 $.qtMplayerGlobalSongData.thumbnail = data.cover; 1486 callBack(data.cover); 1487 1488 callBack = false; 1489 } 1490 if(data.art && 'function' === typeof(callBack)){ 1491 $.qtMplayerGlobalSongData.thumbnail = data.art; 1492 callBack(data.art); 1493 1494 callBack = false; 1495 } 1496 1497 // Listeners ====================================== 1498 if(data.listeners){ 1499 if(data.listeners.current){ 1500 listeners = data.listeners.current; 1501 } 1502 if(data.listeners.total){ 1503 listener_peak = data.listeners.total; 1504 } 1505 1506 fn.qtApplyListeners(listeners, listener_peak); 1507 } 1508 1509 1510 fn.qtApplyTitle(title, callBack); 1511 }, 1512 error: function(e) { 1513 console.log(e); 1514 1515 } 1516 }); 1517 } 1518 } 1519 return; 1520 }, 1521 feedInterval: null, 1522 stopFeed: function(){ 1523 var o = $.qtmplayerRadioFeedObj; 1524 if("undefined" !== typeof($.qtmplayerRadioFeedObj.fn.qtFeedInterval) ){ 1525 clearInterval($.qtmplayerRadioFeedObj.fn.qtFeedInterval); 1526 } 1527 1528 }, 1529 pushFeed: function( data ){ 1530 1531 var o = $.qtmplayerRadioFeedObj; 1532 o.qtFeedData = data; 1533 o.fn.log('pushFeed = INITIALIZE'+$.now()); 1534 o.fn.log(data); 1535 o.fn.stopFeed(); 1536 o.fn.newFeedReading(); 1537 o.fn.qtApplyListeners(false,false); 1538 $.qtmplayerRadioFeedObj.qtFeedData.dataType = ''; 1539 $.qtmplayerRadioFeedObj.fn.qtFeedInterval = setInterval( 1540 function(){ 1541 o.fn.newFeedReading(); 1542 }, 1543 $.qtmplayerRadioFeedObj.timeInterval 1544 ); 1545 }, 1546 log:function(msg){ 1547 var c = $("#qtmPlayerDebugger"); 1548 if(c.length > 0){
1549 c.append(msg+'<br>'); 1550 } 1551 } 1552 } 1553 1554 }; 1555 $(document).ready(function(){ 1556 $.qtmplayerRadioFeedObj.fn.qtApplyTitle(); 1557 }); 1558})(jQuery); 1559 1560 1561 1562 1563
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.