Plugin Directory

Changeset 3347939


Ignore:
Timestamp:
08/21/2025 07:35:58 AM (7 months ago)
Author:
wpstream
Message:

Update to version 4.7 from GitHub

Location:
wpstream
Files:
16 added
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wpstream/tags/4.7/admin/class-wpstream-admin.php

    r3335660 r3347939  
    223223                );
    224224               
    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);
    226226                wp_localize_script('wpstream-start-streaming_admin', 'wpstream_start_streaming_vars',
    227227                    array(
     
    276276                        'update_successful' => esc_html__( 'Update Successful.', 'wpstream'),
    277277                        'update_failed'     => esc_html__( 'Something went wrong. Try again.', 'wpstream'),
     278                        'broadcaster_url' => esc_url( esc_url(home_url('/broadcaster-page/') ) ),
    278279                ));
    279280
     
    286287                            'upload_url'            =>  get_dashboard_url().'admin.php?page=wpstream_recordings'
    287288                   
    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        ));
    289313               
    290314        }
     
    802826                   
    803827                    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
    805829                        print '<div class="wpstream_tooltip_disabled">'.esc_html__('Turn ON the channel to go live.','wpestream').'</div>';
    806830                        print '<div class="wpstream_tooltip">'.esc_html__('Go live with your webcam','wpestream').'</div>';
     
    14321456                                'sea' => esc_html__('Sea','wpstream'),
    14331457                            ),
    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'),
    14351459                        ),
    14361460                'wpstream_player_logo' => array(
     
    14471471//                        'tab' => 'general_options',
    14481472//                        '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'),
    14501474//                        'type' => 'range',
    14511475//                        'details' => esc_html__('Set the opacity of the logo','wpstream'),
  • wpstream/tags/4.7/admin/js/wpstream_settings.js

    r3316678 r3347939  
    99
    1010    wpstream_update_plugin_support_tab();
     11
     12    // wpstream_broadcaster_bind();
    1113});
    1214
     
    202204    });
    203205}
     206
     207function 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  
    336336    $return_string  = '<div class="wpstream_not_live_mess wpstream_theme_not_live_section "><div class="wpstream_not_live_mess_back"></div>';
    337337    $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' ) ){
    339342        $return_string  .= esc_html( get_option( 'wpstream_you_are_not_live', 'We are not live at this moment' ) );;
    340343    }
  • wpstream/tags/4.7/includes/class-wpstream-ajax.php

    r3335660 r3347939  
    2020
    2121        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
    2324        // Add the dashboard AJAX actions
    2425        add_action( 'wp_ajax_wpstream_dashboard_save_channel_data', [$this, 'wpstream_dashboard_save_channel_data'] );
     
    3031        add_action( 'wp_ajax_wpstream_handle_channel_details_saving', [$this, 'wpstream_handle_channel_details_saving'] );
    3132        add_action( 'wp_ajax_wpstream_remove_post_id', [$this, 'wpstream_remove_post_id_callback'] );
    32        
     33
    3334        // Enqueue dashboard scripts
    3435        add_action( 'wp_enqueue_scripts', [$this, 'wpstream_enqueue_dashboard_scripts'] );
     
    4849                true
    4950            );
    50            
     51
    5152            wp_localize_script( 'wpstream-dashboard-script', 'wpstream_dashboard_script_vars', array(
    5253                'ajaxurl' => admin_url( 'admin-ajax.php' ),
     
    8283        die();
    8384    }
    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
    85121    /**
    86122     * Saves channel data from the dashboard.
     
    129165            set_post_thumbnail( $postID, $thumb_id );
    130166
    131        
     167
    132168            /*
    133169            * Manage images
     
    138174                update_post_meta( $postID, '_product_image_gallery', $images );
    139175            } else {
    140                
     176
    141177                $images_array = explode( ',', $images );
    142178                            delete_post_meta( $postID, 'wpstream_theme_gallery' );
     
    187223        }
    188224    }
    189    
     225
    190226    /**
    191227     * Return the image gallery for a post.
     
    219255        return array_filter( $gallery_images );
    220256    }
    221    
     257
    222258    /**
    223259     * Returns information about taxonomies for the specified post.
     
    361397        return $return_string;
    362398    }
    363    
     399
    364400    /**
    365401     * Save user address data from dashboard.
     
    383419            }
    384420        }
    385        
     421
    386422
    387423        wp_send_json_success(
     
    394430        die();
    395431    }
    396    
     432
    397433    /**
    398434     * Delete profile attachment
     
    453489        die();
    454490    }
    455    
     491
    456492    /**
    457493     * Dashboard save user data
     
    629665        wp_die();
    630666    }
    631    
     667
    632668    /**
    633669     * Handle channel creation.
     
    643679        }
    644680        $current_user = wp_get_current_user();
    645        
     681
    646682        // These functions should be implemented in the plugin or be accessible
    647683        $maxim_channels_per_user = function_exists('wpstream_return_max_channels_per_user') ? wpstream_return_max_channels_per_user() : 100;
     
    809845        wp_die();
    810846    }
    811    
     847
    812848    /**
    813849     * 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  
    1515        add_action( 'wp_ajax_wpstream_check_dns_sync', array($this,'wpstream_check_dns_sync') );
    1616        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
    1820        add_action( 'wp_ajax_wpstream_close_event', array($this,'wpstream_close_event') );
    1921        add_action( 'wp_ajax_wpstream_get_download_link', array($this,'wpstream_get_download_link') ); 
     
    308310                 
    309311    }
     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    }
    310335   
    311336    /**
     
    11101135   
    11111136
     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    }
    11121151
    11131152
  • wpstream/tags/4.7/includes/class-wpstream-player.php

    r3337309 r3347939  
    5252        if ( false ===  $event_data_for_transient || $event_data_for_transient=='' ) { //ws || $hls_to_return==''       
    5353            $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);
    5555            $event_data_for_transient   =   $event_status;
    5656            $usefull_info =' no cache found';
  • wpstream/tags/4.7/public/class-wpstream-public.php

    r3335660 r3347939  
    7272
    7373            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');
    7575            wp_enqueue_style(
    7676                'videojs-wpstream-player',
    77                 plugin_dir_url( __FILE__ ).'/css/videojs-wpstream.css',
     77                plugin_dir_url( __FILE__ ).'css/videojs-wpstream.css',
    7878                array(),
    7979                WPSTREAM_PLUGIN_VERSION . '.' . filemtime( plugin_dir_path(__FILE__) . 'css/videojs-wpstream.css' ),
     
    199199                    }
    200200               
    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);
    202202                    wp_localize_script('wpstream-integrations', 'wpstream_integrations_vars', $integrations_array );
    203203
     
    222222            )
    223223        );
     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//      ));
    224247    }
    225248
    226        
     249
    227250       
    228251     
  • wpstream/tags/4.7/public/css/video-js.css

    r3312871 r3347939  
    598598
    599599.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); }
    601628}
    602629
     
    10371064  width: 1px;
    10381065  height: 1px;
    1039   margin-left: -1px; }
     1066  margin-left: -1px;
     1067
     1068}
    10401069
    10411070.video-js .vjs-volume-panel {
     
    12921321  transform: translateY(-1.5em); }
    12931322
    1294 .video-js .vjs-fullscreen-control {
     1323.video-js .vjs-fullscreen-control, .video-js .vjs-picture-in-picture-control {
    12951324  cursor: pointer;
    12961325  flex: none; }
  • wpstream/tags/4.7/public/css/videojs-wpstream.css

    r3346758 r3347939  
    5151
    5252.wpstream-featured-player-wrapper .vjs-live-display {
    53     margin-top: 0;
     53    margin-top: 0 !important;
    5454}
    5555
     
    7171    background-position: 50%!important;
    7272    background-repeat: no-repeat!important;
    73     background-size: 47%!important;
     73    background-size: 40%!important;
    7474}
    7575
     
    7979    background-position: 50%!important;
    8080    background-repeat: no-repeat!important;
    81     background-size: 47%!important;
     81    background-size: 40%!important;
    8282}
    8383
     
    8686    background-position: 67% 54%!important;
    8787    background-repeat: no-repeat!important;
    88     background-size: 60%!important;
     88    background-size: 50%!important;
    8989}
    9090
    91 
    92 
    9391.vjs-wpstream  .vjs-fullscreen-control:hover{
    94     background-size: 47%!important;
     92    background-size: 40%!important;
    9593}
    9694
     
    116114    border: .06666em solid #595656;
    117115}
     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  
    1010    wpstream_tooltip();
    1111    wpstream_copy_to_clipboard();
     12    // Commenting the following line because we are using the new webcaster
    1213    wpstream_webcaster_actions();
    1314    wpstream_save_options_actions();
     
    674675*/
    675676
    676 function wpstream_webcaster_actions(){   
    677     jQuery('.start_webcaster').on('click',function(){   
     677function wpstream_webcaster_actions(){
     678    jQuery('.start_webcaster').on('click',function(event){
    678679        if(jQuery(this).hasClass('wpstream_inactive_icon')){
    679680            return;
    680681        }
    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        });
    684719    })
    685720}
  • wpstream/tags/4.7/readme.txt

    r3346758 r3347939  
    55Tested up to: 6.8
    66Requires PHP: 7.1
    7 Stable tag: 4.6.7.9
     7Stable tag: 4.7
    88License: GPL
    99License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    138138== Changelog ==
    139139
     140= 4.7 =
     141* Feature - Improve broadcaster experience with the new browser broadcaster
     142* Fix - Video Player styling fixes
     143
    140144= 4.6.7.9 =
    141145* Fix - Fix default value for channel settings
  • wpstream/tags/4.7/wpstream.php

    r3346758 r3347939  
    44 * Plugin URI:        http://wpstream.net
    55 * 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.9
     6 * Version:           4.7
    77 * Author:            wpstream
    88 * Author URI:        http://wpstream.net
     
    1515    die;
    1616}
    17 define('WPSTREAM_PLUGIN_VERSION', '4.6.7.9');
     17define('WPSTREAM_PLUGIN_VERSION', '4.7');
    1818define('WPSTREAM_CLUBLINK', 'wpstream.net');
    1919define('WPSTREAM_CLUBLINKSSL', 'https');
     
    268268    }
    269269}
     270
     271/**
     272 * Register broadcaster page endpoint
     273 */
     274function 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}
     284add_action('init', 'wpstream_register_broadcaster_endpoint');
     285
     286/**
     287 * Load broadcaster template when the custom endpoint is accessed
     288 */
     289function 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}
     296add_filter('template_include', 'wpstream_load_broadcaster_template');
     297
     298/**
     299 * Flush rewrite rules on plugin activation to ensure our endpoint works
     300 */
     301function wpstream_flush_rewrite_rules() {
     302    wpstream_register_broadcaster_endpoint();
     303    flush_rewrite_rules();
     304}
     305register_activation_hook(__FILE__, 'wpstream_flush_rewrite_rules');
  • wpstream/trunk/admin/class-wpstream-admin.php

    r3335660 r3347939  
    223223                );
    224224               
    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);
    226226                wp_localize_script('wpstream-start-streaming_admin', 'wpstream_start_streaming_vars',
    227227                    array(
     
    276276                        'update_successful' => esc_html__( 'Update Successful.', 'wpstream'),
    277277                        'update_failed'     => esc_html__( 'Something went wrong. Try again.', 'wpstream'),
     278                        'broadcaster_url' => esc_url( esc_url(home_url('/broadcaster-page/') ) ),
    278279                ));
    279280
     
    286287                            'upload_url'            =>  get_dashboard_url().'admin.php?page=wpstream_recordings'
    287288                   
    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        ));
    289313               
    290314        }
     
    802826                   
    803827                    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
    805829                        print '<div class="wpstream_tooltip_disabled">'.esc_html__('Turn ON the channel to go live.','wpestream').'</div>';
    806830                        print '<div class="wpstream_tooltip">'.esc_html__('Go live with your webcam','wpestream').'</div>';
     
    14321456                                'sea' => esc_html__('Sea','wpstream'),
    14331457                            ),
    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'),
    14351459                        ),
    14361460                'wpstream_player_logo' => array(
     
    14471471//                        'tab' => 'general_options',
    14481472//                        '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'),
    14501474//                        'type' => 'range',
    14511475//                        'details' => esc_html__('Set the opacity of the logo','wpstream'),
  • wpstream/trunk/admin/js/wpstream_settings.js

    r3316678 r3347939  
    99
    1010    wpstream_update_plugin_support_tab();
     11
     12    // wpstream_broadcaster_bind();
    1113});
    1214
     
    202204    });
    203205}
     206
     207function 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  
    336336    $return_string  = '<div class="wpstream_not_live_mess wpstream_theme_not_live_section "><div class="wpstream_not_live_mess_back"></div>';
    337337    $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' ) ){
    339342        $return_string  .= esc_html( get_option( 'wpstream_you_are_not_live', 'We are not live at this moment' ) );;
    340343    }
  • wpstream/trunk/includes/class-wpstream-ajax.php

    r3335660 r3347939  
    2020
    2121        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
    2324        // Add the dashboard AJAX actions
    2425        add_action( 'wp_ajax_wpstream_dashboard_save_channel_data', [$this, 'wpstream_dashboard_save_channel_data'] );
     
    3031        add_action( 'wp_ajax_wpstream_handle_channel_details_saving', [$this, 'wpstream_handle_channel_details_saving'] );
    3132        add_action( 'wp_ajax_wpstream_remove_post_id', [$this, 'wpstream_remove_post_id_callback'] );
    32        
     33
    3334        // Enqueue dashboard scripts
    3435        add_action( 'wp_enqueue_scripts', [$this, 'wpstream_enqueue_dashboard_scripts'] );
     
    4849                true
    4950            );
    50            
     51
    5152            wp_localize_script( 'wpstream-dashboard-script', 'wpstream_dashboard_script_vars', array(
    5253                'ajaxurl' => admin_url( 'admin-ajax.php' ),
     
    8283        die();
    8384    }
    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
    85121    /**
    86122     * Saves channel data from the dashboard.
     
    129165            set_post_thumbnail( $postID, $thumb_id );
    130166
    131        
     167
    132168            /*
    133169            * Manage images
     
    138174                update_post_meta( $postID, '_product_image_gallery', $images );
    139175            } else {
    140                
     176
    141177                $images_array = explode( ',', $images );
    142178                            delete_post_meta( $postID, 'wpstream_theme_gallery' );
     
    187223        }
    188224    }
    189    
     225
    190226    /**
    191227     * Return the image gallery for a post.
     
    219255        return array_filter( $gallery_images );
    220256    }
    221    
     257
    222258    /**
    223259     * Returns information about taxonomies for the specified post.
     
    361397        return $return_string;
    362398    }
    363    
     399
    364400    /**
    365401     * Save user address data from dashboard.
     
    383419            }
    384420        }
    385        
     421
    386422
    387423        wp_send_json_success(
     
    394430        die();
    395431    }
    396    
     432
    397433    /**
    398434     * Delete profile attachment
     
    453489        die();
    454490    }
    455    
     491
    456492    /**
    457493     * Dashboard save user data
     
    629665        wp_die();
    630666    }
    631    
     667
    632668    /**
    633669     * Handle channel creation.
     
    643679        }
    644680        $current_user = wp_get_current_user();
    645        
     681
    646682        // These functions should be implemented in the plugin or be accessible
    647683        $maxim_channels_per_user = function_exists('wpstream_return_max_channels_per_user') ? wpstream_return_max_channels_per_user() : 100;
     
    809845        wp_die();
    810846    }
    811    
     847
    812848    /**
    813849     * Callback handler to remove a post ID from the "watch later" list.
  • wpstream/trunk/includes/class-wpstream-live-api-connection.php

    r3346758 r3347939  
    1515        add_action( 'wp_ajax_wpstream_check_dns_sync', array($this,'wpstream_check_dns_sync') );
    1616        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
    1820        add_action( 'wp_ajax_wpstream_close_event', array($this,'wpstream_close_event') );
    1921        add_action( 'wp_ajax_wpstream_get_download_link', array($this,'wpstream_get_download_link') ); 
     
    308310                 
    309311    }
     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    }
    310335   
    311336    /**
     
    11101135   
    11111136
     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    }
    11121151
    11131152
  • wpstream/trunk/includes/class-wpstream-player.php

    r3337309 r3347939  
    5252        if ( false ===  $event_data_for_transient || $event_data_for_transient=='' ) { //ws || $hls_to_return==''       
    5353            $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);
    5555            $event_data_for_transient   =   $event_status;
    5656            $usefull_info =' no cache found';
  • wpstream/trunk/public/class-wpstream-public.php

    r3335660 r3347939  
    7272
    7373            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');
    7575            wp_enqueue_style(
    7676                'videojs-wpstream-player',
    77                 plugin_dir_url( __FILE__ ).'/css/videojs-wpstream.css',
     77                plugin_dir_url( __FILE__ ).'css/videojs-wpstream.css',
    7878                array(),
    7979                WPSTREAM_PLUGIN_VERSION . '.' . filemtime( plugin_dir_path(__FILE__) . 'css/videojs-wpstream.css' ),
     
    199199                    }
    200200               
    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);
    202202                    wp_localize_script('wpstream-integrations', 'wpstream_integrations_vars', $integrations_array );
    203203
     
    222222            )
    223223        );
     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//      ));
    224247    }
    225248
    226        
     249
    227250       
    228251     
  • wpstream/trunk/public/css/video-js.css

    r3312871 r3347939  
    598598
    599599.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); }
    601628}
    602629
     
    10371064  width: 1px;
    10381065  height: 1px;
    1039   margin-left: -1px; }
     1066  margin-left: -1px;
     1067
     1068}
    10401069
    10411070.video-js .vjs-volume-panel {
     
    12921321  transform: translateY(-1.5em); }
    12931322
    1294 .video-js .vjs-fullscreen-control {
     1323.video-js .vjs-fullscreen-control, .video-js .vjs-picture-in-picture-control {
    12951324  cursor: pointer;
    12961325  flex: none; }
  • wpstream/trunk/public/css/videojs-wpstream.css

    r3346758 r3347939  
    5151
    5252.wpstream-featured-player-wrapper .vjs-live-display {
    53     margin-top: 0;
     53    margin-top: 0 !important;
    5454}
    5555
     
    7171    background-position: 50%!important;
    7272    background-repeat: no-repeat!important;
    73     background-size: 47%!important;
     73    background-size: 40%!important;
    7474}
    7575
     
    7979    background-position: 50%!important;
    8080    background-repeat: no-repeat!important;
    81     background-size: 47%!important;
     81    background-size: 40%!important;
    8282}
    8383
     
    8686    background-position: 67% 54%!important;
    8787    background-repeat: no-repeat!important;
    88     background-size: 60%!important;
     88    background-size: 50%!important;
    8989}
    9090
    91 
    92 
    9391.vjs-wpstream  .vjs-fullscreen-control:hover{
    94     background-size: 47%!important;
     92    background-size: 40%!important;
    9593}
    9694
     
    116114    border: .06666em solid #595656;
    117115}
     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  
    1010    wpstream_tooltip();
    1111    wpstream_copy_to_clipboard();
     12    // Commenting the following line because we are using the new webcaster
    1213    wpstream_webcaster_actions();
    1314    wpstream_save_options_actions();
     
    674675*/
    675676
    676 function wpstream_webcaster_actions(){   
    677     jQuery('.start_webcaster').on('click',function(){   
     677function wpstream_webcaster_actions(){
     678    jQuery('.start_webcaster').on('click',function(event){
    678679        if(jQuery(this).hasClass('wpstream_inactive_icon')){
    679680            return;
    680681        }
    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        });
    684719    })
    685720}
  • wpstream/trunk/readme.txt

    r3346758 r3347939  
    55Tested up to: 6.8
    66Requires PHP: 7.1
    7 Stable tag: 4.6.7.9
     7Stable tag: 4.7
    88License: GPL
    99License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    138138== Changelog ==
    139139
     140= 4.7 =
     141* Feature - Improve broadcaster experience with the new browser broadcaster
     142* Fix - Video Player styling fixes
     143
    140144= 4.6.7.9 =
    141145* Fix - Fix default value for channel settings
  • wpstream/trunk/wpstream.php

    r3346758 r3347939  
    44 * Plugin URI:        http://wpstream.net
    55 * 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.9
     6 * Version:           4.7
    77 * Author:            wpstream
    88 * Author URI:        http://wpstream.net
     
    1515    die;
    1616}
    17 define('WPSTREAM_PLUGIN_VERSION', '4.6.7.9');
     17define('WPSTREAM_PLUGIN_VERSION', '4.7');
    1818define('WPSTREAM_CLUBLINK', 'wpstream.net');
    1919define('WPSTREAM_CLUBLINKSSL', 'https');
     
    268268    }
    269269}
     270
     271/**
     272 * Register broadcaster page endpoint
     273 */
     274function 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}
     284add_action('init', 'wpstream_register_broadcaster_endpoint');
     285
     286/**
     287 * Load broadcaster template when the custom endpoint is accessed
     288 */
     289function 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}
     296add_filter('template_include', 'wpstream_load_broadcaster_template');
     297
     298/**
     299 * Flush rewrite rules on plugin activation to ensure our endpoint works
     300 */
     301function wpstream_flush_rewrite_rules() {
     302    wpstream_register_broadcaster_endpoint();
     303    flush_rewrite_rules();
     304}
     305register_activation_hook(__FILE__, 'wpstream_flush_rewrite_rules');
Note: See TracChangeset for help on using the changeset viewer.