Changeset 3347939
- Timestamp:
- 08/21/2025 07:35:58 AM (7 months ago)
- Location:
- wpstream
- Files:
-
- 16 added
- 24 edited
- 1 copied
-
tags/4.7 (copied) (copied from wpstream/trunk)
-
tags/4.7/admin/class-wpstream-admin.php (modified) (6 diffs)
-
tags/4.7/admin/js/wpstream_settings.js (modified) (2 diffs)
-
tags/4.7/hello-wpstream/framework/wpstream-video-functions.php (modified) (1 diff)
-
tags/4.7/img/mic-32px.svg (added)
-
tags/4.7/img/mic-off-32px.svg (added)
-
tags/4.7/img/videocam-32px.svg (added)
-
tags/4.7/img/videocam-off-32px.svg (added)
-
tags/4.7/includes/class-wpstream-ajax.php (modified) (15 diffs)
-
tags/4.7/includes/class-wpstream-live-api-connection.php (modified) (3 diffs)
-
tags/4.7/includes/class-wpstream-player.php (modified) (1 diff)
-
tags/4.7/public/class-wpstream-public.php (modified) (3 diffs)
-
tags/4.7/public/css/broadcaster.css (added)
-
tags/4.7/public/css/video-js.css (modified) (3 diffs)
-
tags/4.7/public/css/videojs-wpstream.css (modified) (5 diffs)
-
tags/4.7/public/js/broadcaster.js (added)
-
tags/4.7/public/js/start_streaming.js (modified) (2 diffs)
-
tags/4.7/readme.txt (modified) (2 diffs)
-
tags/4.7/templates (added)
-
tags/4.7/templates/broadcaster-template.php (added)
-
tags/4.7/wpstream.php (modified) (3 diffs)
-
trunk/admin/class-wpstream-admin.php (modified) (6 diffs)
-
trunk/admin/js/wpstream_settings.js (modified) (2 diffs)
-
trunk/hello-wpstream/framework/wpstream-video-functions.php (modified) (1 diff)
-
trunk/img/mic-32px.svg (added)
-
trunk/img/mic-off-32px.svg (added)
-
trunk/img/videocam-32px.svg (added)
-
trunk/img/videocam-off-32px.svg (added)
-
trunk/includes/class-wpstream-ajax.php (modified) (15 diffs)
-
trunk/includes/class-wpstream-live-api-connection.php (modified) (3 diffs)
-
trunk/includes/class-wpstream-player.php (modified) (1 diff)
-
trunk/public/class-wpstream-public.php (modified) (3 diffs)
-
trunk/public/css/broadcaster.css (added)
-
trunk/public/css/video-js.css (modified) (3 diffs)
-
trunk/public/css/videojs-wpstream.css (modified) (5 diffs)
-
trunk/public/js/broadcaster.js (added)
-
trunk/public/js/start_streaming.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/templates (added)
-
trunk/templates/broadcaster-template.php (added)
-
trunk/wpstream.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpstream/tags/4.7/admin/class-wpstream-admin.php
r3335660 r3347939 223 223 ); 224 224 225 wp_enqueue_script('wpstream-start-streaming_admin', plugin_dir_url( __DIR__ ) .' /public/js/start_streaming.js?v='.time(),array(), WPSTREAM_PLUGIN_VERSION, true);225 wp_enqueue_script('wpstream-start-streaming_admin', plugin_dir_url( __DIR__ ) .'public/js/start_streaming.js?v='.time(),array(), WPSTREAM_PLUGIN_VERSION, true); 226 226 wp_localize_script('wpstream-start-streaming_admin', 'wpstream_start_streaming_vars', 227 227 array( … … 276 276 'update_successful' => esc_html__( 'Update Successful.', 'wpstream'), 277 277 'update_failed' => esc_html__( 'Something went wrong. Try again.', 'wpstream'), 278 'broadcaster_url' => esc_url( esc_url(home_url('/broadcaster-page/') ) ), 278 279 )); 279 280 … … 286 287 'upload_url' => get_dashboard_url().'admin.php?page=wpstream_recordings' 287 288 288 )); 289 )); 290 291 // wp_enqueue_style( 292 // 'wpstream-broadcaster-css', 293 // plugin_dir_url(__FILE__) . 'public/css/broadcaster.css', 294 // array(), 295 // filemtime(plugin_dir_path(__FILE__) . 'public/css/broadcaster.css' ), 296 // ); 297 // 298 // wp_enqueue_script( 299 // 'wpstream-broadcaster', 300 // plugin_dir_url(__FILE__) . 'public/js/broadcaster.js', 301 // array('jquery'), 302 // WPSTREAM_PLUGIN_VERSION, 303 // true 304 // ); 305 306 // Add localized variables for broadcaster 307 wp_localize_script('wpstream-broadcaster', 'wpstream_broadcaster_vars', array( 308 'ajax_url' => admin_url('admin-ajax.php'), 309 'nonce' => wp_create_nonce('wpstream_broadcaster_nonce'), 310 'plugin_url' => plugin_dir_url(__FILE__), 311 312 )); 289 313 290 314 } … … 802 826 803 827 print '<div class="wpstream_inactive_icon start_webcaster wpstream_stream_browser wpstream-button-icon wpstream_tooltip_wrapper" data-webcaster-url="'.$webcaster_url.'" data-show-id="'.$the_id.'"">'; 804 828 805 829 print '<div class="wpstream_tooltip_disabled">'.esc_html__('Turn ON the channel to go live.','wpestream').'</div>'; 806 830 print '<div class="wpstream_tooltip">'.esc_html__('Go live with your webcam','wpestream').'</div>'; … … 1432 1456 'sea' => esc_html__('Sea','wpstream'), 1433 1457 ), 1434 'details' => esc_html__('Choose the video player theme to have a different look .','wpstream'),1458 'details' => esc_html__('Choose the video player theme to have a different look for the player.','wpstream'), 1435 1459 ), 1436 1460 'wpstream_player_logo' => array( … … 1447 1471 // 'tab' => 'general_options', 1448 1472 // 'name' => 'player_logo_opacity', 1449 // 'label' => esc_html__('Opacity of the player logo','wpstream'),1473 // 'label' => esc_html__('Opacity of the video player logo','wpstream'), 1450 1474 // 'type' => 'range', 1451 1475 // 'details' => esc_html__('Set the opacity of the logo','wpstream'), -
wpstream/tags/4.7/admin/js/wpstream_settings.js
r3316678 r3347939 9 9 10 10 wpstream_update_plugin_support_tab(); 11 12 // wpstream_broadcaster_bind(); 11 13 }); 12 14 … … 202 204 }); 203 205 } 206 207 function wpstream_broadcaster_bind() { 208 jQuery('.start_webcaster').on('click', function(e) { 209 if (jQuery(this).hasClass('wpstream_inactive_icon')) { 210 return; 211 } 212 e.preventDefault(); 213 e.stopPropagation(); 214 215 // Get the channel ID from the data attribute 216 var channelId = jQuery(this).closest('.event_list_unit').data('show-id'); 217 218 if (!channelId) { 219 return; 220 } 221 222 // Open the broadcaster in a new window 223 var broadcasterUrl = wpstream_settings_vars.broadcaster_url + channelId; 224 window.open(broadcasterUrl, 'wpstream_broadcaster_' + channelId, 'fullscreen=yes'); 225 }); 226 227 } -
wpstream/tags/4.7/hello-wpstream/framework/wpstream-video-functions.php
r3346758 r3347939 336 336 $return_string = '<div class="wpstream_not_live_mess wpstream_theme_not_live_section "><div class="wpstream_not_live_mess_back"></div>'; 337 337 $return_string .= '<div class="wpstream_not_live_mess_mess">'; 338 if ( isset($event_data['status']) && $event_data['status'] === 'stopped' ) { 338 339 if ( ( isset( $event_data['status']) && 340 in_array( $event_data['status'], array( 'stopped', 'stopping', 'starting' ) ) ) || 341 ( isset($event_data['error']) && $event_data['error'] === 'NO_SUCH_CHANNEL' ) ){ 339 342 $return_string .= esc_html( get_option( 'wpstream_you_are_not_live', 'We are not live at this moment' ) );; 340 343 } -
wpstream/tags/4.7/includes/class-wpstream-ajax.php
r3335660 r3347939 20 20 21 21 add_action( 'wp_ajax_wpstream_get_videos_list', [$this,'wpstream_get_videos_list'] ); 22 22 add_action('wp_ajax_wpstream_get_broadcaster_info', array($this, 'wpstream_get_broadcaster_info')); 23 23 24 // Add the dashboard AJAX actions 24 25 add_action( 'wp_ajax_wpstream_dashboard_save_channel_data', [$this, 'wpstream_dashboard_save_channel_data'] ); … … 30 31 add_action( 'wp_ajax_wpstream_handle_channel_details_saving', [$this, 'wpstream_handle_channel_details_saving'] ); 31 32 add_action( 'wp_ajax_wpstream_remove_post_id', [$this, 'wpstream_remove_post_id_callback'] ); 32 33 33 34 // Enqueue dashboard scripts 34 35 add_action( 'wp_enqueue_scripts', [$this, 'wpstream_enqueue_dashboard_scripts'] ); … … 48 49 true 49 50 ); 50 51 51 52 wp_localize_script( 'wpstream-dashboard-script', 'wpstream_dashboard_script_vars', array( 52 53 'ajaxurl' => admin_url( 'admin-ajax.php' ), … … 82 83 die(); 83 84 } 84 85 86 /** 87 * AJAX handler to get broadcaster information 88 */ 89 public function wpstream_get_broadcaster_info() { 90 // Verify nonce 91 check_ajax_referer('wpstream_broadcaster_nonce', 'nonce'); 92 93 // Check permissions 94 if (!current_user_can('publish_posts')) { 95 wp_send_json_error('Insufficient permissions'); 96 return; 97 } 98 99 $channel_id = isset($_POST['channel_id']) ? intval($_POST['channel_id']) : 0; 100 101 if (empty($channel_id)) { 102 wp_send_json_error('Invalid channel ID'); 103 return; 104 } 105 106 // Get RTMP URL from post meta 107 $obs_uri = get_post_meta($channel_id, 'obs_uri', true); 108 $obs_stream = get_post_meta($channel_id, 'obs_stream', true); 109 110 if (empty($obs_uri) || empty($obs_stream)) { 111 wp_send_json_error('RTMP information not available'); 112 return; 113 } 114 115 wp_send_json_success([ 116 'rtmp_url' => $obs_uri, 117 'stream_key' => $obs_stream 118 ]); 119 } 120 85 121 /** 86 122 * Saves channel data from the dashboard. … … 129 165 set_post_thumbnail( $postID, $thumb_id ); 130 166 131 167 132 168 /* 133 169 * Manage images … … 138 174 update_post_meta( $postID, '_product_image_gallery', $images ); 139 175 } else { 140 176 141 177 $images_array = explode( ',', $images ); 142 178 delete_post_meta( $postID, 'wpstream_theme_gallery' ); … … 187 223 } 188 224 } 189 225 190 226 /** 191 227 * Return the image gallery for a post. … … 219 255 return array_filter( $gallery_images ); 220 256 } 221 257 222 258 /** 223 259 * Returns information about taxonomies for the specified post. … … 361 397 return $return_string; 362 398 } 363 399 364 400 /** 365 401 * Save user address data from dashboard. … … 383 419 } 384 420 } 385 421 386 422 387 423 wp_send_json_success( … … 394 430 die(); 395 431 } 396 432 397 433 /** 398 434 * Delete profile attachment … … 453 489 die(); 454 490 } 455 491 456 492 /** 457 493 * Dashboard save user data … … 629 665 wp_die(); 630 666 } 631 667 632 668 /** 633 669 * Handle channel creation. … … 643 679 } 644 680 $current_user = wp_get_current_user(); 645 681 646 682 // These functions should be implemented in the plugin or be accessible 647 683 $maxim_channels_per_user = function_exists('wpstream_return_max_channels_per_user') ? wpstream_return_max_channels_per_user() : 100; … … 809 845 wp_die(); 810 846 } 811 847 812 848 /** 813 849 * Callback handler to remove a post ID from the "watch later" list. -
wpstream/tags/4.7/includes/class-wpstream-live-api-connection.php
r3346758 r3347939 15 15 add_action( 'wp_ajax_wpstream_check_dns_sync', array($this,'wpstream_check_dns_sync') ); 16 16 add_action( 'wp_ajax_wpstream_check_event_status', array($this,'wpstream_check_event_status') ); 17 17 add_action( 'wp_ajax_wpstream_check_whipurl', array($this, 'wpstream_check_whipurl') ); 18 add_action( 'wp_ajax_wpstream_check_user_quota', array($this, 'wpstream_check_user_quota') ); 19 18 20 add_action( 'wp_ajax_wpstream_close_event', array($this,'wpstream_close_event') ); 19 21 add_action( 'wp_ajax_wpstream_get_download_link', array($this,'wpstream_get_download_link') ); … … 308 310 309 311 } 312 313 public function wpstream_check_whipurl() { 314 $channel_id = intval($_POST['channel_id']); 315 316 $whip_url = get_post_meta($channel_id, 'whipUrl', true); 317 318 if ( $whip_url ) { 319 print json_encode( 320 array( 321 'success' => true, 322 'whip_url' => $whip_url, 323 ) 324 ); 325 } else { 326 print json_encode( 327 array( 328 'success' => false, 329 'error' => esc_html__('WHIP URL not found for this channel.', 'wpstream'), 330 ) 331 ); 332 } 333 die(); 334 } 310 335 311 336 /** … … 1110 1135 1111 1136 1137 public function wpstream_check_user_quota() { 1138 $pack_data = $this->wpstream_request_pack_data_per_user(); 1139 if ( ! $pack_data || ! isset( $pack_data['success'] ) || ! $pack_data['success'] ) { 1140 print json_encode( 1141 array( 1142 'success' => false, 1143 'error' => esc_html__('Couldn\'t get user quota.', 'wpstream'), 1144 ) 1145 ); 1146 } else { 1147 print json_encode($pack_data); 1148 } 1149 die(); 1150 } 1112 1151 1113 1152 -
wpstream/tags/4.7/includes/class-wpstream-player.php
r3337309 r3347939 52 52 if ( false === $event_data_for_transient || $event_data_for_transient=='' ) { //ws || $hls_to_return=='' 53 53 $notes = 'wpstream_player_check_status_note_from_js'; 54 $event_status = $this->main->wpstream_live_connection-> wpstream_check_event_status_api_call($channel_id,$notes);54 $event_status = $this->main->wpstream_live_connection->wpstream_check_event_status_api_call($channel_id,$notes); 55 55 $event_data_for_transient = $event_status; 56 56 $usefull_info =' no cache found'; -
wpstream/tags/4.7/public/class-wpstream-public.php
r3335660 r3347939 72 72 73 73 wp_enqueue_style('wpstream-style', plugin_dir_url( __FILE__ ) .'/css/wpstream_style.css',array(), WPSTREAM_PLUGIN_VERSION, 'all' ); 74 wp_enqueue_style('video-js.min', plugin_dir_url( __FILE__ ).' /css/video-js.css', array(), WPSTREAM_PLUGIN_VERSION, 'all');74 wp_enqueue_style('video-js.min', plugin_dir_url( __FILE__ ).'css/video-js.css', array(), WPSTREAM_PLUGIN_VERSION, 'all'); 75 75 wp_enqueue_style( 76 76 'videojs-wpstream-player', 77 plugin_dir_url( __FILE__ ).' /css/videojs-wpstream.css',77 plugin_dir_url( __FILE__ ).'css/videojs-wpstream.css', 78 78 array(), 79 79 WPSTREAM_PLUGIN_VERSION . '.' . filemtime( plugin_dir_path(__FILE__) . 'css/videojs-wpstream.css' ), … … 199 199 } 200 200 201 wp_enqueue_script('wpstream-integrations', plugin_dir_url( __DIR__ ) .' /integrations/js/integrations.js?v='.time(),array(), WPSTREAM_PLUGIN_VERSION, true);201 wp_enqueue_script('wpstream-integrations', plugin_dir_url( __DIR__ ) .'integrations/js/integrations.js?v='.time(),array(), WPSTREAM_PLUGIN_VERSION, true); 202 202 wp_localize_script('wpstream-integrations', 'wpstream_integrations_vars', $integrations_array ); 203 203 … … 222 222 ) 223 223 ); 224 225 wp_enqueue_style( 226 'wpstream-broadcaster-css', 227 WPSTREAM_PLUGIN_DIR_URL . 'public/css/broadcaster.css', 228 array(), 229 filemtime( WPSTREAM_PLUGIN_PATH . 'public/css/broadcaster.css' ) , 230 ); 231 232 // wp_enqueue_script( 233 // 'wpstream-broadcaster', 234 // WPSTREAM_PLUGIN_DIR_URL . 'public/js/broadcaster.js', 235 // array('jquery'), 236 // filemtime( WPSTREAM_PLUGIN_PATH . 'public/js/broadcaster.js' ), 237 // true 238 // ); 239 // 240 // // Add localized variables for broadcaster 241 // wp_localize_script('wpstream-broadcaster', 'wpstream_broadcaster_vars', array( 242 // 'ajax_url' => admin_url('admin-ajax.php'), 243 // 'nonce' => wp_create_nonce('wpstream_broadcaster_nonce'), 244 // 'plugin_url' => plugin_dir_url(__FILE__), 245 // 'obs_uri' => '', 246 // )); 224 247 } 225 248 226 249 227 250 228 251 -
wpstream/tags/4.7/public/css/video-js.css
r3312871 r3347939 598 598 599 599 .video-js:not(.vjs-theme-default) .vjs-control-bar { 600 height: 54px; 600 height: 4em; 601 } 602 603 .vjs-wpstream.vjs-default-skin .vjs-volume-panel { 604 height: 4em; 605 } 606 607 .vjs-wpstream.vjs-default-skin .vjs-live-control { 608 max-height: 100%; 609 } 610 611 .vjs-wpstream.vjs-default-skin .vjs-volume-panel .vjs-volume-control .vjs-volume-tooltip { 612 display: none; 613 } 614 615 .wpstream-spinner { 616 width: 40px; 617 height: 40px; 618 border: 4px solid #f3f3f3; 619 border-top: 4px solid #3498db; 620 border-radius: 50%; 621 animation: wpstream-spin 1s linear infinite; 622 margin: 0 auto; 623 } 624 625 @keyframes wpstream-spin { 626 0% { transform: rotate(0deg); } 627 100% { transform: rotate(360deg); } 601 628 } 602 629 … … 1037 1064 width: 1px; 1038 1065 height: 1px; 1039 margin-left: -1px; } 1066 margin-left: -1px; 1067 1068 } 1040 1069 1041 1070 .video-js .vjs-volume-panel { … … 1292 1321 transform: translateY(-1.5em); } 1293 1322 1294 .video-js .vjs-fullscreen-control {1323 .video-js .vjs-fullscreen-control, .video-js .vjs-picture-in-picture-control { 1295 1324 cursor: pointer; 1296 1325 flex: none; } -
wpstream/tags/4.7/public/css/videojs-wpstream.css
r3346758 r3347939 51 51 52 52 .wpstream-featured-player-wrapper .vjs-live-display { 53 margin-top: 0 ;53 margin-top: 0 !important; 54 54 } 55 55 … … 71 71 background-position: 50%!important; 72 72 background-repeat: no-repeat!important; 73 background-size: 4 7%!important;73 background-size: 40%!important; 74 74 } 75 75 … … 79 79 background-position: 50%!important; 80 80 background-repeat: no-repeat!important; 81 background-size: 4 7%!important;81 background-size: 40%!important; 82 82 } 83 83 … … 86 86 background-position: 67% 54%!important; 87 87 background-repeat: no-repeat!important; 88 background-size: 60%!important;88 background-size: 50%!important; 89 89 } 90 90 91 92 93 91 .vjs-wpstream .vjs-fullscreen-control:hover{ 94 background-size: 4 7%!important;92 background-size: 40%!important; 95 93 } 96 94 … … 116 114 border: .06666em solid #595656; 117 115 } 116 117 .video-js.vjs-default-skin .vjs-volume-panel { 118 transition: width 1s; 119 width: 4em; 120 } 121 122 .video-js.vjs-default-skin .vjs-volume-panel:hover .vjs-mute-control { 123 width: 4em; 124 } -
wpstream/tags/4.7/public/js/start_streaming.js
r3296345 r3347939 10 10 wpstream_tooltip(); 11 11 wpstream_copy_to_clipboard(); 12 // Commenting the following line because we are using the new webcaster 12 13 wpstream_webcaster_actions(); 13 14 wpstream_save_options_actions(); … … 674 675 */ 675 676 676 function wpstream_webcaster_actions(){ 677 jQuery('.start_webcaster').on('click',function( ){677 function wpstream_webcaster_actions(){ 678 jQuery('.start_webcaster').on('click',function(event){ 678 679 if(jQuery(this).hasClass('wpstream_inactive_icon')){ 679 680 return; 680 681 } 681 var caster_url = jQuery(this).attr('data-webcaster-url'); 682 jQuery(this).parent().find('.external_software_streaming').slideUp() 683 window.open(caster_url, '_blank', 'location=yes,scrollbars=yes,status=yes'); 682 var $this = jQuery(this); 683 var ajaxurl = wpstream_start_streaming_vars.admin_url + 'admin-ajax.php'; 684 var channelId = jQuery(this).closest('.event_list_unit').data('show-id'); 685 var whipUrl = ''; 686 687 jQuery.ajax({ 688 type: 'POST', 689 dataType: 'json', 690 url: ajaxurl, 691 timeout: 3000000, 692 data: { 693 'action': 'wpstream_check_whipurl', 694 'channel_id': channelId, 695 }, 696 success: function (data) { 697 if( data.success == true ){ 698 whipUrl = data.whip_url; 699 700 if ( whipUrl !== '' ) { 701 // Open the new broadcaster in a new window 702 var broadcasterUrl = wpstream_settings_vars.broadcaster_url + channelId; 703 window.open(broadcasterUrl, 'wpstream_broadcaster_' + channelId, 'fullscreen=yes'); 704 } 705 } else { 706 var caster_url = $this.attr('data-webcaster-url'); 707 $this.parent().find('.external_software_streaming').slideUp() 708 window.open(caster_url, '_blank', 'location=yes,scrollbars=yes,status=yes'); 709 } 710 }, 711 error: function() { 712 console.log('and here') 713 // fallback to the old broadcaster if the AJAX request fails 714 var caster_url = $this.attr('data-webcaster-url'); 715 $this.parent().find('.external_software_streaming').slideUp() 716 window.open(caster_url, '_blank', 'location=yes,scrollbars=yes,status=yes'); 717 } 718 }); 684 719 }) 685 720 } -
wpstream/tags/4.7/readme.txt
r3346758 r3347939 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.1 7 Stable tag: 4. 6.7.97 Stable tag: 4.7 8 8 License: GPL 9 9 License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html … … 138 138 == Changelog == 139 139 140 = 4.7 = 141 * Feature - Improve broadcaster experience with the new browser broadcaster 142 * Fix - Video Player styling fixes 143 140 144 = 4.6.7.9 = 141 145 * Fix - Fix default value for channel settings -
wpstream/tags/4.7/wpstream.php
r3346758 r3347939 4 4 * Plugin URI: http://wpstream.net 5 5 * Description: WpStream is a platform that allows you to live stream, create Video-on-Demand, and offer Pay-Per-View videos. We provide an affordable and user-friendly way for businesses, non-profits, and public institutions to broadcast their content and monetize their work. 6 * Version: 4. 6.7.96 * Version: 4.7 7 7 * Author: wpstream 8 8 * Author URI: http://wpstream.net … … 15 15 die; 16 16 } 17 define('WPSTREAM_PLUGIN_VERSION', '4. 6.7.9');17 define('WPSTREAM_PLUGIN_VERSION', '4.7'); 18 18 define('WPSTREAM_CLUBLINK', 'wpstream.net'); 19 19 define('WPSTREAM_CLUBLINKSSL', 'https'); … … 268 268 } 269 269 } 270 271 /** 272 * Register broadcaster page endpoint 273 */ 274 function wpstream_register_broadcaster_endpoint() { 275 add_rewrite_rule( 276 'broadcaster-page/([0-9]+)/?$', 277 'index.php?broadcaster_page=1&channel_id=$matches[1]', 278 'top' 279 ); 280 281 add_rewrite_tag('%broadcaster_page%', '([0-1]{1})'); 282 add_rewrite_tag('%channel_id%', '([0-9]+)'); 283 } 284 add_action('init', 'wpstream_register_broadcaster_endpoint'); 285 286 /** 287 * Load broadcaster template when the custom endpoint is accessed 288 */ 289 function wpstream_load_broadcaster_template($template) { 290 if (get_query_var('broadcaster_page') == 1) { 291 // Return the path to our broadcaster template 292 return plugin_dir_path(__FILE__) . 'templates/broadcaster-template.php'; 293 } 294 return $template; 295 } 296 add_filter('template_include', 'wpstream_load_broadcaster_template'); 297 298 /** 299 * Flush rewrite rules on plugin activation to ensure our endpoint works 300 */ 301 function wpstream_flush_rewrite_rules() { 302 wpstream_register_broadcaster_endpoint(); 303 flush_rewrite_rules(); 304 } 305 register_activation_hook(__FILE__, 'wpstream_flush_rewrite_rules'); -
wpstream/trunk/admin/class-wpstream-admin.php
r3335660 r3347939 223 223 ); 224 224 225 wp_enqueue_script('wpstream-start-streaming_admin', plugin_dir_url( __DIR__ ) .' /public/js/start_streaming.js?v='.time(),array(), WPSTREAM_PLUGIN_VERSION, true);225 wp_enqueue_script('wpstream-start-streaming_admin', plugin_dir_url( __DIR__ ) .'public/js/start_streaming.js?v='.time(),array(), WPSTREAM_PLUGIN_VERSION, true); 226 226 wp_localize_script('wpstream-start-streaming_admin', 'wpstream_start_streaming_vars', 227 227 array( … … 276 276 'update_successful' => esc_html__( 'Update Successful.', 'wpstream'), 277 277 'update_failed' => esc_html__( 'Something went wrong. Try again.', 'wpstream'), 278 'broadcaster_url' => esc_url( esc_url(home_url('/broadcaster-page/') ) ), 278 279 )); 279 280 … … 286 287 'upload_url' => get_dashboard_url().'admin.php?page=wpstream_recordings' 287 288 288 )); 289 )); 290 291 // wp_enqueue_style( 292 // 'wpstream-broadcaster-css', 293 // plugin_dir_url(__FILE__) . 'public/css/broadcaster.css', 294 // array(), 295 // filemtime(plugin_dir_path(__FILE__) . 'public/css/broadcaster.css' ), 296 // ); 297 // 298 // wp_enqueue_script( 299 // 'wpstream-broadcaster', 300 // plugin_dir_url(__FILE__) . 'public/js/broadcaster.js', 301 // array('jquery'), 302 // WPSTREAM_PLUGIN_VERSION, 303 // true 304 // ); 305 306 // Add localized variables for broadcaster 307 wp_localize_script('wpstream-broadcaster', 'wpstream_broadcaster_vars', array( 308 'ajax_url' => admin_url('admin-ajax.php'), 309 'nonce' => wp_create_nonce('wpstream_broadcaster_nonce'), 310 'plugin_url' => plugin_dir_url(__FILE__), 311 312 )); 289 313 290 314 } … … 802 826 803 827 print '<div class="wpstream_inactive_icon start_webcaster wpstream_stream_browser wpstream-button-icon wpstream_tooltip_wrapper" data-webcaster-url="'.$webcaster_url.'" data-show-id="'.$the_id.'"">'; 804 828 805 829 print '<div class="wpstream_tooltip_disabled">'.esc_html__('Turn ON the channel to go live.','wpestream').'</div>'; 806 830 print '<div class="wpstream_tooltip">'.esc_html__('Go live with your webcam','wpestream').'</div>'; … … 1432 1456 'sea' => esc_html__('Sea','wpstream'), 1433 1457 ), 1434 'details' => esc_html__('Choose the video player theme to have a different look .','wpstream'),1458 'details' => esc_html__('Choose the video player theme to have a different look for the player.','wpstream'), 1435 1459 ), 1436 1460 'wpstream_player_logo' => array( … … 1447 1471 // 'tab' => 'general_options', 1448 1472 // 'name' => 'player_logo_opacity', 1449 // 'label' => esc_html__('Opacity of the player logo','wpstream'),1473 // 'label' => esc_html__('Opacity of the video player logo','wpstream'), 1450 1474 // 'type' => 'range', 1451 1475 // 'details' => esc_html__('Set the opacity of the logo','wpstream'), -
wpstream/trunk/admin/js/wpstream_settings.js
r3316678 r3347939 9 9 10 10 wpstream_update_plugin_support_tab(); 11 12 // wpstream_broadcaster_bind(); 11 13 }); 12 14 … … 202 204 }); 203 205 } 206 207 function wpstream_broadcaster_bind() { 208 jQuery('.start_webcaster').on('click', function(e) { 209 if (jQuery(this).hasClass('wpstream_inactive_icon')) { 210 return; 211 } 212 e.preventDefault(); 213 e.stopPropagation(); 214 215 // Get the channel ID from the data attribute 216 var channelId = jQuery(this).closest('.event_list_unit').data('show-id'); 217 218 if (!channelId) { 219 return; 220 } 221 222 // Open the broadcaster in a new window 223 var broadcasterUrl = wpstream_settings_vars.broadcaster_url + channelId; 224 window.open(broadcasterUrl, 'wpstream_broadcaster_' + channelId, 'fullscreen=yes'); 225 }); 226 227 } -
wpstream/trunk/hello-wpstream/framework/wpstream-video-functions.php
r3346758 r3347939 336 336 $return_string = '<div class="wpstream_not_live_mess wpstream_theme_not_live_section "><div class="wpstream_not_live_mess_back"></div>'; 337 337 $return_string .= '<div class="wpstream_not_live_mess_mess">'; 338 if ( isset($event_data['status']) && $event_data['status'] === 'stopped' ) { 338 339 if ( ( isset( $event_data['status']) && 340 in_array( $event_data['status'], array( 'stopped', 'stopping', 'starting' ) ) ) || 341 ( isset($event_data['error']) && $event_data['error'] === 'NO_SUCH_CHANNEL' ) ){ 339 342 $return_string .= esc_html( get_option( 'wpstream_you_are_not_live', 'We are not live at this moment' ) );; 340 343 } -
wpstream/trunk/includes/class-wpstream-ajax.php
r3335660 r3347939 20 20 21 21 add_action( 'wp_ajax_wpstream_get_videos_list', [$this,'wpstream_get_videos_list'] ); 22 22 add_action('wp_ajax_wpstream_get_broadcaster_info', array($this, 'wpstream_get_broadcaster_info')); 23 23 24 // Add the dashboard AJAX actions 24 25 add_action( 'wp_ajax_wpstream_dashboard_save_channel_data', [$this, 'wpstream_dashboard_save_channel_data'] ); … … 30 31 add_action( 'wp_ajax_wpstream_handle_channel_details_saving', [$this, 'wpstream_handle_channel_details_saving'] ); 31 32 add_action( 'wp_ajax_wpstream_remove_post_id', [$this, 'wpstream_remove_post_id_callback'] ); 32 33 33 34 // Enqueue dashboard scripts 34 35 add_action( 'wp_enqueue_scripts', [$this, 'wpstream_enqueue_dashboard_scripts'] ); … … 48 49 true 49 50 ); 50 51 51 52 wp_localize_script( 'wpstream-dashboard-script', 'wpstream_dashboard_script_vars', array( 52 53 'ajaxurl' => admin_url( 'admin-ajax.php' ), … … 82 83 die(); 83 84 } 84 85 86 /** 87 * AJAX handler to get broadcaster information 88 */ 89 public function wpstream_get_broadcaster_info() { 90 // Verify nonce 91 check_ajax_referer('wpstream_broadcaster_nonce', 'nonce'); 92 93 // Check permissions 94 if (!current_user_can('publish_posts')) { 95 wp_send_json_error('Insufficient permissions'); 96 return; 97 } 98 99 $channel_id = isset($_POST['channel_id']) ? intval($_POST['channel_id']) : 0; 100 101 if (empty($channel_id)) { 102 wp_send_json_error('Invalid channel ID'); 103 return; 104 } 105 106 // Get RTMP URL from post meta 107 $obs_uri = get_post_meta($channel_id, 'obs_uri', true); 108 $obs_stream = get_post_meta($channel_id, 'obs_stream', true); 109 110 if (empty($obs_uri) || empty($obs_stream)) { 111 wp_send_json_error('RTMP information not available'); 112 return; 113 } 114 115 wp_send_json_success([ 116 'rtmp_url' => $obs_uri, 117 'stream_key' => $obs_stream 118 ]); 119 } 120 85 121 /** 86 122 * Saves channel data from the dashboard. … … 129 165 set_post_thumbnail( $postID, $thumb_id ); 130 166 131 167 132 168 /* 133 169 * Manage images … … 138 174 update_post_meta( $postID, '_product_image_gallery', $images ); 139 175 } else { 140 176 141 177 $images_array = explode( ',', $images ); 142 178 delete_post_meta( $postID, 'wpstream_theme_gallery' ); … … 187 223 } 188 224 } 189 225 190 226 /** 191 227 * Return the image gallery for a post. … … 219 255 return array_filter( $gallery_images ); 220 256 } 221 257 222 258 /** 223 259 * Returns information about taxonomies for the specified post. … … 361 397 return $return_string; 362 398 } 363 399 364 400 /** 365 401 * Save user address data from dashboard. … … 383 419 } 384 420 } 385 421 386 422 387 423 wp_send_json_success( … … 394 430 die(); 395 431 } 396 432 397 433 /** 398 434 * Delete profile attachment … … 453 489 die(); 454 490 } 455 491 456 492 /** 457 493 * Dashboard save user data … … 629 665 wp_die(); 630 666 } 631 667 632 668 /** 633 669 * Handle channel creation. … … 643 679 } 644 680 $current_user = wp_get_current_user(); 645 681 646 682 // These functions should be implemented in the plugin or be accessible 647 683 $maxim_channels_per_user = function_exists('wpstream_return_max_channels_per_user') ? wpstream_return_max_channels_per_user() : 100; … … 809 845 wp_die(); 810 846 } 811 847 812 848 /** 813 849 * Callback handler to remove a post ID from the "watch later" list. -
wpstream/trunk/includes/class-wpstream-live-api-connection.php
r3346758 r3347939 15 15 add_action( 'wp_ajax_wpstream_check_dns_sync', array($this,'wpstream_check_dns_sync') ); 16 16 add_action( 'wp_ajax_wpstream_check_event_status', array($this,'wpstream_check_event_status') ); 17 17 add_action( 'wp_ajax_wpstream_check_whipurl', array($this, 'wpstream_check_whipurl') ); 18 add_action( 'wp_ajax_wpstream_check_user_quota', array($this, 'wpstream_check_user_quota') ); 19 18 20 add_action( 'wp_ajax_wpstream_close_event', array($this,'wpstream_close_event') ); 19 21 add_action( 'wp_ajax_wpstream_get_download_link', array($this,'wpstream_get_download_link') ); … … 308 310 309 311 } 312 313 public function wpstream_check_whipurl() { 314 $channel_id = intval($_POST['channel_id']); 315 316 $whip_url = get_post_meta($channel_id, 'whipUrl', true); 317 318 if ( $whip_url ) { 319 print json_encode( 320 array( 321 'success' => true, 322 'whip_url' => $whip_url, 323 ) 324 ); 325 } else { 326 print json_encode( 327 array( 328 'success' => false, 329 'error' => esc_html__('WHIP URL not found for this channel.', 'wpstream'), 330 ) 331 ); 332 } 333 die(); 334 } 310 335 311 336 /** … … 1110 1135 1111 1136 1137 public function wpstream_check_user_quota() { 1138 $pack_data = $this->wpstream_request_pack_data_per_user(); 1139 if ( ! $pack_data || ! isset( $pack_data['success'] ) || ! $pack_data['success'] ) { 1140 print json_encode( 1141 array( 1142 'success' => false, 1143 'error' => esc_html__('Couldn\'t get user quota.', 'wpstream'), 1144 ) 1145 ); 1146 } else { 1147 print json_encode($pack_data); 1148 } 1149 die(); 1150 } 1112 1151 1113 1152 -
wpstream/trunk/includes/class-wpstream-player.php
r3337309 r3347939 52 52 if ( false === $event_data_for_transient || $event_data_for_transient=='' ) { //ws || $hls_to_return=='' 53 53 $notes = 'wpstream_player_check_status_note_from_js'; 54 $event_status = $this->main->wpstream_live_connection-> wpstream_check_event_status_api_call($channel_id,$notes);54 $event_status = $this->main->wpstream_live_connection->wpstream_check_event_status_api_call($channel_id,$notes); 55 55 $event_data_for_transient = $event_status; 56 56 $usefull_info =' no cache found'; -
wpstream/trunk/public/class-wpstream-public.php
r3335660 r3347939 72 72 73 73 wp_enqueue_style('wpstream-style', plugin_dir_url( __FILE__ ) .'/css/wpstream_style.css',array(), WPSTREAM_PLUGIN_VERSION, 'all' ); 74 wp_enqueue_style('video-js.min', plugin_dir_url( __FILE__ ).' /css/video-js.css', array(), WPSTREAM_PLUGIN_VERSION, 'all');74 wp_enqueue_style('video-js.min', plugin_dir_url( __FILE__ ).'css/video-js.css', array(), WPSTREAM_PLUGIN_VERSION, 'all'); 75 75 wp_enqueue_style( 76 76 'videojs-wpstream-player', 77 plugin_dir_url( __FILE__ ).' /css/videojs-wpstream.css',77 plugin_dir_url( __FILE__ ).'css/videojs-wpstream.css', 78 78 array(), 79 79 WPSTREAM_PLUGIN_VERSION . '.' . filemtime( plugin_dir_path(__FILE__) . 'css/videojs-wpstream.css' ), … … 199 199 } 200 200 201 wp_enqueue_script('wpstream-integrations', plugin_dir_url( __DIR__ ) .' /integrations/js/integrations.js?v='.time(),array(), WPSTREAM_PLUGIN_VERSION, true);201 wp_enqueue_script('wpstream-integrations', plugin_dir_url( __DIR__ ) .'integrations/js/integrations.js?v='.time(),array(), WPSTREAM_PLUGIN_VERSION, true); 202 202 wp_localize_script('wpstream-integrations', 'wpstream_integrations_vars', $integrations_array ); 203 203 … … 222 222 ) 223 223 ); 224 225 wp_enqueue_style( 226 'wpstream-broadcaster-css', 227 WPSTREAM_PLUGIN_DIR_URL . 'public/css/broadcaster.css', 228 array(), 229 filemtime( WPSTREAM_PLUGIN_PATH . 'public/css/broadcaster.css' ) , 230 ); 231 232 // wp_enqueue_script( 233 // 'wpstream-broadcaster', 234 // WPSTREAM_PLUGIN_DIR_URL . 'public/js/broadcaster.js', 235 // array('jquery'), 236 // filemtime( WPSTREAM_PLUGIN_PATH . 'public/js/broadcaster.js' ), 237 // true 238 // ); 239 // 240 // // Add localized variables for broadcaster 241 // wp_localize_script('wpstream-broadcaster', 'wpstream_broadcaster_vars', array( 242 // 'ajax_url' => admin_url('admin-ajax.php'), 243 // 'nonce' => wp_create_nonce('wpstream_broadcaster_nonce'), 244 // 'plugin_url' => plugin_dir_url(__FILE__), 245 // 'obs_uri' => '', 246 // )); 224 247 } 225 248 226 249 227 250 228 251 -
wpstream/trunk/public/css/video-js.css
r3312871 r3347939 598 598 599 599 .video-js:not(.vjs-theme-default) .vjs-control-bar { 600 height: 54px; 600 height: 4em; 601 } 602 603 .vjs-wpstream.vjs-default-skin .vjs-volume-panel { 604 height: 4em; 605 } 606 607 .vjs-wpstream.vjs-default-skin .vjs-live-control { 608 max-height: 100%; 609 } 610 611 .vjs-wpstream.vjs-default-skin .vjs-volume-panel .vjs-volume-control .vjs-volume-tooltip { 612 display: none; 613 } 614 615 .wpstream-spinner { 616 width: 40px; 617 height: 40px; 618 border: 4px solid #f3f3f3; 619 border-top: 4px solid #3498db; 620 border-radius: 50%; 621 animation: wpstream-spin 1s linear infinite; 622 margin: 0 auto; 623 } 624 625 @keyframes wpstream-spin { 626 0% { transform: rotate(0deg); } 627 100% { transform: rotate(360deg); } 601 628 } 602 629 … … 1037 1064 width: 1px; 1038 1065 height: 1px; 1039 margin-left: -1px; } 1066 margin-left: -1px; 1067 1068 } 1040 1069 1041 1070 .video-js .vjs-volume-panel { … … 1292 1321 transform: translateY(-1.5em); } 1293 1322 1294 .video-js .vjs-fullscreen-control {1323 .video-js .vjs-fullscreen-control, .video-js .vjs-picture-in-picture-control { 1295 1324 cursor: pointer; 1296 1325 flex: none; } -
wpstream/trunk/public/css/videojs-wpstream.css
r3346758 r3347939 51 51 52 52 .wpstream-featured-player-wrapper .vjs-live-display { 53 margin-top: 0 ;53 margin-top: 0 !important; 54 54 } 55 55 … … 71 71 background-position: 50%!important; 72 72 background-repeat: no-repeat!important; 73 background-size: 4 7%!important;73 background-size: 40%!important; 74 74 } 75 75 … … 79 79 background-position: 50%!important; 80 80 background-repeat: no-repeat!important; 81 background-size: 4 7%!important;81 background-size: 40%!important; 82 82 } 83 83 … … 86 86 background-position: 67% 54%!important; 87 87 background-repeat: no-repeat!important; 88 background-size: 60%!important;88 background-size: 50%!important; 89 89 } 90 90 91 92 93 91 .vjs-wpstream .vjs-fullscreen-control:hover{ 94 background-size: 4 7%!important;92 background-size: 40%!important; 95 93 } 96 94 … … 116 114 border: .06666em solid #595656; 117 115 } 116 117 .video-js.vjs-default-skin .vjs-volume-panel { 118 transition: width 1s; 119 width: 4em; 120 } 121 122 .video-js.vjs-default-skin .vjs-volume-panel:hover .vjs-mute-control { 123 width: 4em; 124 } -
wpstream/trunk/public/js/start_streaming.js
r3296345 r3347939 10 10 wpstream_tooltip(); 11 11 wpstream_copy_to_clipboard(); 12 // Commenting the following line because we are using the new webcaster 12 13 wpstream_webcaster_actions(); 13 14 wpstream_save_options_actions(); … … 674 675 */ 675 676 676 function wpstream_webcaster_actions(){ 677 jQuery('.start_webcaster').on('click',function( ){677 function wpstream_webcaster_actions(){ 678 jQuery('.start_webcaster').on('click',function(event){ 678 679 if(jQuery(this).hasClass('wpstream_inactive_icon')){ 679 680 return; 680 681 } 681 var caster_url = jQuery(this).attr('data-webcaster-url'); 682 jQuery(this).parent().find('.external_software_streaming').slideUp() 683 window.open(caster_url, '_blank', 'location=yes,scrollbars=yes,status=yes'); 682 var $this = jQuery(this); 683 var ajaxurl = wpstream_start_streaming_vars.admin_url + 'admin-ajax.php'; 684 var channelId = jQuery(this).closest('.event_list_unit').data('show-id'); 685 var whipUrl = ''; 686 687 jQuery.ajax({ 688 type: 'POST', 689 dataType: 'json', 690 url: ajaxurl, 691 timeout: 3000000, 692 data: { 693 'action': 'wpstream_check_whipurl', 694 'channel_id': channelId, 695 }, 696 success: function (data) { 697 if( data.success == true ){ 698 whipUrl = data.whip_url; 699 700 if ( whipUrl !== '' ) { 701 // Open the new broadcaster in a new window 702 var broadcasterUrl = wpstream_settings_vars.broadcaster_url + channelId; 703 window.open(broadcasterUrl, 'wpstream_broadcaster_' + channelId, 'fullscreen=yes'); 704 } 705 } else { 706 var caster_url = $this.attr('data-webcaster-url'); 707 $this.parent().find('.external_software_streaming').slideUp() 708 window.open(caster_url, '_blank', 'location=yes,scrollbars=yes,status=yes'); 709 } 710 }, 711 error: function() { 712 console.log('and here') 713 // fallback to the old broadcaster if the AJAX request fails 714 var caster_url = $this.attr('data-webcaster-url'); 715 $this.parent().find('.external_software_streaming').slideUp() 716 window.open(caster_url, '_blank', 'location=yes,scrollbars=yes,status=yes'); 717 } 718 }); 684 719 }) 685 720 } -
wpstream/trunk/readme.txt
r3346758 r3347939 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.1 7 Stable tag: 4. 6.7.97 Stable tag: 4.7 8 8 License: GPL 9 9 License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html … … 138 138 == Changelog == 139 139 140 = 4.7 = 141 * Feature - Improve broadcaster experience with the new browser broadcaster 142 * Fix - Video Player styling fixes 143 140 144 = 4.6.7.9 = 141 145 * Fix - Fix default value for channel settings -
wpstream/trunk/wpstream.php
r3346758 r3347939 4 4 * Plugin URI: http://wpstream.net 5 5 * Description: WpStream is a platform that allows you to live stream, create Video-on-Demand, and offer Pay-Per-View videos. We provide an affordable and user-friendly way for businesses, non-profits, and public institutions to broadcast their content and monetize their work. 6 * Version: 4. 6.7.96 * Version: 4.7 7 7 * Author: wpstream 8 8 * Author URI: http://wpstream.net … … 15 15 die; 16 16 } 17 define('WPSTREAM_PLUGIN_VERSION', '4. 6.7.9');17 define('WPSTREAM_PLUGIN_VERSION', '4.7'); 18 18 define('WPSTREAM_CLUBLINK', 'wpstream.net'); 19 19 define('WPSTREAM_CLUBLINKSSL', 'https'); … … 268 268 } 269 269 } 270 271 /** 272 * Register broadcaster page endpoint 273 */ 274 function wpstream_register_broadcaster_endpoint() { 275 add_rewrite_rule( 276 'broadcaster-page/([0-9]+)/?$', 277 'index.php?broadcaster_page=1&channel_id=$matches[1]', 278 'top' 279 ); 280 281 add_rewrite_tag('%broadcaster_page%', '([0-1]{1})'); 282 add_rewrite_tag('%channel_id%', '([0-9]+)'); 283 } 284 add_action('init', 'wpstream_register_broadcaster_endpoint'); 285 286 /** 287 * Load broadcaster template when the custom endpoint is accessed 288 */ 289 function wpstream_load_broadcaster_template($template) { 290 if (get_query_var('broadcaster_page') == 1) { 291 // Return the path to our broadcaster template 292 return plugin_dir_path(__FILE__) . 'templates/broadcaster-template.php'; 293 } 294 return $template; 295 } 296 add_filter('template_include', 'wpstream_load_broadcaster_template'); 297 298 /** 299 * Flush rewrite rules on plugin activation to ensure our endpoint works 300 */ 301 function wpstream_flush_rewrite_rules() { 302 wpstream_register_broadcaster_endpoint(); 303 flush_rewrite_rules(); 304 } 305 register_activation_hook(__FILE__, 'wpstream_flush_rewrite_rules');
Note: See TracChangeset
for help on using the changeset viewer.