1/*global $, jQuery, wpstream_start_streaming_vars*/ 2var counters={}; 3 4jQuery(document).ready(function ($) { 5 "use strict"; 6 7 wpstream_check_live_connections(); 8 wpestate_start_modal_actions(); 9 wpestate_start_modal_error_actions(); 10 wpstream_tooltip(); 11 wpstream_copy_to_clipboard(); 12 wpstream_webcaster_actions(); 13 wpstream_save_options_actions(); 14 wpstream_bind_start_and_stop(); 15 16 wpstream_bind_stats_link(); 17 wpstream_adjust_settings_general(); 18 19 20}); 21 22 23 24 25/* 26* 27* genereal settings - low latency vs bitrate vs encrypt 28* 29*/ 30 31 32function wpstream_adjust_settings_general(){ 33 34 jQuery('.theme_options_tab_wpstream .wpstream_slider').on('click',function(event){ 35 event.stopPropagation(); 36 var parent = jQuery(this).parent(); 37 var input_element = parent.find('.wpstream_event_option_item'); 38 var attr_value = input_element.attr('data-attr-ajaxname'); 39 40 41 if( attr_value === 'adaptive_bitrate' || attr_value==='low_latency'){ 42 43 var timer = setTimeout(function() { 44 45 if( jQuery('.wpstream-setting-adaptive_bitrate .wpstream_event_option_item').is(':checked') || 46 jQuery('.wpstream-setting-low_latency .wpstream_event_option_item').is(':checked') ){ 47 jQuery('.wpstream-setting-encrypt .wpstream_event_option_item') .removeAttr('checked'); 48 } 49 }, 300); 50 51 } 52 53 if( attr_value === 'encrypt'){ 54 var timer = setTimeout(function() { 55 56 if( jQuery('.wpstream-setting-encrypt .wpstream_event_option_item').is(':checked') ){ 57 jQuery('.wpstream-setting-low_latency .wpstream_event_option_item') .removeAttr('checked'); 58 jQuery('.wpstream-setting-adaptive_bitrate .wpstream_event_option_item') .removeAttr('checked'); 59 } 60 }, 300); 61 62 } 63 64 }); 65} 66 67 68 69 70 71 72 73 74 75 76/* 77* 78* Bind block stats link 79* 80*/ 81 82function wpstream_bind_stats_link(){ 83 84 jQuery('.wpstream_statistics_channel,.start_webcaster').each(function(event){ 85 var selected_icon = jQuery(this); 86 selected_icon.on('click',function(event){ 87 if(selected_icon.hasClass('wpstream_inactive_icon')){ 88 event.preventDefault(); 89 event.stopPropagation(); 90 } 91 92 }); 93 94 }) 95 96 97} 98 99 100 101 102/* 103*
104* Bind Start and Stop channel 105* 106*/ 107 108 109function wpstream_bind_start_and_stop(){ 110 111 jQuery('.start_event.wpstream_button').each(function(element){ 112 var start_button=jQuery(this); 113 wpstream_bind_start_event(start_button); 114 }); 115 116 117 jQuery('.wpstream_stop_event').each(function(element){ 118 var stop_button=jQuery(this); 119 wpstream_bind_stop_event(stop_button); 120 }); 121 122} 123 124 125/* 126* 127* Bind start channel action 128* 129*/ 130var start_onboarding=''; 131function wpstream_bind_start_event(button){ 132 133 button.click(function(event){ 134 event.preventDefault(); 135 button.unbind('click'); 136 var ajaxurl = wpstream_start_streaming_vars.admin_url + 'admin-ajax.php'; 137 var acesta = jQuery(this); 138 var notification_area = jQuery(this).parent().find('.event_list_unit_notification'); 139 var curent_content = jQuery(this).parent().find('.server_notification'); 140 var is_record = false; 141 var is_encrypt = false; 142 var show_id = parseFloat( jQuery(this).attr('data-show-id') ); 143 var nonce = jQuery('#wpstream_start_event_nonce').val(); 144 var parent = jQuery(this).parent(); 145 146 if( jQuery(this).parent().find('.record_event').is(":checked") ){ 147 is_record = true; 148 } 149 150 if( jQuery(this).parent().find('.encrypt_event').is(":checked") ){ 151 is_encrypt = true; 152 } 153 parent.find('.wpstream_show_settings').addClass('wpstream_inactive_icon'); 154 jQuery(this).addClass('wpstream_turning_on').empty().html(wpstream_start_streaming_vars.start_streaming_action+'<div class="wpstream_loader"></div><div class="wpstream_tooltip">'+wpstream_start_streaming_vars.turning_on_tooltip+'</div>'); 155 parent.find('.wpstream_channel_status').text(wpstream_start_streaming_vars.channel_turning_on); 156 157 jQuery.ajax({ 158 type: 'POST', 159 url: ajaxurl, 160 dataType: 'json', 161 timeout: 300000, 162 163 data: { 164 'action' : 'wpstream_give_me_live_uri', 165 'security' : nonce, 166 'show_id' : show_id, 167 'is_record' : is_record, 168 'is_encrypt' : is_encrypt, 169 'start_onboarding' : start_onboarding, 170 171 172 }, 173 success: function (data) { 174 175 176 177 if(data.conected===true){ 178 179 if(data.event_data==='err1'){ 180 181 wpstream_show_error_on_start(wpstream_start_streaming_vars.error1,parent) 182 183 }else if(data.event_data ==='failed event creation'){ 184 185 wpstream_show_error_on_start(wpstream_start_streaming_vars.failed_event_creation,parent) 186 187 }else{ 188 curent_content.empty(); 189 var counter = setInterval( function (){ 190 wpstream_check_live_connections_on_start(parent,show_id,data.event_data,data)},10000); 191 counters['stop'+show_id]=counter; 192 193 } 194 195 196 }else{ 197 wpstream_show_error_on_start(data.error,parent) 198 } 199 200 }, 201 error: function (jqXHR,textStatus,errorThrown) { 202 } 203 }); 204 205 }); 206 207} 208 209 210/* 211*
212* Bind Stop channel action 213* 214*/ 215 216function wpstream_bind_stop_event(button){ 217 button.click(function(event){ 218 219 220 if(!confirm(wpstream_start_streaming_vars.turn_off_confirm)){ 221 return false; 222 } 223 button.unbind('click'); 224 225 226 var ajaxurl = wpstream_start_streaming_vars.admin_url + 'admin-ajax.php'; 227 var show_id = parseFloat( jQuery(this).attr('data-show-id') ); 228 var nonce = jQuery('#wpstream_start_event_nonce').val(); 229 var parent = jQuery(this).parent(); 230 var thisButton = jQuery(this); 231 232 thisButton.removeClass('wpstream_stop_event'); 233 thisButton.addClass('wpstream_turning_on').empty().html(wpstream_start_streaming_vars.stop_streaming_action+'<div class="wpstream_loader"></div><div class="wpstream_tooltip">'+wpstream_start_streaming_vars.turning_off_tooltip+'</div>'); 234 parent.find('.wpstream_channel_status').text(wpstream_start_streaming_vars.channel_turning_off); 235 parent.find('.start_webcaster').addClass('wpstream_inactive_icon'); 236 parent.find('.wpstream_stream_pro').addClass('wpstream_inactive_icon'); 237 parent.find('.wpstream_live_data').addClass('wpstream_inactive_icon'); 238 239 240 241 jQuery.ajax({ 242 type: 'POST', 243 url: ajaxurl, 244 dataType: 'json', 245 timeout: 300000, 246 247 data: { 248 'action' : 'wpstream_turn_of_channel', 249 'security' : nonce, 250 'show_id' : show_id 251 252 253 }, 254 success: function (data) { 255 256 if(data.conected===true){ 257 258 thisButton.unbind('click'); 259 260 var counter = setInterval( function (){ 261 wpstream_check_live_connections_on_start(parent,show_id,'',data)},10000); 262 counters["stop"+show_id]=counter; 263 264 }else{ 265 266 wpstream_show_error_on_stop(data.error,parent) 267 } 268 269 }, 270 error: function (jqXHR,textStatus,errorThrown) { 271 272 } 273 }); 274 275 276 277 }); 278 279} 280 281 282/* 283* 284* Enable copy to clipboard 285* 286*/ 287 288function wpstream_enable_cliboard(parent){ 289 290 jQuery(parent).find('.copy_live_uri').click(function(){ 291 292 var value_uri = jQuery(parent).find('.wpstream_live_uri_text').text(); 293 var temp = jQuery("<input>"); 294 jQuery("body").append(temp); 295 jQuery(temp).val(value_uri).select(); 296 document.execCommand("copy"); 297 jQuery(temp).remove(); 298 299 }); 300 301 jQuery(parent).find('.copy_live_key').click(function(){ 302 var value_uri = jQuery(parent).find('.wpstream_live_key_text').text(); 303 var temp = jQuery("<input>"); 304 jQuery("body").append(temp); 305 jQuery(temp).val(value_uri).select(); 306 document.execCommand("copy"); 307 jQuery(temp).remove(); 308 309 }); 310} 311 312 313/* 314 * 315 * Check live events/channels on starts 316 * 317 * 318 * 319*/ 320 321 322function wpstream_check_live_connections_on_start( parent,show_id,server_id,data){ 323 324 // server_url is dns change 325 326 wpstream_check_event_status_in_js(show_id,'wpstream_check_live_connections_on_start', 327 function(server_status){ 328 329 if(server_status.status==='active' ){ 330 331 332 wpstream_event_ready_make_actions_visible(parent); 333 334 parent.find('.start_webcaster').attr('data-webcaster-url',server_status.webcaster_url); 335 parent.find('.wpstream_live_uri_text').text(server_status.obs_uri); 336 parent.find('.wpstream_live_key_text').text(server_status.obs_stream); 337 338 var larix_rtmp= server_status.obs_uri+server_status.obs_stream; 339 parent.find('.wpstream_larix_rtmp').text(larix_rtmp); 340 341 var larix_qr ='larix://set/v1?conn[][url]='+encodeURIComponent(larix_rtmp); 342 parent.find('.wpstream_start_with_larix_mobile').attr('href',larix_qr); 343 344 parent.find('.wpstream_larix_rtmp').text(larix_rtmp); 345 parent.find('.larrix_test').text(larix_rtmp); 346 347 var print_qrcode= "https://chart.googleapis.com/chart?cht=qr&chs=110x110&chl="+encodeURIComponent(larix_qr) +"&choe=UTF-8"; 348 parent.find('.print_qrcode').attr('src',print_qrcode); 349 350 parent.parent().find('.wpstream_live_data').attr('href',server_status.live_data_url); 351 clearInterval( counters["stop"+show_id]); 352 353 354 if (typeof wpstream_integration_notifications === 'function') { 355 wpstream_integration_notifications(show_id); 356 } 357 358 359 }else if(server_status.status==='stopped' ){ 360 361 clearInterval( counters["stop"+show_id]); 362 wpstream_event_stopped_make_actions(parent); 363 364 }else if(server_status.status==='error' ){ 365 366 clearInterval( counters["stop"+show_id]); 367 var curent_content = parent.find('.wpstream_channel_status'); 368 curent_content.html('<div class="wpstream_channel_status not_ready_to_stream"><span class="dashicons dashicons-dismiss"></span>'+wpstream_start_streaming_vars.failed_event_creation+'</div>'); 369 } 370 }); 371 372} 373 374 375 376 377/* 378 * check channell id status 379 * 380 * @param {type} channel_id 381 * @param {type} callback 382 * @returns {undefined} 383 * 384 * 385*/ 386 387function wpstream_check_event_status_in_js(channel_id,notes,callback){ 388 389 var ajaxurl = wpstream_start_streaming_vars.admin_url + 'admin-ajax.php'; 390 jQuery.ajax({ 391 type: 'POST', 392 dataType: 'json', 393 url: ajaxurl, 394 timeout: 3000000, 395 396 data: { 397 'action' : 'wpstream_check_event_status', 398 'channel_id' : channel_id, 399 'notes' : notes, 400 401 }, 402 success: function (data) { 403 404 var obj = data; 405 var channel_status = obj.status; 406 407 if(channel_status=='active' || channel_status=='stopped' ){ 408 callback(obj); 409 }else if(channel_status=='error'){ 410 callback(obj); 411 }else{ 412 callback(false); 413 } 414 415 }, error: function (jqXHR,textStatus,errorThrown) { 416 417 } 418 }); 419} 420 421 422/* 423* 424* Make actions visible on event if ready 425* 426* 427*/ 428function wpstream_event_ready_make_actions_visible(parent){ 429 430 var actionButton = parent.find('.start_event'); 431 parent.addClass('wpstream_show_started'); 432 actionButton.unbind('click'); 433 wpstream_bind_stop_event(actionButton); 434 435 actionButton.addClass('wpstream_stop_event').removeClass('start_event').html(wpstream_start_streaming_vars.stop_streaming+'<div class="wpstream_tooltip">'+wpstream_start_streaming_vars.turned_off_tooltip+'</div>'); 436 parent.find('.wpstream-button-icon').removeClass('wpstream_inactive_icon'); 437 parent.find('.wpstream_show_settings').addClass('wpstream_inactive_icon'); 438 parent.find('.wpstream_channel_status').text(wpstream_start_streaming_vars.channel_on); 439 440 //for onboarding 441 var check_against='3'; 442 var check_against_camera_icon='5'; 443 if(jQuery('#woocommerce-product-data').length>0){ 444 check_against='5' 445 check_against_camera_icon='7'; 446 } 447 448 449 var bubble_Step =jQuery('#wpstream_onboard_bubble').attr('data-bubble-step'); 450 451 if(bubble_Step===check_against){ 452 jQuery('#wpstream_onboard_bubble_tile').text('Channel is now ON'); 453 jQuery('#wpstream_onboard_bubble_content').text('You are ready to GO LIVE. Click Next to see how.'); 454 } 455 if(bubble_Step===check_against_camera_icon){ 456 jQuery('#wpstream_onboard_bubble_tile').html('Go LIVE'); 457 jQuery('#wpstream_onboard_bubble_content').html('To Go Live now, click the <div class=\"wpstream_sample_icon_settings wpstream_sample_icon_camera\"></div> icon. The broadcast app will open in a new window.'); 458 459 if( jQuery('.event_list_unit .wpstream_button').hasClass('wpstream_stop_event') ){ 460 jQuery('.wpstream_sample_icon_camera').css('cursor','pointer'); 461 462 jQuery('.wpstream_sample_icon_camera').on('click',function(){ 463 jQuery('.start_webcaster').trigger('click'); 464 jQuery(this).unbind('click'); 465 466 }) 467 } 468 469 } 470} 471 472 473/* 474* 475* Make actions visible on event if stopped 476* 477* 478*/ 479function wpstream_event_stopped_make_actions(parent){ 480 481 var actionButton = parent.find('.wpstream_turning_on'); 482 wpstream_bind_start_event(actionButton); 483 parent.removeClass('wpstream_show_started'); 484 actionButton.removeClass('wpstream_turning_on'); 485 actionButton.addClass('start_event'); 486 actionButton.html( wpstream_start_streaming_vars.start_streaming+'<div class="wpstream_tooltip">'+wpstream_start_streaming_vars.turned_on_tooltip+'</div>'); 487 488 parent.find('.wpstream-button-icon').removeClass('wpstream_inactive_icon'); 489 parent.find('.wpstream_stream_pro').addClass('wpstream_inactive_icon'); 490 parent.find('.start_webcaster').addClass('wpstream_inactive_icon'); 491 parent.find('.wpstream_statistics_channel').addClass('wpstream_inactive_icon'); 492 493 parent.find('.wpstream_channel_status').text(wpstream_start_streaming_vars.channel_off); 494} 495 496 497 498function wpstream_show_error_on_start(text,parent){ 499 //You don't have enough data to start a new event! 500 jQuery('.wpstream_error_content').text(text); 501 jQuery('.wpstream_modal_background').show(); 502 jQuery('.wpstream_error_modal_notification').show(); 503 wpstream_event_stopped_make_actions(parent); 504 505} 506 507function wpstream_show_error_on_stop(text,parent){ 508 //You don't have enough data to start a new event! 509 jQuery('.wpstream_error_content').text(text); 510 jQuery('.wpstream_modal_background').show(); 511 jQuery('.wpstream_error_modal_notification').show(); 512 wpstream_event_ready_make_actions_visible(parent); 513 514} 515 516 517/* 518* 519* Streaming modal trigger functions 520* 521* 522*/ 523function wpestate_start_modal_actions(){ 524 525 jQuery('.wpstream_close_modal').on('click',function(event){ 526 jQuery(this).parent().hide(); 527 jQuery('.wpstream_modal_background').hide(); 528 }); 529 530 document.addEventListener('keydown', function(event) { 531 if(event.keyCode == 27){ 532 jQuery('.wpstream_modal_form').hide(); 533 jQuery('.wpstream_modal_background').hide(); 534 } 535 }); 536 537 538 jQuery('.wpstream-trigger-modal').on('click',function(event){ 539 540 if( jQuery(this).hasClass('wpstream_inactive_icon') ) { 541 return; 542 }; 543 544 jQuery('.wpstream_modal_background').show(); 545 var modal_class=jQuery(this).attr('data-modal'); 546 var parent =jQuery(this).closest('.event_list_unit'); 547 jQuery('.wpstream_modal_background').show(); 548 parent.find("."+modal_class).show(); 549 }) 550 551 jQuery('.wpstream_external_broadcast_options').change(function(event){ 552 var new_option = jQuery(this).val(); 553 var parent = jQuery(this).parent(); 554 555 parent.find('.external_software_streaming').hide(); 556 parent.find('.'+new_option).show(); 557 }); 558 559 560} 561 562 563 564/* 565* 566* Tooltips for buttons 567* 568* 569*/ 570 571function wpstream_tooltip(){ 572 573 jQuery( ".wpstream_tooltip_wrapper" ).hover( 574 function() { 575 576 if(jQuery( this ).hasClass('wpstream_inactive_icon')){ 577 jQuery( this ).find('.wpstream_tooltip_disabled').css('opacity',1); 578 }else{ 579 jQuery( this ).find('.wpstream_tooltip').css('opacity',1); 580 } 581 582 583 }, function() { 584 jQuery( this ).find('.wpstream_tooltip').css('opacity',0); 585 jQuery( this ).find('.wpstream_tooltip_disabled').css('opacity',0); 586 } 587); 588} 589 590/* 591* 592* Modal errors 593* 594* 595*/ 596 597 598function wpestate_start_modal_error_actions(){ 599 jQuery('.wpstream_error_ok').on('click',function(event){ 600 jQuery(this).parent().hide(); 601 jQuery('.wpstream_modal_background').hide(); 602 jQuery(this).parent().find('.wpstream_error_content').text(''); 603 }); 604} 605 606 607 608 609/* 610* 611* Copy to Clipboard 612* 613* 614*/ 615 616function wpstream_copy_to_clipboard(){ 617 618 jQuery('.copy_live_uri').on('click',function(){ 619 var value_uri = jQuery(this).parent().find('.wpstream_live_uri_text').text(); 620 var temp = jQuery("<input>"); 621 jQuery("body").append(temp); 622 jQuery(temp).val(value_uri).select(); 623 document.execCommand("copy"); 624 jQuery(temp).remove(); 625 626 }); 627 628 jQuery('.copy_live_key').on('click',function(){ 629 var value_uri = jQuery(this).parent().find('.wpstream_live_key_text').text(); 630 var temp = jQuery("<input>"); 631 jQuery("body").append(temp); 632 jQuery(temp).val(value_uri).select(); 633 document.execCommand("copy"); 634 jQuery(temp).remove(); 635 }); 636} 637 638/* 639* 640* Webcaster button action 641* 642* 643*/ 644 645function wpstream_webcaster_actions(){ 646 jQuery('.start_webcaster').on('click',function(){ 647 if(jQuery(this).hasClass('wpstream_inactive_icon')){ 648 return; 649 } 650 var caster_url = jQuery(this).attr('data-webcaster-url'); 651 jQuery(this).parent().find('.external_software_streaming').slideUp() 652 window.open(caster_url, '_blank', 'location=yes,scrollbars=yes,status=yes'); 653 }) 654} 655 656 657 658/* 659* 660* per event - low latency vs bitrate vs encrypt 661* 662*/ 663 664 665function wpstream_adjust_settings(input_element){ 666 667 668 669 var attr_value = input_element.attr('data-attr-ajaxname'); 670 console.log(attr_value); 671 672 673 674 if( attr_value === 'adaptive_bitrate' || attr_value==='low_latency'){ 675 console.log('perform '); 676 677 var timer = setTimeout(function() { 678
679 if( jQuery('.wpstream-setting-adaptive_bitrate .wpstream_event_option_item').is(':checked') || 680 jQuery('.wpstream-setting-low_latency .wpstream_event_option_item').is(':checked') ){ 681 jQuery('.wpstream-setting-encrypt .wpstream_event_option_item') .removeAttr('checked'); 682 } 683 }, 300); 684 685 } 686 687 if( attr_value === 'encrypt'){ 688 console.log('perform2 '); 689 690 var timer = setTimeout(function() { 691 692 if( jQuery('.wpstream-setting-encrypt .wpstream_event_option_item').is(':checked') ){ 693 694 jQuery('.wpstream-setting-low_latency .wpstream_event_option_item') .removeAttr('checked'); 695 jQuery('.wpstream-setting-adaptive_bitrate .wpstream_event_option_item') .removeAttr('checked'); 696 697 } 698 699 700 }, 300); 701 702 } 703 704} 705 706/* 707* 708* Save options actions 709* 710* 711*/ 712 713function wpstream_save_options_actions(){ 714 jQuery('.wpestate_settings_modal .wpstream_event_option_item').on('click',function(){ 715 716 wpstream_adjust_settings(jQuery(this)); 717 718 719 var holder = jQuery(this).parents('.wpstream_event_streaming_local'); 720 var show_id = jQuery(this).parents('.event_list_unit').find('.start_event').attr('data-show-id'); 721 var optionarray ={}; 722 var nonce = jQuery('#wpstream_start_event_nonce').val(); 723 var timer = setTimeout(function() { 724 holder.find('.wpstream_event_option_item').each(function(){ 725 optionarray[jQuery(this).attr('data-attr-ajaxname')]=jQuery(this).prop("checked") ? 1 : 0 ; 726 }); 727 728 729 var myJSON = JSON.stringify(optionarray); 730 jQuery.ajax({ 731 type: 'POST', 732 url: ajaxurl, 733 timeout: 300000, 734 data: { 735 'action' : 'wpstream_update_local_event_settings', 736 'show_id' : show_id, 737 'option' : optionarray, 738 'security' : nonce 739 740 }, 741 success: function (data) { 742 }, 743 error: function (jqXHR,textStatus,errorThrown) { 744 } 745 746 }); 747 }, 300); 748 749 }); 750 751} 752 753 754/* 755* 756* Function to check live connections 757* 758* 759*/ 760 761function wpstream_check_live_connections(){ 762 // was .pending_streaming.pending_trigger 763 if( jQuery('.event_list_unit.pending_trigger').length>0 ){ 764 jQuery('.event_list_unit.pending_trigger').each(function(){ 765 var acesta = jQuery(this); 766 var show_id = jQuery(this).attr('data-show-id'); 767 var server_id = jQuery(this).attr('data-server-id'); 768 769 wpstream_check_live_connections_from_database(acesta,show_id,server_id); 770 var counter_long = ''; 771 counter_long = setInterval( function (){ wpstream_check_live_connections_from_database(acesta,show_id,server_id)},60000); 772 counters[show_id]=counter_long; 773 774 }); 775 } 776 777} 778 779 780 781 782/* 783* 784* check live connection 785* 786* 787*/ 788 789 790function wpstream_check_live_connections_from_database( acesta,channel_id,server_id){ 791 var server_status = wpstream_check_event_status_in_js(channel_id,'wpstream_check_live_connections_from_database', 792 function(server_status){ 793 794 if(server_status.status==='active' ){ 795 wpstream_event_ready_make_actions_visible( acesta ); 796 acesta.find('.wpstream_ready_to_stream .start_webcaster').attr('data-webcaster-url',server_status.webcaster_url); 797 acesta.find('.wpstream_live_uri_text').text(server_status.obs_uri); 798 acesta.find('.wpstream_live_key_text').text(server_status.obs_stream); 799 800 var larix_rtmp= server_status.obs_uri+server_status.obs_stream; 801 acesta.find('.wpstream_larix_rtmp').text(larix_rtmp); 802 803 acesta.find('.larrix_test').text(larix_rtmp); 804 805 var larix_qr ='larix://set/v1?conn[][url]='+encodeURIComponent(larix_rtmp); 806 acesta.find('.wpstream_start_with_larix_mobile').attr('href',larix_qr); 807 808 var print_qrcode= "https://chart.googleapis.com/chart?cht=qr&chs=110x110&chl="+encodeURIComponent(larix_qr) +"&choe=UTF-8"; 809 810 acesta.find('.print_qrcode').attr('src',print_qrcode); 811 acesta.find('.wpstream_live_data').attr('href',server_status.live_data_url); 812 clearInterval( counters["stop"+channel_id]); 813 814 }else if(server_status.status==='error' ){ 815 816 clearInterval( counters["stop"+channel_id]); 817 var curent_content = acesta.find('.wpstream_channel_status '); 818 819 curent_content.html('<div class="wpstream_channel_status not_ready_to_stream"><span class="dashicons dashicons-dismiss"></span>'+wpstream_start_streaming_vars.failed_event_creation+'</div>'); 820 } 821 }); 822 823} 824 825 826 827/* 828* 829* Check event/channel status 830* 831* 832*/ 833 834 835function wpstream_check_server_status(url_param,callback) { 836 837 var url = url_param ; 838 var status=''; 839 jQuery.ajax({ 840 url: url, 841 type: "get", 842 cache: false, 843 dataType: 'jsonp', // it is for supporting crossdomain 844 crossDomain : true, 845 asynchronous : false, 846 timeout : 1500, // set a timeout in milliseconds 847 callback:'', 848 complete : function(xhr) { 849 850 if(xhr.status == "200" || xhr.status == "400") { 851 callback(true); 852 } 853 else { 854 callback(false); 855 } 856 } 857 }); 858} 859
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.