Changeset 3312871
- Timestamp:
- 06/17/2025 04:44:40 AM (8 months ago)
- Location:
- wpstream
- Files:
-
- 28 edited
- 1 copied
-
tags/4.6.7.4 (copied) (copied from wpstream/trunk)
-
tags/4.6.7.4/admin/class-wpstream-admin.php (modified) (13 diffs)
-
tags/4.6.7.4/admin/css/wpstream-admin.css (modified) (1 diff)
-
tags/4.6.7.4/admin/js/admin_control.js (modified) (2 diffs)
-
tags/4.6.7.4/admin/js/wpstream_settings.js (modified) (1 diff)
-
tags/4.6.7.4/includes/class-wpstream-live-api-connection.php (modified) (3 diffs)
-
tags/4.6.7.4/includes/class-wpstream-player.php (modified) (9 diffs)
-
tags/4.6.7.4/public/class-wpstream-public.php (modified) (5 diffs)
-
tags/4.6.7.4/public/css/video-js.css (modified) (1 diff)
-
tags/4.6.7.4/public/css/videojs-wpstream.css (modified) (3 diffs)
-
tags/4.6.7.4/public/css/wpstream_style.css (modified) (1 diff)
-
tags/4.6.7.4/public/js/wpstream-player.js (modified) (3 diffs)
-
tags/4.6.7.4/readme.txt (modified) (2 diffs)
-
tags/4.6.7.4/streamify/streamify.php (modified) (1 diff)
-
tags/4.6.7.4/wpstream.php (modified) (2 diffs)
-
trunk/admin/class-wpstream-admin.php (modified) (13 diffs)
-
trunk/admin/css/wpstream-admin.css (modified) (1 diff)
-
trunk/admin/js/admin_control.js (modified) (2 diffs)
-
trunk/admin/js/wpstream_settings.js (modified) (1 diff)
-
trunk/includes/class-wpstream-live-api-connection.php (modified) (3 diffs)
-
trunk/includes/class-wpstream-player.php (modified) (9 diffs)
-
trunk/public/class-wpstream-public.php (modified) (5 diffs)
-
trunk/public/css/video-js.css (modified) (1 diff)
-
trunk/public/css/videojs-wpstream.css (modified) (3 diffs)
-
trunk/public/css/wpstream_style.css (modified) (1 diff)
-
trunk/public/js/wpstream-player.js (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/streamify/streamify.php (modified) (1 diff)
-
trunk/wpstream.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpstream/tags/4.6.7.4/admin/class-wpstream-admin.php
r3296345 r3312871 148 148 */ 149 149 wp_enqueue_style( 'wpstream-roboto', "https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700,900&display=swap&subset=latin-ext" ); 150 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpstream-admin.css', array(), WPSTREAM_PLUGIN_VERSION, 'all' ); 150 wp_enqueue_style( 151 $this->plugin_name, 152 plugin_dir_url( __FILE__ ) . 'css/wpstream-admin.css', 153 array(), 154 filemtime(plugin_dir_path(__FILE__) . 'css/wpstream-admin.css' ), 155 'all' 156 ); 151 157 152 158 wp_enqueue_style( … … 266 272 wp_localize_script('wpstream-settings', 'wpstream_settings_vars', array( 267 273 'error_message' => esc_html__( 'Failed to save settings. Please try again.', 'wpstream'), 274 'choose_image_text' => esc_html__( 'Choose Logo Image', 'wpstream'), 275 'select_image_text' => esc_html__( 'Select Image', 'wpstream'), 268 276 )); 269 277 … … 1412 1420 ), 1413 1421 1414 1422 14 => array( 1423 'tab' => 'general_options', 1424 'label' => esc_html__('Video player theme','wpstream'), 1425 'name' => 'video_player_theme', 1426 'type' => 'select', 1427 'select_values'=>array( 1428 'default' => esc_html__('Default','wpstream'), 1429 'city' => esc_html__('City','wpstream'), 1430 'forest' => esc_html__('Forest','wpstream'), 1431 'fantasy' => esc_html__('Fantasy','wpstream'), 1432 'sea' => esc_html__('Sea','wpstream'), 1433 ), 1434 'details' => esc_html__('Choose the video player theme to have a different look.','wpstream'), 1435 ), 1436 'wpstream_player_logo' => array( 1437 'tab' => 'general_options', 1438 'name' => 'player_logo', 1439 'label' => esc_html__('Logo for the video player','wpstream'), 1440 'type' => 'image', 1441 'details' => esc_html__('This logo will be displayed on the the video player.','wpstream'), 1442 'default' => '', 1443 'image_size' => 'thumbnail', 1444 ), 1445 // hide the video player logo opacity for now 1446 // 'wpstream_player_logo_opacity' => array( 1447 // 'tab' => 'general_options', 1448 // 'name' => 'player_logo_opacity', 1449 // 'label' => esc_html__('Opacity of the player logo','wpstream'), 1450 // 'type' => 'range', 1451 // 'details' => esc_html__('Set the opacity of the logo','wpstream'), 1452 // 'default' => '', 1453 // 'image_size' => 'thumbnail', 1454 // ), 1455 'wpsteram_player_logo_position' => array( 1456 'tab' => 'general_options', 1457 'name' => 'player_logo_position', 1458 'label' => esc_html__('Position of the video player logo','wpstream'), 1459 'type' => 'select', 1460 'select_values'=>array( 1461 'top-left' => esc_html__('Top Left','wpstream'), 1462 'top-right' => esc_html__('Top Right','wpstream'), 1463 'bottom-left' => esc_html__('Bottom Left','wpstream'), 1464 'bottom-right' => esc_html__('Bottom Right','wpstream'), 1465 ), 1466 'details' => esc_html__('Choose the position of the logo on the video player.','wpstream'), 1467 'default' => '', 1468 ), 1469 1415 1470 1416 1471 … … 1528 1583 1529 1584 1530 if($option['type']=='user_roles'){1531 1585 switch( $option['type'] ) { 1586 case 'user_roles': 1532 1587 print '<label for="'.$option['name'].'">'.$option['label'].'</label>'; 1533 1588 print $this->wpstream_select_user_roles($option['name'],$options_value); 1534 1589 print '<div class="settings_details">'.$option['details'].'</div>'; 1535 1536 }else if($option['type']=='user_streaming_global_channel_options'){ 1537 1590 break; 1591 case 'user_streaming_global_channel_options': 1538 1592 $exclude_array=array(); 1539 1593 $this->user_streaming_global_channel_options($option['name'],$options_value,$exclude_array); 1540 1541 1542 }else if($option['type']=='text'){ 1543 1594 break; 1595 case 'text': 1544 1596 if($options_value==''){ 1545 1597 $options_value=''; … … 1548 1600 } 1549 1601 } 1550 1602 1551 1603 print '<label for="'.$option['name'].'">'.$option['label'].'</label>'; 1552 1604 print '<input class="wpstream-text-input-setting" id="'.$option['name'].'" type="'.$option['type'].'" size="36" name="'.$option['name'].'" value="'.esc_attr($options_value).'" />'; 1553 1605 print '<div class="settings_details">'.$option['details'].'</div>'; 1554 1555 } else if($option['type']=='select'){ 1556 1606 break; 1607 case 'select': 1557 1608 print '<label for="'.$option['name'].'">'.$option['label'].'</label>'; 1558 1609 print '<select id="'.$option['name'].'" name="'.$option['name'].'" >'; … … 1567 1618 print '<input type="hidden" name="'.$option['name'].'_hidden" value="1" >'; 1568 1619 print '<div class="settings_details">'.$option['details'].'</div>'; 1569 1570 } else if($option['type']=='slidertoogle'){1620 break; 1621 case 'slidertoogle': 1571 1622 print '<label for="'.$option['name'].'">'.$option['label'].'</label>'; 1572 1623 print '<label class="wpstream_switch"> … … 1579 1630 print '</label>'; 1580 1631 print '<div class="settings_details">'.$option['details'].'</div>'; 1581 } 1632 break; 1633 case 'image': 1634 $image_url = $options_value ? esc_url($options_value) : ''; 1635 $has_image = !empty($image_url); 1636 1637 print '<label for="' . $option['name'] . '">' . $option['label'] . '</label>'; 1638 print '<div class="wpstream-image-upload-wrapper">'; 1639 print '<input type="hidden" id="' . $option['name'] . '" name="' . $option['name'] . '" value="' . $image_url . '" />'; 1640 1641 // Preview area 1642 print '<div class="wpstream-image-preview" style="' . (!$has_image ? 'display:none;' : '') . '">'; 1643 print '<img src="' . $image_url . '" alt="Preview" />'; 1644 print '</div>'; 1645 1646 // Upload/remove buttons 1647 print '<div class="wpstream-image-upload-buttons">'; 1648 print '<button type="button" class="wpstream-upload-image button">' . esc_html__('Upload Image', 'wpstream') . '</button>'; 1649 print '<button type="button" class="wpstream-remove-image button" style="' . (!$has_image ? 'display:none;' : '') . '">' . esc_html__('Remove Image', 'wpstream') . '</button>'; 1650 print '</div>'; 1651 1652 print '</div>'; 1653 print '<div class="settings_details">' . $option['details'] . '</div>'; 1654 break; 1655 case 'range': 1656 print '<label for="'.$option['name'].'">'.$option['label'].'</label>'; 1657 print '<input class="wpstream-range-input" type="range" id="'.$option['name'].'" name="'.$option['name'].'" min="0" max="100" step="10" value="'.esc_attr($options_value).'" />'; 1658 print '<div class="settings_details">'.$option['details'].'</div>'; 1659 break; 1660 } 1582 1661 print '</div>'; 1583 1662 } … … 1750 1829 1751 1830 }else if($token==''){ 1752 $text = get_option('wpstream_curl_failed') === false?1831 $text = get_option('wpstream_curl_failed') === "0" ? 1753 1832 ' Incorrect username or password. Please check your credentials or go <a href="https://wpstream.net/my-account/edit-account/" target="_blank">here</a> to reset your password.' : 1754 1833 'Not connected to WpStream. Please note the errors above and contact support.'; … … 1949 2028 public function wpstream_present_file_management(){ 1950 2029 $video_list_raw = $this->main->wpstream_live_connection->wpstream_get_videos_from_api(); 2030 2031 if ( $video_list_raw === false ) { 2032 return '<div class="wpstream_upload_container">'.esc_html__('Not connected. Please connect to WpStream to upload videos.','wpstream').'</div>'; 2033 } 1951 2034 1952 2035 $video_list_raw_array = []; … … 3450 3533 } 3451 3534 else { 3452 $text = get_option('wpstream_curl_failed') ? 3535 $text = get_option('wpstream_curl_failed') ? 3453 3536 'Login failed with critical error: ' . get_option('wpstream_curl_failed') : 3454 3537 'Wrong username or password!'; … … 3486 3569 if(current_user_can('administrator')){ 3487 3570 $wpstream_register_email = sanitize_text_field($_POST['wpstream_register_email']); 3488 $wpstream_register_password = sanitize_text_field($_POST['wpstream_register_password']);3571 $wpstream_register_password = $_POST['wpstream_register_password']; 3489 3572 $wpstream_register_captcha = sanitize_text_field($_POST['wpstream_register_captcha']); 3490 3573 $wpstream_register_captcha_id = sanitize_text_field($_POST['wpstream_register_captcha_id']); … … 3604 3687 $return= array( 3605 3688 'success'=> false, 3606 'message' => esc_html ('The email doesn\'t look right !','wpstream')3689 'message' => esc_html__("The email doesn't look right !",'wpstream') 3607 3690 ); 3608 3691 return $return;die(); … … 3614 3697 $return= array( 3615 3698 'success'=> false, 3616 'message' => esc_html ('The email doesn\'t look right !','wpstream')3699 'message' => esc_html__("The email doesn't look right !",'wpstream') 3617 3700 ); 3618 3701 return $return;die(); -
wpstream/tags/4.6.7.4/admin/css/wpstream-admin.css
r3296345 r3312871 87 87 margin-top: 5px; 88 88 max-width: 365px; 89 } 90 91 .wpstream_option .wpstream-image-upload-wrapper { 92 margin-bottom: 10px; 93 } 94 95 .wpstream_option .wpstream-image-upload-wrapper .wpstream-image-preview { 96 margin: 10px 0; 97 max-width: 300px; 98 } 99 100 .wpstream_option .wpstream-image-upload-wrapper .wpstream-image-preview img { 101 max-width: 100%; 102 height: auto; 103 border: 1px solid #ddd; 104 padding: 5px; 105 background: #fff; 106 } 107 108 .wpstream_option .wpstream-image-upload-wrapper .wpstream-image-upload-buttons .button { 109 margin-right: 5px; 89 110 } 90 111 -
wpstream/tags/4.6.7.4/admin/js/admin_control.js
r3261076 r3312871 15 15 wpstream_handle_video_selection(); 16 16 wpstream_upload_images_in_wpadmin(); 17 18 wpstream_upload_player_logo(); 17 19 18 20 … … 612 614 } 613 615 616 function wpstream_upload_player_logo(){ 617 var mediaUploader; 618 619 // Handle upload button click 620 jQuery('.wpstream-upload-image').on('click', function(e) { 621 e.preventDefault(); 622 623 var button = jQuery(this); 624 var wrapper = button.closest('.wpstream-image-upload-wrapper'); 625 var inputField = wrapper.find('input[type="hidden"]'); 626 var previewArea = wrapper.find('.wpstream-image-preview'); 627 var removeButton = wrapper.find('.wpstream-remove-image'); 628 629 // Create media uploader instance if not already created 630 if (!mediaUploader) { 631 mediaUploader = wp.media({ 632 title: wpstream_settings_vars.choose_image_text || 'Choose Image', 633 button: { 634 text: wpstream_settings_vars.select_image_text || 'Select Image' 635 }, 636 multiple: false 637 }); 638 639 // When image is selected in the media uploader 640 mediaUploader.on('select', function() { 641 var attachment = mediaUploader.state().get('selection').first().toJSON(); 642 inputField.val(attachment.url); 643 644 previewArea.find('img').attr('src', attachment.url); 645 previewArea.show(); 646 removeButton.show(); 647 }); 648 } 649 650 // Open the media uploader 651 mediaUploader.open(); 652 }); 653 654 // Handle remove button click 655 jQuery('.wpstream-remove-image').on('click', function(e) { 656 e.preventDefault(); 657 658 var button = jQuery(this); 659 var wrapper = button.closest('.wpstream-image-upload-wrapper'); 660 var inputField = wrapper.find('input[type="hidden"]'); 661 var previewArea = wrapper.find('.wpstream-image-preview'); 662 663 inputField.val(''); 664 previewArea.hide(); 665 button.hide(); 666 }); 667 } -
wpstream/tags/4.6.7.4/admin/js/wpstream_settings.js
r3296345 r3312871 133 133 }) 134 134 }) 135 136 jQuery('.wpstream_option_wrapper .wpstream-range-input').on('change',function(e){ 137 var option_name = jQuery(this).attr('id'); 138 var option_value = jQuery(this).val(); 139 var option_type = jQuery(this).attr('type'); 140 141 jQuery('.theme_options_tab_wpstream .wpstream-save-settings').find('.spinner').css('visibility','visible'); 142 jQuery.ajax({ 143 type: 'POST', 144 url: ajaxurl, 145 timeout: 300000, 146 data: { 147 'action' : 'wpstream_update_settings', 148 'option_name' : option_name, 149 'option_type' : option_type, 150 'option_value' : option_value, 151 'security' : nonce 152 }, 153 success: function (data) { 154 jQuery('.theme_options_tab_wpstream .wpstream-save-settings').find('.spinner').css('visibility','hidden'); 155 }, 156 error: function (jqXHR,textStatus,errorThrown) { 157 wpstream_show_error_message(jQuery('.theme_options_tab_wpstream .wpstream-save-settings')); 158 } 159 }) 160 }) 135 161 } 136 162 -
wpstream/tags/4.6.7.4/includes/class-wpstream-live-api-connection.php
r3296345 r3312871 61 61 if($token=='' and $page!='wpstream_plugin_options'){ 62 62 // echo 'wpstream_curl_failed: ' . get_option('wpstream_curl_failed'); 63 $text = get_option('wpstream_curl_failed') == false?63 $text = get_option('wpstream_curl_failed') === "0" ? 64 64 'Not connected to WpStream. Please check your credentials <a href="/wp-admin/admin.php?page=wpstream_credentials">here</a>.' : 65 65 'Not connected to WpStream. Please note the errors above and contact support.'; … … 102 102 curl_close($curl); 103 103 104 $curl_failed = false;104 $curl_failed = 0; 105 105 106 106 if ($err) { … … 142 142 $curl_response_decoded = json_decode($response,JSON_OBJECT_AS_ARRAY); 143 143 if (JSON_ERROR_NONE !== json_last_error()) { 144 if (!$quiet){145 echo '<div class="api_not_conected wpstream_error_curl">Critical: Malformed API response #: ' . json_last_error() . '</div>';146 }147 148 $curl_failed = json_last_error();149 150 $response = json_encode(array(151 'success' =>false,152 'error' =>json_last_error(),153 ));154 } 155 } 156 157 update_option("wpstream_curl_failed", $curl_failed);144 if (!$quiet) { 145 echo '<div class="api_not_conected wpstream_error_curl">Critical: Malformed API response #: ' . json_last_error() . '</div>'; 146 } 147 148 $curl_failed = json_last_error(); 149 150 $response = json_encode(array( 151 'success' => false, 152 'error' => json_last_error(), 153 )); 154 } 155 } 156 157 update_option( "wpstream_curl_failed", $curl_failed ); 158 158 159 159 return $response; -
wpstream/tags/4.6.7.4/includes/class-wpstream-player.php
r3283102 r3312871 25 25 add_action('wp_ajax_nopriv_wpstream_player_check_status', array($this,'wpstream_player_check_status')); 26 26 27 28 29 30 31 27 } 32 28 … … 352 348 353 349 350 $player_theme = $this->wpstream_get_player_theme(); 354 351 $now = time().rand(0,1000000); 355 352 $overlay_video_div_id = "random_id_".$now; … … 478 475 479 476 477 $player_logo_position = get_option('wpstream_player_logo_position'); 478 $player_logo_position_class = ''; 479 if( $player_logo_position && $player_logo_position != '' ){ 480 $player_logo_position_class = 'logo-' . explode( '-', $player_logo_position )[0]; 481 } 480 482 echo' 481 <video id="wpstream-video'.$now.'" '.$poster_data.' class="video-js vjs-default-skin vjs-fluid vjs-wpstream ' .esc_attr($has_trailer_class).'" playsinline="true" '.$is_muted_str." ".$autoplay_str.'>483 <video id="wpstream-video'.$now.'" '.$poster_data.' class="video-js vjs-default-skin vjs-fluid vjs-wpstream ' . esc_attr($has_trailer_class) . ' ' . $player_theme . ' ' . $player_logo_position_class .'" playsinline="true" '.$is_muted_str." ".$autoplay_str.'> 482 484 483 485 </video>'; … … 750 752 } 751 753 752 754 function wpstream_get_player_theme() { 755 $player_theme = get_option('wpstream_video_player_theme'); 756 $is_streamify_user = $this->wpstream_is_streamify_user(); 757 if ( !empty($player_theme) && !$is_streamify_user ) { 758 $this->wpstream_enqueue_player_theme_style( $player_theme ); 759 return 'vjs-theme-' . $player_theme; 760 } 761 762 return ''; 763 } 764 765 function wpstream_enqueue_player_theme_style( $player_theme ) { 766 if ( $player_theme != 'default' ) { 767 wp_enqueue_style('videojs-theme-' . $player_theme, 'https://cdn.jsdelivr.net/npm/@videojs/themes@1/dist/' . $player_theme . '/index.min.css', array(), '1.0.0'); 768 769 } 770 } 771 753 772 754 773 … … 816 835 wp_enqueue_script('video.min'); 817 836 wp_enqueue_script('wpstream-player'); 818 819 820 $uri_details = $this->wpstream_video_on_demand_player_uri_request($product_id); 821 $video_path_final = $uri_details['video_path_final']; 822 $wpstream_data_setup = $uri_details['wpstream_data_setup']; 823 $video_type = $uri_details['video_type']; 824 $now = time().rand(0,1000000); 825 826 $overlay_video_div_id = "random_id_".$now; 827 print '<div id="'.esc_attr($overlay_video_div_id).'" class="vjs-title-overlay wpstream-video-title-overlay">'.esc_html__('Playing:','wpstream').' '.get_the_title($product_id).'</div>'; 828 829 $thumb_id = get_post_thumbnail_id($product_id); 830 $thumb = wp_get_attachment_image_src($thumb_id,'small'); 831 $usernamestream = esc_html ( get_option('wpstream_api_username','') ); 832 833 $poster_thumb = ''; 834 if(isset($thumb[0])){ 835 $poster_thumb=$thumb[0]; 836 } 837 838 $hlsDecryptionKey = get_post_meta($product_id,'hlsDecryptionKey',true); 839 $hlsDecryptionKeyIndex = get_post_meta($product_id,'hlsDecryptionKeyIndex',true); 840 841 842 $pack = $this->main->wpstream_live_connection->wpstream_request_pack_data_per_user(); 843 844 845 846 $trailer_attachment_id = intval (get_post_meta( $product_id, 'video_trailer', true )); 847 $video_trailer = ''; 848 $video_trailer_type = ''; 849 if($trailer_attachment_id!=0) { 850 $video_trailer = wp_get_attachment_url( $trailer_attachment_id ); 851 $attachment_metadata = wp_get_attachment_metadata($trailer_attachment_id); 852 $video_trailer_type = $attachment_metadata['mime_type']; 853 } 837 838 $player_theme = $this->wpstream_get_player_theme(); 839 840 $uri_details = $this->wpstream_video_on_demand_player_uri_request($product_id); 841 $video_path_final = $uri_details['video_path_final']; 842 $wpstream_data_setup = $uri_details['wpstream_data_setup']; 843 $video_type = $uri_details['video_type']; 844 $now = time().rand(0,1000000); 845 846 $overlay_video_div_id = "random_id_".$now; 847 print '<div id="'.esc_attr($overlay_video_div_id).'" class="vjs-title-overlay wpstream-video-title-overlay">'.esc_html__('Playing:','wpstream').' '.get_the_title($product_id).'</div>'; 848 849 $thumb_id = get_post_thumbnail_id($product_id); 850 $thumb = wp_get_attachment_image_src($thumb_id,'small'); 851 $usernamestream = esc_html ( get_option('wpstream_api_username','') ); 852 853 $poster_thumb = ''; 854 if(isset($thumb[0])){ 855 $poster_thumb=$thumb[0]; 856 } 857 858 $hlsDecryptionKey = get_post_meta($product_id,'hlsDecryptionKey',true); 859 $hlsDecryptionKeyIndex = get_post_meta($product_id,'hlsDecryptionKeyIndex',true); 860 861 862 $pack = $this->main->wpstream_live_connection->wpstream_request_pack_data_per_user(); 863 864 865 866 $trailer_attachment_id = intval (get_post_meta( $product_id, 'video_trailer', true )); 867 $video_trailer = ''; 868 $video_trailer_type = ''; 869 if($trailer_attachment_id!=0) { 870 $video_trailer = wp_get_attachment_url( $trailer_attachment_id ); 871 $attachment_metadata = wp_get_attachment_metadata($trailer_attachment_id); 872 $video_trailer_type = $attachment_metadata['mime_type']; 873 } 874 875 // override trailer setup here (for testing) 876 // $trailer_attachment_id = 1; 877 // $video_trailer = '/wp-content/uploads/2023/10/production-ID_4608975.mp4'; 878 // $video_trailer = '/wp-content/uploads/2023/10/ultrawide.mp4'; 879 880 // If the video is self hosted or external, we should let the user see it 881 $video_type = intval( get_post_meta($product_id, 'wpstream_product_type', true)); 882 883 884 if ( (isset($pack['available_data_mb']) && $pack['available_data_mb']>0) || $video_type === 3 ) { 885 886 if($video_path_final==''){ 887 if( $uri_details['post_type']=='wpstream_product_vod' && $uri_details['free_video_type']==3 ){ 888 }else{ 889 print '<div class="wpstream_vod_notice">This video does not exist or it has been deleted!</div>'; 890 } 891 892 } 893 894 // TODO (crerem) populate these from VOD settings 895 $autoplay = false; 896 $muted = false; 897 898 $wpstream_vod_start_muted = intval ( get_option('wpstream_vod_start_muted','') ); 899 if($wpstream_vod_start_muted===1){ 900 $muted=true; 901 } 902 $wpstream_vod_autoplay = intval ( get_option('wpstream_vod_autoplay','') ); 903 if($wpstream_vod_autoplay===1){ 904 $autoplay=true; 905 } 906 907 $poster_data = 'poster="'.esc_url($poster_thumb).'"'; 908 $has_trailer_class=''; 909 if($trailer_attachment_id !=0){ 910 $poster_data=''; // cancel poster for theme 911 $has_trailer_class='wpstream_theme_player_has_trailer'; 912 } 913 914 $player_logo_position = get_option('wpstream_player_logo_position'); 915 $player_logo_position_class = ''; 916 if( $player_logo_position && $player_logo_position!='' ){ 917 $player_logo_position_class = 'logo-' . explode( '-', $player_logo_position )[0]; 918 } 919 920 echo '<video id="wpstream-video-vod-'.$now.'" class="'.esc_attr($has_trailer_class).' video-js vjs-default-skin vjs-fluid kuk wpstream_video_on_demand vjs-wpstream ' . $player_theme .' ' . $player_logo_position_class . '" data-me="'.esc_attr($usernamestream).'" data-product-id="'.$product_id.'" playsinline preload="auto" 921 '. $poster_data.' '.$wpstream_data_setup.'> 922 <p class="vjs-no-js"> 923 To view this video please enable JavaScript, and consider upgrading to a web browser that 924 <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a> 925 </p> 926 </video>'; 927 928 if($trailer_attachment_id !=0){ 929 print '<div class="wpstream_theme_trailer_wrapper">'; 930 print '<div id="wpstream_video_on_demand_play_trailer_btn_' . $now . '" class="wpstream_video_on_demand_play_trailer"> 931 <svg width="30" height="24" viewBox="0 0 30 24" fill="none" xmlns="http://www.w3.org/2000/svg"> 932 <path fill-rule="evenodd" clip-rule="evenodd" d="M26.6667 1.5H3.33337C2.50495 1.5 1.83337 2.17157 1.83337 3V21C1.83337 21.8284 2.50495 22.5 3.33338 22.5H26.6667C27.4951 22.5 28.1667 21.8284 28.1667 21V3C28.1667 2.17157 27.4951 1.5 26.6667 1.5ZM3.33337 0C1.67652 0 0.333374 1.34315 0.333374 3V21C0.333374 22.6569 1.67652 24 3.33338 24H26.6667C28.3236 24 29.6667 22.6569 29.6667 21V3C29.6667 1.34315 28.3236 0 26.6667 0H3.33337ZM4.83337 4C4.55723 4 4.33337 4.22386 4.33337 4.5V6.16667C4.33337 6.44281 4.55723 6.66667 4.83337 6.66667H6.50004C6.77618 6.66667 7.00004 6.44281 7.00004 6.16667V4.5C7.00004 4.22386 6.77618 4 6.50004 4H4.83337ZM23.5 4C23.2239 4 23 4.22386 23 4.5V6.16667C23 6.44281 23.2239 6.66667 23.5 6.66667H25.1667C25.4428 6.66667 25.6667 6.44281 25.6667 6.16667V4.5C25.6667 4.22386 25.4428 4 25.1667 4H23.5ZM4.33337 11.167C4.33337 10.8909 4.55723 10.667 4.83337 10.667H6.50004C6.77618 10.667 7.00004 10.8909 7.00004 11.167V12.8337C7.00004 13.1098 6.77618 13.3337 6.50004 13.3337H4.83337C4.55723 13.3337 4.33337 13.1098 4.33337 12.8337V11.167ZM23.5001 10.667C23.224 10.667 23.0001 10.8909 23.0001 11.167V12.8337C23.0001 13.1098 23.224 13.3337 23.5001 13.3337H25.1668C25.4429 13.3337 25.6668 13.1098 25.6668 12.8337V11.167C25.6668 10.8909 25.4429 10.667 25.1668 10.667H23.5001ZM4.33337 17.833C4.33337 17.5569 4.55723 17.333 4.83337 17.333H6.50004C6.77618 17.333 7.00004 17.5569 7.00004 17.833V19.4997C7.00004 19.7758 6.77618 19.9997 6.50004 19.9997H4.83337C4.55723 19.9997 4.33337 19.7758 4.33337 19.4997V17.833ZM23.5001 17.333C23.224 17.333 23.0001 17.5569 23.0001 17.833V19.4997C23.0001 19.7758 23.224 19.9997 23.5001 19.9997H25.1668C25.4429 19.9997 25.6668 19.7758 25.6668 19.4997V17.833C25.6668 17.5569 25.4429 17.333 25.1668 17.333H23.5001ZM19.0677 13.0997L13.4077 16.5087C13.0434 16.7281 12.6092 16.7094 12.2661 16.5091C11.9218 16.3081 11.6666 15.9224 11.6666 15.4086V8.59072C11.6666 8.07698 11.9218 7.69125 12.2661 7.49026C12.6092 7.28999 13.0434 7.27126 13.4077 7.49064L19.0677 10.8996C19.8663 11.3805 19.8663 12.6188 19.0677 13.0997Z"/> 933 </svg> 934 '.esc_html__('Play Trailer','wpstream').'</div>'; 935 936 print '<div class="wpstream_video_on_demand_play_video_wrapper" id="wpstream_video_on_demand_play_video_btn_' . $now . '" > 937 <div class="wpstream_video_on_demand_play_video"> 938 <svg width="29" height="30" viewBox="0 0 29 30" fill="none" xmlns="http://www.w3.org/2000/svg"> 939 <path fill-rule="evenodd" clip-rule="evenodd" d="M6.1808 28.9035L26.274 18.1652C29.1087 16.6503 29.1087 12.7497 26.274 11.2348L6.1808 0.496557C4.88769 -0.194506 3.34623 -0.1355 2.1283 0.495357C0.906043 1.12846 1.0095e-06 2.34351 9.38766e-07 3.96179L0 25.4382C-7.07369e-08 27.0565 0.906042 28.2715 2.1283 28.9046C3.34622 29.5355 4.88769 29.5945 6.1808 28.9035ZM24.8221 13.8026C25.5742 14.2045 25.5742 15.1955 24.8221 15.5974L4.72891 26.3356C3.94628 26.7539 3.01386 26.2165 3.01386 25.4382L3.01386 3.96179C3.01386 3.18347 3.94628 2.6461 4.72891 3.06436L24.8221 13.8026Z" fill="#F1F1F1"/> 940 </svg> 941 </div> 942 '.esc_html__('Play Video','wpstream').' 943 </div>'; 944 945 946 947 print '<div id="wpstream_video_on_demand_mute_trailer_btn_' . $now . '" class="wpstream_video_on_demand_mute_trailer"> 854 948 855 // override trailer setup here (for testing) 856 // $trailer_attachment_id = 1; 857 // $video_trailer = '/wp-content/uploads/2023/10/production-ID_4608975.mp4'; 858 // $video_trailer = '/wp-content/uploads/2023/10/ultrawide.mp4'; 859 860 // If the video is self hosted or external, we should let the user see it 861 $video_type = intval( get_post_meta($product_id, 'wpstream_product_type', true)); 862 863 864 if ( (isset($pack['available_data_mb']) && $pack['available_data_mb']>0) || $video_type === 3 ) { 865 866 if($video_path_final==''){ 867 if( $uri_details['post_type']=='wpstream_product_vod' && $uri_details['free_video_type']==3 ){ 868 }else{ 869 print '<div class="wpstream_vod_notice">This video does not exist or it has been deleted!</div>'; 870 } 871 872 } 873 874 // TODO (crerem) populate these from VOD settings 875 $autoplay = false; 876 $muted = false; 877 878 $wpstream_vod_start_muted = intval ( get_option('wpstream_vod_start_muted','') ); 879 if($wpstream_vod_start_muted===1){ 880 $muted=true; 881 } 882 $wpstream_vod_autoplay = intval ( get_option('wpstream_vod_autoplay','') ); 883 if($wpstream_vod_autoplay===1){ 884 $autoplay=true; 885 } 886 887 $poster_data = 'poster="'.esc_url($poster_thumb).'"'; 888 $has_trailer_class=''; 889 if($trailer_attachment_id !=0){ 890 $poster_data=''; // cancel poster for theme 891 $has_trailer_class='wpstream_theme_player_has_trailer'; 892 } 893 894 echo '<video id="wpstream-video-vod-'.$now.'" class="'.esc_attr($has_trailer_class).' video-js vjs-default-skin vjs-fluid kuk wpstream_video_on_demand vjs-wpstream" data-me="'.esc_attr($usernamestream).'" data-product-id="'.$product_id.'" playsinline preload="auto" 895 '. $poster_data.' '.$wpstream_data_setup.'> 896 <p class="vjs-no-js"> 897 To view this video please enable JavaScript, and consider upgrading to a web browser that 898 <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a> 899 </p> 900 </video>'; 901 902 if($trailer_attachment_id !=0){ 903 print '<div class="wpstream_theme_trailer_wrapper">'; 904 print '<div id="wpstream_video_on_demand_play_trailer_btn_' . $now . '" class="wpstream_video_on_demand_play_trailer"> 905 <svg width="30" height="24" viewBox="0 0 30 24" fill="none" xmlns="http://www.w3.org/2000/svg"> 906 <path fill-rule="evenodd" clip-rule="evenodd" d="M26.6667 1.5H3.33337C2.50495 1.5 1.83337 2.17157 1.83337 3V21C1.83337 21.8284 2.50495 22.5 3.33338 22.5H26.6667C27.4951 22.5 28.1667 21.8284 28.1667 21V3C28.1667 2.17157 27.4951 1.5 26.6667 1.5ZM3.33337 0C1.67652 0 0.333374 1.34315 0.333374 3V21C0.333374 22.6569 1.67652 24 3.33338 24H26.6667C28.3236 24 29.6667 22.6569 29.6667 21V3C29.6667 1.34315 28.3236 0 26.6667 0H3.33337ZM4.83337 4C4.55723 4 4.33337 4.22386 4.33337 4.5V6.16667C4.33337 6.44281 4.55723 6.66667 4.83337 6.66667H6.50004C6.77618 6.66667 7.00004 6.44281 7.00004 6.16667V4.5C7.00004 4.22386 6.77618 4 6.50004 4H4.83337ZM23.5 4C23.2239 4 23 4.22386 23 4.5V6.16667C23 6.44281 23.2239 6.66667 23.5 6.66667H25.1667C25.4428 6.66667 25.6667 6.44281 25.6667 6.16667V4.5C25.6667 4.22386 25.4428 4 25.1667 4H23.5ZM4.33337 11.167C4.33337 10.8909 4.55723 10.667 4.83337 10.667H6.50004C6.77618 10.667 7.00004 10.8909 7.00004 11.167V12.8337C7.00004 13.1098 6.77618 13.3337 6.50004 13.3337H4.83337C4.55723 13.3337 4.33337 13.1098 4.33337 12.8337V11.167ZM23.5001 10.667C23.224 10.667 23.0001 10.8909 23.0001 11.167V12.8337C23.0001 13.1098 23.224 13.3337 23.5001 13.3337H25.1668C25.4429 13.3337 25.6668 13.1098 25.6668 12.8337V11.167C25.6668 10.8909 25.4429 10.667 25.1668 10.667H23.5001ZM4.33337 17.833C4.33337 17.5569 4.55723 17.333 4.83337 17.333H6.50004C6.77618 17.333 7.00004 17.5569 7.00004 17.833V19.4997C7.00004 19.7758 6.77618 19.9997 6.50004 19.9997H4.83337C4.55723 19.9997 4.33337 19.7758 4.33337 19.4997V17.833ZM23.5001 17.333C23.224 17.333 23.0001 17.5569 23.0001 17.833V19.4997C23.0001 19.7758 23.224 19.9997 23.5001 19.9997H25.1668C25.4429 19.9997 25.6668 19.7758 25.6668 19.4997V17.833C25.6668 17.5569 25.4429 17.333 25.1668 17.333H23.5001ZM19.0677 13.0997L13.4077 16.5087C13.0434 16.7281 12.6092 16.7094 12.2661 16.5091C11.9218 16.3081 11.6666 15.9224 11.6666 15.4086V8.59072C11.6666 8.07698 11.9218 7.69125 12.2661 7.49026C12.6092 7.28999 13.0434 7.27126 13.4077 7.49064L19.0677 10.8996C19.8663 11.3805 19.8663 12.6188 19.0677 13.0997Z"/> 907 </svg> 908 '.esc_html__('Play Trailer','wpstream').'</div>'; 909 910 print '<div class="wpstream_video_on_demand_play_video_wrapper" id="wpstream_video_on_demand_play_video_btn_' . $now . '" > 911 <div class="wpstream_video_on_demand_play_video"> 912 <svg width="29" height="30" viewBox="0 0 29 30" fill="none" xmlns="http://www.w3.org/2000/svg"> 913 <path fill-rule="evenodd" clip-rule="evenodd" d="M6.1808 28.9035L26.274 18.1652C29.1087 16.6503 29.1087 12.7497 26.274 11.2348L6.1808 0.496557C4.88769 -0.194506 3.34623 -0.1355 2.1283 0.495357C0.906043 1.12846 1.0095e-06 2.34351 9.38766e-07 3.96179L0 25.4382C-7.07369e-08 27.0565 0.906042 28.2715 2.1283 28.9046C3.34622 29.5355 4.88769 29.5945 6.1808 28.9035ZM24.8221 13.8026C25.5742 14.2045 25.5742 15.1955 24.8221 15.5974L4.72891 26.3356C3.94628 26.7539 3.01386 26.2165 3.01386 25.4382L3.01386 3.96179C3.01386 3.18347 3.94628 2.6461 4.72891 3.06436L24.8221 13.8026Z" fill="#F1F1F1"/> 914 </svg> 915 </div> 916 '.esc_html__('Play Video','wpstream').' 917 </div>'; 918 919 920 921 print '<div id="wpstream_video_on_demand_mute_trailer_btn_' . $now . '" class="wpstream_video_on_demand_mute_trailer"> 949 <svg width="37" height="36" viewBox="0 0 37 36" fill="none" xmlns="http://www.w3.org/2000/svg"> 950 <path fill-rule="evenodd" clip-rule="evenodd" d="M1.32143 10.0789H8.69499L18.8964 0L21.1428 0.921053V35.1316L18.8964 36L8.69499 25.8684H1.32143L0 24.5526V11.3947L1.32143 10.0789ZM10.175 23.6842L18.5 31.9474V4.10526L10.175 12.3158L9.24999 12.7105H2.64286V23.2368H9.24999L10.175 23.6842ZM37 17.9737C37.0069 22.2216 35.5329 26.3401 32.8295 29.6263L30.9478 27.7579C33.1613 24.9734 34.3629 21.5249 34.3571 17.9737C34.3571 14.2895 33.0885 10.8974 30.9637 8.21053L32.8454 6.34211C35.5382 9.62494 37.0062 13.735 37 17.9737ZM31.7143 17.9737C31.7193 20.8255 30.7895 23.6011 29.0661 25.8789L27.1738 23.9947C28.4127 22.2295 29.0752 20.1272 29.0714 17.9737C29.0751 15.8287 28.4174 13.7344 27.1871 11.9737L29.0793 10.0895C30.7338 12.2868 31.7143 15.0158 31.7143 17.9737ZM26.4286 17.9737C26.4286 19.4842 26.0057 20.8947 25.2657 22.0947L23.3126 20.1526C23.6249 19.4729 23.7876 18.7345 23.7899 17.9869C23.7922 17.2394 23.634 16.5001 23.3258 15.8184L25.2789 13.8737C26.0083 15.0684 26.4286 16.4737 26.4286 17.9737Z" fill="white"/> 951 </svg> 952 </div>'; 953 print '<div id="wpstream_video_on_demand_unmute_trailer_btn_' . $now . '" class="wpstream_video_on_demand_unmute_trailer"> 954 <svg width="33" height="32" viewBox="0 0 33 32" fill="none" xmlns="http://www.w3.org/2000/svg"> 955 <path fill-rule="evenodd" clip-rule="evenodd" d="M1.15625 8.85688H7.60813L16.5344 0L18.5 0.809375V30.8719L16.5344 31.635L7.60813 22.7319H1.15625L0 21.5756V10.0131L1.15625 8.85688ZM8.90313 20.8125L16.1875 28.0738V3.6075L8.90313 10.8225L8.09375 11.1694H2.3125V20.4194H8.09375L8.90313 20.8125ZM30.5967 11.3127L32.2316 12.9477L28.2287 16.9506L32.2316 20.9559L30.5967 22.5908L26.5938 18.5856L22.5885 22.5908L20.9536 20.9559L24.9588 16.9506L20.9513 12.95L22.5862 11.3151L26.5938 15.3157L30.5967 11.3127Z" fill="white"/> 956 </svg> 957 958 </div>'; 959 print '<script type="text/javascript"> 960 //<![CDATA[ 961 jQuery(document).ready(function(){ 962 console.log("wpstream_video_on_demand_player 886"); 963 wpstream_player_initialize_vod({ 964 titleOverlayElementId:"'.$overlay_video_div_id.'", 965 videoElementId: "wpstream-video-vod-'.$now.'", 966 trailerUrl: "'.$video_trailer.'", 967 videoUrl: "'.$video_path_final.'", 968 autoplay: '.var_export($autoplay, true).', 969 muted: '.var_export($muted, true).', 970 playTrailerButtonElementId: "wpstream_video_on_demand_play_trailer_btn_'.$now.'", 971 muteTrailerButtonElementId: "wpstream_video_on_demand_mute_trailer_btn_'.$now.'", 972 unmuteTrailerButtonElementId: "wpstream_video_on_demand_unmute_trailer_btn_'.$now.'", 973 playVideoButtonElementId: "wpstream_video_on_demand_play_video_btn_'.$now.'", 974 playerLogoSettings: { 975 image: "'. $this->wpstream_get_video_player_logo() . '", 976 position: "' . esc_html( get_option('wpstream_player_logo_position','top-right') ) . '", 977 opacity: ' . ( intval ( esc_html( get_option('wpstream_player_logo_opacity','100') ) ) / 100 ) . ', 978 width: 100, 979 height: "auto", 980 padding: 10, 981 }, 982 }); 983 }); 984 //]]> 985 </script>'; 986 print '</div>'; 987 } 988 else { 989 print '<script type="text/javascript"> 990 //<![CDATA[ 991 jQuery(document).ready(function(){ 922 992 923 <svg width="37" height="36" viewBox="0 0 37 36" fill="none" xmlns="http://www.w3.org/2000/svg"> 924 <path fill-rule="evenodd" clip-rule="evenodd" d="M1.32143 10.0789H8.69499L18.8964 0L21.1428 0.921053V35.1316L18.8964 36L8.69499 25.8684H1.32143L0 24.5526V11.3947L1.32143 10.0789ZM10.175 23.6842L18.5 31.9474V4.10526L10.175 12.3158L9.24999 12.7105H2.64286V23.2368H9.24999L10.175 23.6842ZM37 17.9737C37.0069 22.2216 35.5329 26.3401 32.8295 29.6263L30.9478 27.7579C33.1613 24.9734 34.3629 21.5249 34.3571 17.9737C34.3571 14.2895 33.0885 10.8974 30.9637 8.21053L32.8454 6.34211C35.5382 9.62494 37.0062 13.735 37 17.9737ZM31.7143 17.9737C31.7193 20.8255 30.7895 23.6011 29.0661 25.8789L27.1738 23.9947C28.4127 22.2295 29.0752 20.1272 29.0714 17.9737C29.0751 15.8287 28.4174 13.7344 27.1871 11.9737L29.0793 10.0895C30.7338 12.2868 31.7143 15.0158 31.7143 17.9737ZM26.4286 17.9737C26.4286 19.4842 26.0057 20.8947 25.2657 22.0947L23.3126 20.1526C23.6249 19.4729 23.7876 18.7345 23.7899 17.9869C23.7922 17.2394 23.634 16.5001 23.3258 15.8184L25.2789 13.8737C26.0083 15.0684 26.4286 16.4737 26.4286 17.9737Z" fill="white"/> 925 </svg> 926 </div>'; 927 print '<div id="wpstream_video_on_demand_unmute_trailer_btn_' . $now . '" class="wpstream_video_on_demand_unmute_trailer"> 928 <svg width="33" height="32" viewBox="0 0 33 32" fill="none" xmlns="http://www.w3.org/2000/svg"> 929 <path fill-rule="evenodd" clip-rule="evenodd" d="M1.15625 8.85688H7.60813L16.5344 0L18.5 0.809375V30.8719L16.5344 31.635L7.60813 22.7319H1.15625L0 21.5756V10.0131L1.15625 8.85688ZM8.90313 20.8125L16.1875 28.0738V3.6075L8.90313 10.8225L8.09375 11.1694H2.3125V20.4194H8.09375L8.90313 20.8125ZM30.5967 11.3127L32.2316 12.9477L28.2287 16.9506L32.2316 20.9559L30.5967 22.5908L26.5938 18.5856L22.5885 22.5908L20.9536 20.9559L24.9588 16.9506L20.9513 12.95L22.5862 11.3151L26.5938 15.3157L30.5967 11.3127Z" fill="white"/> 930 </svg> 931 932 </div>'; 933 print '<script type="text/javascript"> 934 //<![CDATA[ 935 jQuery(document).ready(function(){ 936 console.log("wpstream_video_on_demand_player 886"); 937 wpstream_player_initialize_vod({ 938 titleOverlayElementId:"'.$overlay_video_div_id.'", 939 videoElementId: "wpstream-video-vod-'.$now.'", 940 trailerUrl: "'.$video_trailer.'", 941 videoUrl: "'.$video_path_final.'", 942 autoplay: '.var_export($autoplay, true).', 943 muted: '.var_export($muted, true).', 944 playTrailerButtonElementId: "wpstream_video_on_demand_play_trailer_btn_'.$now.'", 945 muteTrailerButtonElementId: "wpstream_video_on_demand_mute_trailer_btn_'.$now.'", 946 unmuteTrailerButtonElementId: "wpstream_video_on_demand_unmute_trailer_btn_'.$now.'", 947 playVideoButtonElementId: "wpstream_video_on_demand_play_video_btn_'.$now.'", 948 }); 949 }); 950 //]]> 951 </script>'; 952 print '</div>'; 953 } 954 else { 955 print '<script type="text/javascript"> 956 //<![CDATA[ 957 jQuery(document).ready(function(){ 958 959 console.log("wpstream_video_on_demand_player 907"); 960 961 wpstream_player_initialize_vod({ 962 titleOverlayElementId:"'.$overlay_video_div_id.'", 963 videoElementId: "wpstream-video-vod-'.$now.'", 964 videoUrl: "'.$video_path_final.'", 965 autoplay: '.var_export($autoplay, true).', 966 muted: '.var_export($muted, true).', 967 }); 968 }); 969 //]]> 970 </script>'; 971 } 972 }else{ 973 print '<div class="wpstream_insuficent_res">'.esc_html__('Insufficient resources to stream this title','wpstream').'</div>'; 974 } 993 console.log("wpstream_video_on_demand_player 907"); 994 995 wpstream_player_initialize_vod({ 996 titleOverlayElementId:"'.$overlay_video_div_id.'", 997 videoElementId: "wpstream-video-vod-'.$now.'", 998 videoUrl: "'.$video_path_final.'", 999 autoplay: '.var_export($autoplay, true).', 1000 muted: '.var_export($muted, true).', 1001 playerLogoSettings: { 1002 image: "'. $this->wpstream_get_video_player_logo() . '", 1003 position: "' . esc_html( get_option('wpstream_player_logo_position','top-right') ) . '", 1004 opacity: ' . ( intval ( esc_html( get_option('wpstream_player_logo_opacity','100') ) ) / 100 ) . ', 1005 width: 100, 1006 height: "auto", 1007 padding: 10, 1008 } 1009 }); 1010 }); 1011 //]]> 1012 </script>'; 1013 } 1014 }else{ 1015 print '<div class="wpstream_insuficent_res">'.esc_html__('Insufficient resources to stream this title','wpstream').'</div>'; 1016 } 975 1017 976 1018 } … … 986 1028 wp_enqueue_script('video.min'); 987 1029 wp_enqueue_script('wpstream-player'); 988 989 1030 1031 1032 $player_theme = $this->wpstream_get_player_theme(); 990 1033 $now = time().rand(0,1000000); 991 1034 $overlay_video_div_id = "random_id_".$now; … … 1017 1060 1018 1061 1019 // TODO (crerem) populate these from VOD settings 1020 $autoplay = false; 1021 $muted = true; 1062 $autoplay = false; 1063 $muted = false; 1064 1065 if( intval ( get_option('wpstream_vod_start_muted','') ) === 1){ 1066 $muted = true; 1067 } 1068 if( intval ( get_option('wpstream_vod_autoplay','') ) === 1 ){ 1069 $autoplay = true; 1070 } 1022 1071 $video_path_final=''; 1023 1072 $has_trailer_class='wpstream_theme_player_has_trailer'; 1024 1073 1025 echo '<video id="wpstream-video-vod-'.$now.'" class="video-js vjs-default-skin vjs-fluid kuk wpstream_video_on_demand vjs-wpstream '.esc_attr( $has_trailer_class ).' " data-me="'.esc_attr($usernamestream).'" data-product-id="'.$product_id.'" playsinline preload="auto"1074 echo '<video id="wpstream-video-vod-'.$now.'" class="video-js vjs-default-skin vjs-fluid kuk wpstream_video_on_demand vjs-wpstream '.esc_attr( $has_trailer_class ).' ' . $player_theme . '" data-me="'.esc_attr($usernamestream).'" data-product-id="'.$product_id.'" playsinline preload="auto" 1026 1075 > 1027 1076 <p class="vjs-no-js"> … … 1066 1115 playTrailerButtonElementId: "wpstream_video_on_demand_play_trailer_btn_'.$now.'", 1067 1116 muteTrailerButtonElementId: "wpstream_video_on_demand_mute_trailer_btn_'.$now.'", 1068 unmuteTrailerButtonElementId: "wpstream_video_on_demand_unmute_trailer_btn_'.$now.'", 1117 unmuteTrailerButtonElementId: "wpstream_video_on_demand_unmute_trailer_btn_'.$now.'",, 1118 playerLogoSettings: { 1119 image: "'. $this->wpstream_get_video_player_logo() . '", 1120 position: "' . esc_html( get_option('wpstream_player_logo_position','top-right') ) . '", 1121 opacity: ' . ( intval ( esc_html( get_option('wpstream_player_logo_opacity','100') ) ) / 100 ) . ', 1122 width: 100, 1123 height: "auto", 1124 padding: 10, 1125 }, 1069 1126 }); 1070 1127 }); … … 1471 1528 1472 1529 } 1473 1474 1530 1531 /** 1532 * Get the video player logo URL. 1533 * 1534 * @return mixed|string 1535 */ 1536 public function wpstream_get_video_player_logo() { 1537 if ( $this->wpstream_is_streamify_user() ) { 1538 return WPSTREAM_PLUGIN_DIR_URL . 'img/default_300.png'; 1539 } 1540 1541 $logo = get_option( 'wpstream_player_logo', '' ); 1542 if ( ! empty( $logo ) ) { 1543 return $logo; 1544 } 1545 } 1546 1547 public function wpstream_is_streamify_user() { 1548 $pack_details = $this->main->wpstream_live_connection->wpstream_request_pack_data_per_user(); 1549 if ( isset( $pack_details['total_data_mb'] ) && $pack_details['total_data_mb'] === 500 && 1550 isset( $pack_details['total_storage_mb'] ) && $pack_details['total_storage_mb'] === 100 1551 ) { 1552 return true; 1553 } 1554 return false; 1555 } 1475 1556 } -
wpstream/tags/4.6.7.4/public/class-wpstream-public.php
r3278949 r3312871 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.min.css', array(), WPSTREAM_PLUGIN_VERSION, 'all'); 75 wp_enqueue_style('videojs-wpstream-player', plugin_dir_url( __FILE__ ).'/css/videojs-wpstream.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 wp_enqueue_style( 76 'videojs-wpstream-player', 77 plugin_dir_url( __FILE__ ).'/css/videojs-wpstream.css', 78 array(), 79 WPSTREAM_PLUGIN_VERSION . '.' . filemtime( plugin_dir_path(__FILE__) . 'css/videojs-wpstream.css' ), 80 'all' 81 ); 76 82 wp_enqueue_style('wpstream-integrations', plugin_dir_url( __DIR__ ) .'integrations/css/integrations.css',array(), WPSTREAM_PLUGIN_VERSION, 'all' ); 77 83 } … … 84 90 public function enqueue_scripts() { 85 91 86 87 wp_register_script('video.min', 'https://vjs.zencdn.net/8.20.0/video.min.js', WPSTREAM_PLUGIN_VERSION, true); 92 // Register the VideoJS script 93 // Enqueuing is happing directly wherever is used 94 wp_register_script('video.min', 'https://vjs.zencdn.net/8.20.0/video.min.js', WPSTREAM_PLUGIN_VERSION, true); 95 96 // Enqueue the VideoJS Logo plugin script 97 wp_enqueue_script( 98 'videojs-logo', 99 'https://cdn.jsdelivr.net/npm/videojs-logo@latest/dist/videojs-logo.min.js', 100 array('video.min'), 101 '3.0.0', 102 true 103 ); 88 104 wp_register_script('youtube.min', 89 105 plugin_dir_url( __FILE__ ).'js/youtube.min.js', … … 91 107 WPSTREAM_PLUGIN_VERSION, true); 92 108 93 wp_register_script('wpstream-player', 94 plugin_dir_url( __FILE__ ).'js/wpstream-player.js', 95 array('video.min'), 96 WPSTREAM_PLUGIN_VERSION,true); 97 98 wp_localize_script('wpstream-player', 'wpstream_player_vars', 109 wp_register_script( 110 'wpstream-player', 111 plugin_dir_url( __FILE__ ).'js/wpstream-player.js', 112 array('video.min'), 113 WPSTREAM_PLUGIN_VERSION . '.' . filemtime(plugin_dir_path(__FILE__) . 'js/wpstream-player.js'), 114 true 115 ); 116 117 wp_localize_script('wpstream-player', 'wpstream_player_vars', 99 118 array( 100 119 'admin_url' => get_admin_url(), … … 106 125 'wpstream_player_state_paused_msg' => esc_html__('The live stream is paused','wpstream'), 107 126 'wpstream_player_state_ended_msg' => esc_html__('The live stream has ended','wpstream'), 127 'wpstream_player_theme' => get_option('wpstream_video_player_theme'), 128 'playerLogoSettings' => array( 129 'imageUrl' => $this->main->wpstream_player->wpstream_get_video_player_logo(), 130 'position' => get_option( 'wpstream_player_logo_position', 'top-left' ), 131 'opacity' => get_option('wpstream_player_logo_opacity', '100'), 132 ), 108 133 ) 109 134 ); … … 181 206 182 207 } 208 183 209 184 210 -
wpstream/tags/4.6.7.4/public/css/video-js.css
r2162139 r3312871 594 594 height: 3.0em; 595 595 background-color: #2B333F; 596 background-color: rgba(43, 51, 63, 0.7); } 596 background-color: rgba(43, 51, 63, 0.7); 597 } 598 599 .video-js:not(.vjs-theme-default) .vjs-control-bar { 600 height: 54px; 601 } 602 603 /* Fantasy theme */ 604 .video-js.vjs-theme-fantasy .vjs-control { 605 height: 100%; 606 align-items: center; 607 } 608 609 .video-js.vjs-theme-fantasy .vjs-control-bar .vjs-play-control { 610 width: 4em; 611 } 612 613 .video-js.vjs-theme-fantasy .vjs-play-progress:before { 614 content: ''; 615 } 616 617 .vjs-wpstream.vjs-theme-fantasy .vjs-play-control.vjs-button>.vjs-icon-placeholder:before { 618 font-size: 1.8em; 619 } 620 621 .vjs-wpstream.vjs-theme-fantasy .vjs-button > .vjs-icon-placeholder:before { 622 display: flex; 623 align-items: center; 624 width: 1.2em; 625 } 626 627 .wp-theme-hello-wpstream .vjs-wpstream.vjs-theme-fantasy .vjs-button > .vjs-icon-placeholder:before { 628 line-height: 1.9 !important; 629 } 630 631 .video-js.vjs-theme-fantasy .vjs-play-progress:before { 632 top: -.25em; 633 } 634 635 .video-js.vjs-theme-fantasy .vjs-play-progress { 636 background-color: var(--vjs-theme-fantasy--primary); 637 } 638 639 .vjs-wpstream.vjs-theme-fantasy .vjs-volume-panel .vjs-button > .vjs-icon-placeholder:before { 640 display: block; 641 line-height: 54px; 642 } 643 644 .wpstream-featured-player-wrapper .video-js.vjs-theme-fantasy .vjs-live-display { 645 margin: 0; 646 } 647 /* End of Fantasy theme */ 648 649 /* City theme */ 650 .video-js.vjs-theme-city .vjs-control-bar { 651 height: 60px; 652 } 653 654 .video-js.vjs-theme-city .vjs-control-bar .vjs-remaining-time { 655 display: flex; 656 align-content: center; 657 flex-wrap: wrap; 658 659 flex: 3 1; 660 line-height: 50px; 661 order: 1; 662 text-align: left; 663 height: 100%; 664 left: 20px; 665 } 666 667 .function_wpstream_live_event_player .video-js.vjs-theme-city .vjs-control-bar .vjs-remaining-time { 668 display: none; 669 } 670 671 .function_wpstream_live_event_player .video-js.vjs-theme-city .vjs-live-control { 672 flex: 3 1; 673 left: 20px; 674 } 675 676 .function_wpstream_live_event_player .video-js.vjs-theme-city .vjs-live-control .vjs-live-display { 677 background-color: #670000; 678 margin-top: 11px; 679 } 680 681 .video-js.vjs-theme-city .vjs-progress-control { 682 width: 100%; 683 position: absolute; 684 height: 20px; 685 } 686 687 .video-js.vjs-theme-city > .vjs-control-bar { 688 background-color: initial; 689 } 690 691 .video-js.vjs-theme-city > .vjs-control-bar > .vjs-play-control { 692 flex: 8 1; 693 } 694 695 .video-js.vjs-theme-city .vjs-progress-control .vjs-progress-holder { 696 margin: 0; 697 } 698 699 .video-js.vjs-theme-city .vjs-progress-control .vjs-volume-panel .vjs-volume-bar { 700 background-color: initial; 701 } 702 703 .video-js.vjs-theme-city .vjs-volume-panel .vjs-volume-bar { 704 background-color: initial; 705 } 706 707 .video-js.vjs-theme-city .vjs-volume-panel.vjs-volume-panel-horizontal:hover { 708 width: 3em; 709 } 710 711 .video-js.vjs-theme-city .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal { 712 width: 3em !important; 713 height: 100%; 714 opacity: 1; 715 } 716 717 .video-js.vjs-theme-city .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-horizontal { 718 height: 100%; 719 } 720 721 .video-js.vjs-theme-city .vjs-volume-panel > *, 722 .video-js.vjs-theme-forest .vjs-volume-panel > * { 723 transition: none !important; 724 } 725 726 .video-js.vjs-theme-city .vjs-volume-level, 727 .video-js.vjs-theme-forest .vjs-volume-level { 728 background-color: transparent !important; 729 } 730 731 .video-js.vjs-theme-city .vjs-volume-level:before { 732 position: relative; 733 } 734 735 .video-js.vjs-theme-city .vjs-volume-panel { 736 width: 34px !important; 737 flex: 1 !important; 738 padding-top: 0; 739 } 740 741 .video-js.vjs-theme-city .vjs-volume-bar:before { 742 position: relative; 743 } 744 745 .video-js.vjs-theme-city .vjs-volume-panel:not(:hover) .vjs-volume-control .vjs-mouse-display { 746 visibility: hidden; 747 } 748 749 .vjs-wpstream.vjs-theme-city .vjs-picture-in-picture-control, 750 .vjs-wpstream.vjs-theme-city .vjs-fullscreen-control, 751 .vjs-wpstream.vjs-theme-city .vjs-fullscreen-control:hover { 752 background-size: auto !important; 753 background-position: 50% 54% !important; 754 } 755 /* End of City theme */ 756 757 /* Forest theme */ 758 .video-js.vjs-theme-forest .vjs-control-bar { 759 height: 3em; 760 background-color: transparent; 761 } 762 .video-js.vjs-theme-forest .vjs-control-bar button .vjs-icon-placeholder:before, .vjs-wpstream .vjs-live-control { 763 line-height: 1.6; 764 } 765 .video-js.vjs-theme-forest .vjs-control-bar .vjs-picture-in-picture-control, 766 .video-js.vjs-theme-forest .vjs-control-bar .vjs-fullscreen-control { 767 width: 3em; 768 height: 3em; 769 } 770 .video-js.vjs-theme-forest .vjs-volume-panel.vjs-volume-panel-horizontal:hover { 771 width: 34px; 772 transition: none; 773 } 774 .video-js.vjs-theme-forest .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal { 775 transition: none; 776 } 777 .video-js.vjs-theme-forest .vjs-volume-panel .vjs-slider { 778 background-color: transparent; 779 } 780 .video-js.vjs-theme-forest .vjs-volume-panel:not(:hover) .vjs-volume-control .vjs-mouse-display { 781 visibility: hidden; 782 } 783 .video-js.vjs-theme-forest .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal { 784 width: 5em; 785 height: 3em; 786 opacity: 1; 787 } 788 789 .video-js.vjs-theme-forest .vjs-big-play-button .vjs-icon-placeholder { 790 display: block; 791 } 792 793 .video-js.vjs-theme-forest .vjs-progress-control:hover .vjs-time-tooltip, 794 .video-js.vjs-theme-forest .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip { 795 font-size: 1em; 796 } 797 798 /* End of Forest theme */ 799 800 /* Sea theme */ 801 .video-js.vjs-theme-sea .vjs-control-bar { 802 height: 4em; 803 } 804 .video-js.vjs-theme-sea .vjs-progress-control { 805 height: 4em; 806 } 807 .vjs-wpstream.vjs-theme-sea .vjs-time-control { 808 height: 4em; 809 line-height: 4em; 810 } 811 .video-js.vjs-theme-sea .vjs-volume-panel { 812 height: 4em; 813 } 814 815 .theme-hello-wpstream .function_wpstream_live_event_player .video-js.vjs-theme-sea .vjs-live-control .vjs-live-display { 816 background-color: #670000; 817 margin-top: 11px; 818 } 819 /* End of Sea theme */ 820 821 .video-js .vjs-poster img { 822 width: 100%; 823 } 597 824 598 825 .vjs-has-started .vjs-control-bar { -
wpstream/tags/4.6.7.4/public/css/videojs-wpstream.css
r2438830 r3312871 1 .vjs-wpstream .vjs-control-bar {1 .vjs-wpstream.vjs-theme-default .vjs-control-bar { 2 2 background-color: hsl(0 0% 100% / 0); 3 3 padding: 0px 12px; 4 4 height: auto; 5 5 height: 4em; 6 align-items: center; 6 7 } 7 8 … … 41 42 font-size: 1.1em; 42 43 line-height: 3em; 44 height: 4em; 43 45 } 44 46 … … 46 48 .vjs-wpstream .vjs-volume-panel .vjs-volume-control { 47 49 margin: 0px 0px 0px 0px; 50 } 51 52 .vjs-wpstream .vjs-volume-panel .vjs-volume-control .vjs-volume-tooltip { 53 position: static; 54 margin-top: -20px; 48 55 } 49 56 -
wpstream/tags/4.6.7.4/public/css/wpstream_style.css
r3288783 r3312871 213 213 .video-js:hover .vjs-icon-placeholder{ 214 214 opacity: 1; 215 } 216 217 .video-js.vjs-logo.logo-top .vjs-logo-content { 218 top: 30px !important; 219 } 220 221 .video-js.vjs-logo.logo-bottom .vjs-logo-content { 222 bottom: 40px !important; 223 } 224 225 .video-js .vjs-logo-content { 226 position: absolute; 227 } 228 229 .video-js.vjs-has-started .vjs-logo-content img { 230 height: auto; 231 } 232 233 .video-js .vjs-volume-level:before { 234 font-size: 10px !important; 235 /*top: 0 !important;*/ 215 236 } 216 237 -
wpstream/tags/4.6.7.4/public/js/wpstream-player.js
r3288783 r3312871 297 297 }); 298 298 299 this.applyTheme(wpstream_player_vars.wpstream_player_theme) 300 301 if ( typeof this.player.logo === 'function' && wpstream_player_vars.playerLogoSettings ) { 302 this.player.logo({ 303 image: wpstream_player_vars.playerLogoSettings.imageUrl, 304 position: wpstream_player_vars.playerLogoSettings.position, 305 width: 100, 306 height: 'auto', 307 opacity: parseFloat(wpstream_player_vars.playerLogoSettings.opacity)/100, 308 padding: 10, 309 }); 310 } 311 299 312 if (this.master.settings.theaterModeButtons) { 300 313 const Button = videojs.getComponent("Button"); … … 451 464 if (!this.playingTrailer) this.qoe.error(); 452 465 }); 466 } 467 468 applyTheme(themeName) { 469 const themes = ['vjs-theme-city', 'vjs-theme-forest', 'vjs-theme-sunset', 'vjs-theme-sea']; 470 themes.forEach(theme => { 471 this.player.removeClass(theme); 472 }) 473 474 this.player.addClass(`vjs-theme-${themeName}`); 475 } 476 477 initThemeSelector() { 478 const Button = videojs.getComponent('Button'); 479 const owner = this; 480 453 481 } 454 482 … … 1240 1268 player.muted(settings.muted); 1241 1269 1270 if ( typeof player.logo === 'function' && settings.playerLogoSettings ) { 1271 player.logo(settings.playerLogoSettings); 1272 } 1273 1242 1274 const originalPoster = player.poster(); 1243 1275 -
wpstream/tags/4.6.7.4/readme.txt
r3296345 r3312871 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.1 7 Stable tag: 4.6.7. 37 Stable tag: 4.6.7.4 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.6.7.4 = 141 * Feature - Give the video player a different look using the theme option 142 * Feature - Display a logo over the video player 143 * Enhancement - Fix issue regarding the basic streaming functionality when the video doesn't start 144 140 145 = 4.6.7.3 = 141 146 * Fix - Broken WpStream login functionality -
wpstream/tags/4.6.7.4/streamify/streamify.php
r3233738 r3312871 342 342 343 343 function wpstreamify_add_rewrite_rules() { 344 add_rewrite_rule('^wpstreamify/(.+)$', 'index.php?wpstreamify_path=$matches[1]', 'top'); 344 $rewrite_rules = get_option('rewrite_rules'); 345 $rule_pattern = '^wpstreamify/(.+)$'; 346 $rule_target = 'index.php?wpstreamify_path=$matches[1]'; 347 348 // Check if the rewrite rule already exists 349 if (!isset($rewrite_rules[$rule_pattern]) || $rewrite_rules[$rule_pattern] !== $rule_target) { 350 add_rewrite_rule($rule_pattern, $rule_target, 'top'); 351 flush_rewrite_rules(); 352 } 345 353 } 346 354 add_action('init', 'wpstreamify_add_rewrite_rules'); -
wpstream/tags/4.6.7.4/wpstream.php
r3296345 r3312871 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. 36 * Version: 4.6.7.4 7 7 * Author: wpstream 8 8 * Author URI: http://wpstream.net … … 15 15 die; 16 16 } 17 define('WPSTREAM_PLUGIN_VERSION', '4.6.7. 3');17 define('WPSTREAM_PLUGIN_VERSION', '4.6.7.4'); 18 18 define('WPSTREAM_CLUBLINK', 'wpstream.net'); 19 19 define('WPSTREAM_CLUBLINKSSL', 'https'); -
wpstream/trunk/admin/class-wpstream-admin.php
r3296345 r3312871 148 148 */ 149 149 wp_enqueue_style( 'wpstream-roboto', "https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700,900&display=swap&subset=latin-ext" ); 150 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpstream-admin.css', array(), WPSTREAM_PLUGIN_VERSION, 'all' ); 150 wp_enqueue_style( 151 $this->plugin_name, 152 plugin_dir_url( __FILE__ ) . 'css/wpstream-admin.css', 153 array(), 154 filemtime(plugin_dir_path(__FILE__) . 'css/wpstream-admin.css' ), 155 'all' 156 ); 151 157 152 158 wp_enqueue_style( … … 266 272 wp_localize_script('wpstream-settings', 'wpstream_settings_vars', array( 267 273 'error_message' => esc_html__( 'Failed to save settings. Please try again.', 'wpstream'), 274 'choose_image_text' => esc_html__( 'Choose Logo Image', 'wpstream'), 275 'select_image_text' => esc_html__( 'Select Image', 'wpstream'), 268 276 )); 269 277 … … 1412 1420 ), 1413 1421 1414 1422 14 => array( 1423 'tab' => 'general_options', 1424 'label' => esc_html__('Video player theme','wpstream'), 1425 'name' => 'video_player_theme', 1426 'type' => 'select', 1427 'select_values'=>array( 1428 'default' => esc_html__('Default','wpstream'), 1429 'city' => esc_html__('City','wpstream'), 1430 'forest' => esc_html__('Forest','wpstream'), 1431 'fantasy' => esc_html__('Fantasy','wpstream'), 1432 'sea' => esc_html__('Sea','wpstream'), 1433 ), 1434 'details' => esc_html__('Choose the video player theme to have a different look.','wpstream'), 1435 ), 1436 'wpstream_player_logo' => array( 1437 'tab' => 'general_options', 1438 'name' => 'player_logo', 1439 'label' => esc_html__('Logo for the video player','wpstream'), 1440 'type' => 'image', 1441 'details' => esc_html__('This logo will be displayed on the the video player.','wpstream'), 1442 'default' => '', 1443 'image_size' => 'thumbnail', 1444 ), 1445 // hide the video player logo opacity for now 1446 // 'wpstream_player_logo_opacity' => array( 1447 // 'tab' => 'general_options', 1448 // 'name' => 'player_logo_opacity', 1449 // 'label' => esc_html__('Opacity of the player logo','wpstream'), 1450 // 'type' => 'range', 1451 // 'details' => esc_html__('Set the opacity of the logo','wpstream'), 1452 // 'default' => '', 1453 // 'image_size' => 'thumbnail', 1454 // ), 1455 'wpsteram_player_logo_position' => array( 1456 'tab' => 'general_options', 1457 'name' => 'player_logo_position', 1458 'label' => esc_html__('Position of the video player logo','wpstream'), 1459 'type' => 'select', 1460 'select_values'=>array( 1461 'top-left' => esc_html__('Top Left','wpstream'), 1462 'top-right' => esc_html__('Top Right','wpstream'), 1463 'bottom-left' => esc_html__('Bottom Left','wpstream'), 1464 'bottom-right' => esc_html__('Bottom Right','wpstream'), 1465 ), 1466 'details' => esc_html__('Choose the position of the logo on the video player.','wpstream'), 1467 'default' => '', 1468 ), 1469 1415 1470 1416 1471 … … 1528 1583 1529 1584 1530 if($option['type']=='user_roles'){1531 1585 switch( $option['type'] ) { 1586 case 'user_roles': 1532 1587 print '<label for="'.$option['name'].'">'.$option['label'].'</label>'; 1533 1588 print $this->wpstream_select_user_roles($option['name'],$options_value); 1534 1589 print '<div class="settings_details">'.$option['details'].'</div>'; 1535 1536 }else if($option['type']=='user_streaming_global_channel_options'){ 1537 1590 break; 1591 case 'user_streaming_global_channel_options': 1538 1592 $exclude_array=array(); 1539 1593 $this->user_streaming_global_channel_options($option['name'],$options_value,$exclude_array); 1540 1541 1542 }else if($option['type']=='text'){ 1543 1594 break; 1595 case 'text': 1544 1596 if($options_value==''){ 1545 1597 $options_value=''; … … 1548 1600 } 1549 1601 } 1550 1602 1551 1603 print '<label for="'.$option['name'].'">'.$option['label'].'</label>'; 1552 1604 print '<input class="wpstream-text-input-setting" id="'.$option['name'].'" type="'.$option['type'].'" size="36" name="'.$option['name'].'" value="'.esc_attr($options_value).'" />'; 1553 1605 print '<div class="settings_details">'.$option['details'].'</div>'; 1554 1555 } else if($option['type']=='select'){ 1556 1606 break; 1607 case 'select': 1557 1608 print '<label for="'.$option['name'].'">'.$option['label'].'</label>'; 1558 1609 print '<select id="'.$option['name'].'" name="'.$option['name'].'" >'; … … 1567 1618 print '<input type="hidden" name="'.$option['name'].'_hidden" value="1" >'; 1568 1619 print '<div class="settings_details">'.$option['details'].'</div>'; 1569 1570 } else if($option['type']=='slidertoogle'){1620 break; 1621 case 'slidertoogle': 1571 1622 print '<label for="'.$option['name'].'">'.$option['label'].'</label>'; 1572 1623 print '<label class="wpstream_switch"> … … 1579 1630 print '</label>'; 1580 1631 print '<div class="settings_details">'.$option['details'].'</div>'; 1581 } 1632 break; 1633 case 'image': 1634 $image_url = $options_value ? esc_url($options_value) : ''; 1635 $has_image = !empty($image_url); 1636 1637 print '<label for="' . $option['name'] . '">' . $option['label'] . '</label>'; 1638 print '<div class="wpstream-image-upload-wrapper">'; 1639 print '<input type="hidden" id="' . $option['name'] . '" name="' . $option['name'] . '" value="' . $image_url . '" />'; 1640 1641 // Preview area 1642 print '<div class="wpstream-image-preview" style="' . (!$has_image ? 'display:none;' : '') . '">'; 1643 print '<img src="' . $image_url . '" alt="Preview" />'; 1644 print '</div>'; 1645 1646 // Upload/remove buttons 1647 print '<div class="wpstream-image-upload-buttons">'; 1648 print '<button type="button" class="wpstream-upload-image button">' . esc_html__('Upload Image', 'wpstream') . '</button>'; 1649 print '<button type="button" class="wpstream-remove-image button" style="' . (!$has_image ? 'display:none;' : '') . '">' . esc_html__('Remove Image', 'wpstream') . '</button>'; 1650 print '</div>'; 1651 1652 print '</div>'; 1653 print '<div class="settings_details">' . $option['details'] . '</div>'; 1654 break; 1655 case 'range': 1656 print '<label for="'.$option['name'].'">'.$option['label'].'</label>'; 1657 print '<input class="wpstream-range-input" type="range" id="'.$option['name'].'" name="'.$option['name'].'" min="0" max="100" step="10" value="'.esc_attr($options_value).'" />'; 1658 print '<div class="settings_details">'.$option['details'].'</div>'; 1659 break; 1660 } 1582 1661 print '</div>'; 1583 1662 } … … 1750 1829 1751 1830 }else if($token==''){ 1752 $text = get_option('wpstream_curl_failed') === false?1831 $text = get_option('wpstream_curl_failed') === "0" ? 1753 1832 ' Incorrect username or password. Please check your credentials or go <a href="https://wpstream.net/my-account/edit-account/" target="_blank">here</a> to reset your password.' : 1754 1833 'Not connected to WpStream. Please note the errors above and contact support.'; … … 1949 2028 public function wpstream_present_file_management(){ 1950 2029 $video_list_raw = $this->main->wpstream_live_connection->wpstream_get_videos_from_api(); 2030 2031 if ( $video_list_raw === false ) { 2032 return '<div class="wpstream_upload_container">'.esc_html__('Not connected. Please connect to WpStream to upload videos.','wpstream').'</div>'; 2033 } 1951 2034 1952 2035 $video_list_raw_array = []; … … 3450 3533 } 3451 3534 else { 3452 $text = get_option('wpstream_curl_failed') ? 3535 $text = get_option('wpstream_curl_failed') ? 3453 3536 'Login failed with critical error: ' . get_option('wpstream_curl_failed') : 3454 3537 'Wrong username or password!'; … … 3486 3569 if(current_user_can('administrator')){ 3487 3570 $wpstream_register_email = sanitize_text_field($_POST['wpstream_register_email']); 3488 $wpstream_register_password = sanitize_text_field($_POST['wpstream_register_password']);3571 $wpstream_register_password = $_POST['wpstream_register_password']; 3489 3572 $wpstream_register_captcha = sanitize_text_field($_POST['wpstream_register_captcha']); 3490 3573 $wpstream_register_captcha_id = sanitize_text_field($_POST['wpstream_register_captcha_id']); … … 3604 3687 $return= array( 3605 3688 'success'=> false, 3606 'message' => esc_html ('The email doesn\'t look right !','wpstream')3689 'message' => esc_html__("The email doesn't look right !",'wpstream') 3607 3690 ); 3608 3691 return $return;die(); … … 3614 3697 $return= array( 3615 3698 'success'=> false, 3616 'message' => esc_html ('The email doesn\'t look right !','wpstream')3699 'message' => esc_html__("The email doesn't look right !",'wpstream') 3617 3700 ); 3618 3701 return $return;die(); -
wpstream/trunk/admin/css/wpstream-admin.css
r3296345 r3312871 87 87 margin-top: 5px; 88 88 max-width: 365px; 89 } 90 91 .wpstream_option .wpstream-image-upload-wrapper { 92 margin-bottom: 10px; 93 } 94 95 .wpstream_option .wpstream-image-upload-wrapper .wpstream-image-preview { 96 margin: 10px 0; 97 max-width: 300px; 98 } 99 100 .wpstream_option .wpstream-image-upload-wrapper .wpstream-image-preview img { 101 max-width: 100%; 102 height: auto; 103 border: 1px solid #ddd; 104 padding: 5px; 105 background: #fff; 106 } 107 108 .wpstream_option .wpstream-image-upload-wrapper .wpstream-image-upload-buttons .button { 109 margin-right: 5px; 89 110 } 90 111 -
wpstream/trunk/admin/js/admin_control.js
r3261076 r3312871 15 15 wpstream_handle_video_selection(); 16 16 wpstream_upload_images_in_wpadmin(); 17 18 wpstream_upload_player_logo(); 17 19 18 20 … … 612 614 } 613 615 616 function wpstream_upload_player_logo(){ 617 var mediaUploader; 618 619 // Handle upload button click 620 jQuery('.wpstream-upload-image').on('click', function(e) { 621 e.preventDefault(); 622 623 var button = jQuery(this); 624 var wrapper = button.closest('.wpstream-image-upload-wrapper'); 625 var inputField = wrapper.find('input[type="hidden"]'); 626 var previewArea = wrapper.find('.wpstream-image-preview'); 627 var removeButton = wrapper.find('.wpstream-remove-image'); 628 629 // Create media uploader instance if not already created 630 if (!mediaUploader) { 631 mediaUploader = wp.media({ 632 title: wpstream_settings_vars.choose_image_text || 'Choose Image', 633 button: { 634 text: wpstream_settings_vars.select_image_text || 'Select Image' 635 }, 636 multiple: false 637 }); 638 639 // When image is selected in the media uploader 640 mediaUploader.on('select', function() { 641 var attachment = mediaUploader.state().get('selection').first().toJSON(); 642 inputField.val(attachment.url); 643 644 previewArea.find('img').attr('src', attachment.url); 645 previewArea.show(); 646 removeButton.show(); 647 }); 648 } 649 650 // Open the media uploader 651 mediaUploader.open(); 652 }); 653 654 // Handle remove button click 655 jQuery('.wpstream-remove-image').on('click', function(e) { 656 e.preventDefault(); 657 658 var button = jQuery(this); 659 var wrapper = button.closest('.wpstream-image-upload-wrapper'); 660 var inputField = wrapper.find('input[type="hidden"]'); 661 var previewArea = wrapper.find('.wpstream-image-preview'); 662 663 inputField.val(''); 664 previewArea.hide(); 665 button.hide(); 666 }); 667 } -
wpstream/trunk/admin/js/wpstream_settings.js
r3296345 r3312871 133 133 }) 134 134 }) 135 136 jQuery('.wpstream_option_wrapper .wpstream-range-input').on('change',function(e){ 137 var option_name = jQuery(this).attr('id'); 138 var option_value = jQuery(this).val(); 139 var option_type = jQuery(this).attr('type'); 140 141 jQuery('.theme_options_tab_wpstream .wpstream-save-settings').find('.spinner').css('visibility','visible'); 142 jQuery.ajax({ 143 type: 'POST', 144 url: ajaxurl, 145 timeout: 300000, 146 data: { 147 'action' : 'wpstream_update_settings', 148 'option_name' : option_name, 149 'option_type' : option_type, 150 'option_value' : option_value, 151 'security' : nonce 152 }, 153 success: function (data) { 154 jQuery('.theme_options_tab_wpstream .wpstream-save-settings').find('.spinner').css('visibility','hidden'); 155 }, 156 error: function (jqXHR,textStatus,errorThrown) { 157 wpstream_show_error_message(jQuery('.theme_options_tab_wpstream .wpstream-save-settings')); 158 } 159 }) 160 }) 135 161 } 136 162 -
wpstream/trunk/includes/class-wpstream-live-api-connection.php
r3296345 r3312871 61 61 if($token=='' and $page!='wpstream_plugin_options'){ 62 62 // echo 'wpstream_curl_failed: ' . get_option('wpstream_curl_failed'); 63 $text = get_option('wpstream_curl_failed') == false?63 $text = get_option('wpstream_curl_failed') === "0" ? 64 64 'Not connected to WpStream. Please check your credentials <a href="/wp-admin/admin.php?page=wpstream_credentials">here</a>.' : 65 65 'Not connected to WpStream. Please note the errors above and contact support.'; … … 102 102 curl_close($curl); 103 103 104 $curl_failed = false;104 $curl_failed = 0; 105 105 106 106 if ($err) { … … 142 142 $curl_response_decoded = json_decode($response,JSON_OBJECT_AS_ARRAY); 143 143 if (JSON_ERROR_NONE !== json_last_error()) { 144 if (!$quiet){145 echo '<div class="api_not_conected wpstream_error_curl">Critical: Malformed API response #: ' . json_last_error() . '</div>';146 }147 148 $curl_failed = json_last_error();149 150 $response = json_encode(array(151 'success' =>false,152 'error' =>json_last_error(),153 ));154 } 155 } 156 157 update_option("wpstream_curl_failed", $curl_failed);144 if (!$quiet) { 145 echo '<div class="api_not_conected wpstream_error_curl">Critical: Malformed API response #: ' . json_last_error() . '</div>'; 146 } 147 148 $curl_failed = json_last_error(); 149 150 $response = json_encode(array( 151 'success' => false, 152 'error' => json_last_error(), 153 )); 154 } 155 } 156 157 update_option( "wpstream_curl_failed", $curl_failed ); 158 158 159 159 return $response; -
wpstream/trunk/includes/class-wpstream-player.php
r3283102 r3312871 25 25 add_action('wp_ajax_nopriv_wpstream_player_check_status', array($this,'wpstream_player_check_status')); 26 26 27 28 29 30 31 27 } 32 28 … … 352 348 353 349 350 $player_theme = $this->wpstream_get_player_theme(); 354 351 $now = time().rand(0,1000000); 355 352 $overlay_video_div_id = "random_id_".$now; … … 478 475 479 476 477 $player_logo_position = get_option('wpstream_player_logo_position'); 478 $player_logo_position_class = ''; 479 if( $player_logo_position && $player_logo_position != '' ){ 480 $player_logo_position_class = 'logo-' . explode( '-', $player_logo_position )[0]; 481 } 480 482 echo' 481 <video id="wpstream-video'.$now.'" '.$poster_data.' class="video-js vjs-default-skin vjs-fluid vjs-wpstream ' .esc_attr($has_trailer_class).'" playsinline="true" '.$is_muted_str." ".$autoplay_str.'>483 <video id="wpstream-video'.$now.'" '.$poster_data.' class="video-js vjs-default-skin vjs-fluid vjs-wpstream ' . esc_attr($has_trailer_class) . ' ' . $player_theme . ' ' . $player_logo_position_class .'" playsinline="true" '.$is_muted_str." ".$autoplay_str.'> 482 484 483 485 </video>'; … … 750 752 } 751 753 752 754 function wpstream_get_player_theme() { 755 $player_theme = get_option('wpstream_video_player_theme'); 756 $is_streamify_user = $this->wpstream_is_streamify_user(); 757 if ( !empty($player_theme) && !$is_streamify_user ) { 758 $this->wpstream_enqueue_player_theme_style( $player_theme ); 759 return 'vjs-theme-' . $player_theme; 760 } 761 762 return ''; 763 } 764 765 function wpstream_enqueue_player_theme_style( $player_theme ) { 766 if ( $player_theme != 'default' ) { 767 wp_enqueue_style('videojs-theme-' . $player_theme, 'https://cdn.jsdelivr.net/npm/@videojs/themes@1/dist/' . $player_theme . '/index.min.css', array(), '1.0.0'); 768 769 } 770 } 771 753 772 754 773 … … 816 835 wp_enqueue_script('video.min'); 817 836 wp_enqueue_script('wpstream-player'); 818 819 820 $uri_details = $this->wpstream_video_on_demand_player_uri_request($product_id); 821 $video_path_final = $uri_details['video_path_final']; 822 $wpstream_data_setup = $uri_details['wpstream_data_setup']; 823 $video_type = $uri_details['video_type']; 824 $now = time().rand(0,1000000); 825 826 $overlay_video_div_id = "random_id_".$now; 827 print '<div id="'.esc_attr($overlay_video_div_id).'" class="vjs-title-overlay wpstream-video-title-overlay">'.esc_html__('Playing:','wpstream').' '.get_the_title($product_id).'</div>'; 828 829 $thumb_id = get_post_thumbnail_id($product_id); 830 $thumb = wp_get_attachment_image_src($thumb_id,'small'); 831 $usernamestream = esc_html ( get_option('wpstream_api_username','') ); 832 833 $poster_thumb = ''; 834 if(isset($thumb[0])){ 835 $poster_thumb=$thumb[0]; 836 } 837 838 $hlsDecryptionKey = get_post_meta($product_id,'hlsDecryptionKey',true); 839 $hlsDecryptionKeyIndex = get_post_meta($product_id,'hlsDecryptionKeyIndex',true); 840 841 842 $pack = $this->main->wpstream_live_connection->wpstream_request_pack_data_per_user(); 843 844 845 846 $trailer_attachment_id = intval (get_post_meta( $product_id, 'video_trailer', true )); 847 $video_trailer = ''; 848 $video_trailer_type = ''; 849 if($trailer_attachment_id!=0) { 850 $video_trailer = wp_get_attachment_url( $trailer_attachment_id ); 851 $attachment_metadata = wp_get_attachment_metadata($trailer_attachment_id); 852 $video_trailer_type = $attachment_metadata['mime_type']; 853 } 837 838 $player_theme = $this->wpstream_get_player_theme(); 839 840 $uri_details = $this->wpstream_video_on_demand_player_uri_request($product_id); 841 $video_path_final = $uri_details['video_path_final']; 842 $wpstream_data_setup = $uri_details['wpstream_data_setup']; 843 $video_type = $uri_details['video_type']; 844 $now = time().rand(0,1000000); 845 846 $overlay_video_div_id = "random_id_".$now; 847 print '<div id="'.esc_attr($overlay_video_div_id).'" class="vjs-title-overlay wpstream-video-title-overlay">'.esc_html__('Playing:','wpstream').' '.get_the_title($product_id).'</div>'; 848 849 $thumb_id = get_post_thumbnail_id($product_id); 850 $thumb = wp_get_attachment_image_src($thumb_id,'small'); 851 $usernamestream = esc_html ( get_option('wpstream_api_username','') ); 852 853 $poster_thumb = ''; 854 if(isset($thumb[0])){ 855 $poster_thumb=$thumb[0]; 856 } 857 858 $hlsDecryptionKey = get_post_meta($product_id,'hlsDecryptionKey',true); 859 $hlsDecryptionKeyIndex = get_post_meta($product_id,'hlsDecryptionKeyIndex',true); 860 861 862 $pack = $this->main->wpstream_live_connection->wpstream_request_pack_data_per_user(); 863 864 865 866 $trailer_attachment_id = intval (get_post_meta( $product_id, 'video_trailer', true )); 867 $video_trailer = ''; 868 $video_trailer_type = ''; 869 if($trailer_attachment_id!=0) { 870 $video_trailer = wp_get_attachment_url( $trailer_attachment_id ); 871 $attachment_metadata = wp_get_attachment_metadata($trailer_attachment_id); 872 $video_trailer_type = $attachment_metadata['mime_type']; 873 } 874 875 // override trailer setup here (for testing) 876 // $trailer_attachment_id = 1; 877 // $video_trailer = '/wp-content/uploads/2023/10/production-ID_4608975.mp4'; 878 // $video_trailer = '/wp-content/uploads/2023/10/ultrawide.mp4'; 879 880 // If the video is self hosted or external, we should let the user see it 881 $video_type = intval( get_post_meta($product_id, 'wpstream_product_type', true)); 882 883 884 if ( (isset($pack['available_data_mb']) && $pack['available_data_mb']>0) || $video_type === 3 ) { 885 886 if($video_path_final==''){ 887 if( $uri_details['post_type']=='wpstream_product_vod' && $uri_details['free_video_type']==3 ){ 888 }else{ 889 print '<div class="wpstream_vod_notice">This video does not exist or it has been deleted!</div>'; 890 } 891 892 } 893 894 // TODO (crerem) populate these from VOD settings 895 $autoplay = false; 896 $muted = false; 897 898 $wpstream_vod_start_muted = intval ( get_option('wpstream_vod_start_muted','') ); 899 if($wpstream_vod_start_muted===1){ 900 $muted=true; 901 } 902 $wpstream_vod_autoplay = intval ( get_option('wpstream_vod_autoplay','') ); 903 if($wpstream_vod_autoplay===1){ 904 $autoplay=true; 905 } 906 907 $poster_data = 'poster="'.esc_url($poster_thumb).'"'; 908 $has_trailer_class=''; 909 if($trailer_attachment_id !=0){ 910 $poster_data=''; // cancel poster for theme 911 $has_trailer_class='wpstream_theme_player_has_trailer'; 912 } 913 914 $player_logo_position = get_option('wpstream_player_logo_position'); 915 $player_logo_position_class = ''; 916 if( $player_logo_position && $player_logo_position!='' ){ 917 $player_logo_position_class = 'logo-' . explode( '-', $player_logo_position )[0]; 918 } 919 920 echo '<video id="wpstream-video-vod-'.$now.'" class="'.esc_attr($has_trailer_class).' video-js vjs-default-skin vjs-fluid kuk wpstream_video_on_demand vjs-wpstream ' . $player_theme .' ' . $player_logo_position_class . '" data-me="'.esc_attr($usernamestream).'" data-product-id="'.$product_id.'" playsinline preload="auto" 921 '. $poster_data.' '.$wpstream_data_setup.'> 922 <p class="vjs-no-js"> 923 To view this video please enable JavaScript, and consider upgrading to a web browser that 924 <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a> 925 </p> 926 </video>'; 927 928 if($trailer_attachment_id !=0){ 929 print '<div class="wpstream_theme_trailer_wrapper">'; 930 print '<div id="wpstream_video_on_demand_play_trailer_btn_' . $now . '" class="wpstream_video_on_demand_play_trailer"> 931 <svg width="30" height="24" viewBox="0 0 30 24" fill="none" xmlns="http://www.w3.org/2000/svg"> 932 <path fill-rule="evenodd" clip-rule="evenodd" d="M26.6667 1.5H3.33337C2.50495 1.5 1.83337 2.17157 1.83337 3V21C1.83337 21.8284 2.50495 22.5 3.33338 22.5H26.6667C27.4951 22.5 28.1667 21.8284 28.1667 21V3C28.1667 2.17157 27.4951 1.5 26.6667 1.5ZM3.33337 0C1.67652 0 0.333374 1.34315 0.333374 3V21C0.333374 22.6569 1.67652 24 3.33338 24H26.6667C28.3236 24 29.6667 22.6569 29.6667 21V3C29.6667 1.34315 28.3236 0 26.6667 0H3.33337ZM4.83337 4C4.55723 4 4.33337 4.22386 4.33337 4.5V6.16667C4.33337 6.44281 4.55723 6.66667 4.83337 6.66667H6.50004C6.77618 6.66667 7.00004 6.44281 7.00004 6.16667V4.5C7.00004 4.22386 6.77618 4 6.50004 4H4.83337ZM23.5 4C23.2239 4 23 4.22386 23 4.5V6.16667C23 6.44281 23.2239 6.66667 23.5 6.66667H25.1667C25.4428 6.66667 25.6667 6.44281 25.6667 6.16667V4.5C25.6667 4.22386 25.4428 4 25.1667 4H23.5ZM4.33337 11.167C4.33337 10.8909 4.55723 10.667 4.83337 10.667H6.50004C6.77618 10.667 7.00004 10.8909 7.00004 11.167V12.8337C7.00004 13.1098 6.77618 13.3337 6.50004 13.3337H4.83337C4.55723 13.3337 4.33337 13.1098 4.33337 12.8337V11.167ZM23.5001 10.667C23.224 10.667 23.0001 10.8909 23.0001 11.167V12.8337C23.0001 13.1098 23.224 13.3337 23.5001 13.3337H25.1668C25.4429 13.3337 25.6668 13.1098 25.6668 12.8337V11.167C25.6668 10.8909 25.4429 10.667 25.1668 10.667H23.5001ZM4.33337 17.833C4.33337 17.5569 4.55723 17.333 4.83337 17.333H6.50004C6.77618 17.333 7.00004 17.5569 7.00004 17.833V19.4997C7.00004 19.7758 6.77618 19.9997 6.50004 19.9997H4.83337C4.55723 19.9997 4.33337 19.7758 4.33337 19.4997V17.833ZM23.5001 17.333C23.224 17.333 23.0001 17.5569 23.0001 17.833V19.4997C23.0001 19.7758 23.224 19.9997 23.5001 19.9997H25.1668C25.4429 19.9997 25.6668 19.7758 25.6668 19.4997V17.833C25.6668 17.5569 25.4429 17.333 25.1668 17.333H23.5001ZM19.0677 13.0997L13.4077 16.5087C13.0434 16.7281 12.6092 16.7094 12.2661 16.5091C11.9218 16.3081 11.6666 15.9224 11.6666 15.4086V8.59072C11.6666 8.07698 11.9218 7.69125 12.2661 7.49026C12.6092 7.28999 13.0434 7.27126 13.4077 7.49064L19.0677 10.8996C19.8663 11.3805 19.8663 12.6188 19.0677 13.0997Z"/> 933 </svg> 934 '.esc_html__('Play Trailer','wpstream').'</div>'; 935 936 print '<div class="wpstream_video_on_demand_play_video_wrapper" id="wpstream_video_on_demand_play_video_btn_' . $now . '" > 937 <div class="wpstream_video_on_demand_play_video"> 938 <svg width="29" height="30" viewBox="0 0 29 30" fill="none" xmlns="http://www.w3.org/2000/svg"> 939 <path fill-rule="evenodd" clip-rule="evenodd" d="M6.1808 28.9035L26.274 18.1652C29.1087 16.6503 29.1087 12.7497 26.274 11.2348L6.1808 0.496557C4.88769 -0.194506 3.34623 -0.1355 2.1283 0.495357C0.906043 1.12846 1.0095e-06 2.34351 9.38766e-07 3.96179L0 25.4382C-7.07369e-08 27.0565 0.906042 28.2715 2.1283 28.9046C3.34622 29.5355 4.88769 29.5945 6.1808 28.9035ZM24.8221 13.8026C25.5742 14.2045 25.5742 15.1955 24.8221 15.5974L4.72891 26.3356C3.94628 26.7539 3.01386 26.2165 3.01386 25.4382L3.01386 3.96179C3.01386 3.18347 3.94628 2.6461 4.72891 3.06436L24.8221 13.8026Z" fill="#F1F1F1"/> 940 </svg> 941 </div> 942 '.esc_html__('Play Video','wpstream').' 943 </div>'; 944 945 946 947 print '<div id="wpstream_video_on_demand_mute_trailer_btn_' . $now . '" class="wpstream_video_on_demand_mute_trailer"> 854 948 855 // override trailer setup here (for testing) 856 // $trailer_attachment_id = 1; 857 // $video_trailer = '/wp-content/uploads/2023/10/production-ID_4608975.mp4'; 858 // $video_trailer = '/wp-content/uploads/2023/10/ultrawide.mp4'; 859 860 // If the video is self hosted or external, we should let the user see it 861 $video_type = intval( get_post_meta($product_id, 'wpstream_product_type', true)); 862 863 864 if ( (isset($pack['available_data_mb']) && $pack['available_data_mb']>0) || $video_type === 3 ) { 865 866 if($video_path_final==''){ 867 if( $uri_details['post_type']=='wpstream_product_vod' && $uri_details['free_video_type']==3 ){ 868 }else{ 869 print '<div class="wpstream_vod_notice">This video does not exist or it has been deleted!</div>'; 870 } 871 872 } 873 874 // TODO (crerem) populate these from VOD settings 875 $autoplay = false; 876 $muted = false; 877 878 $wpstream_vod_start_muted = intval ( get_option('wpstream_vod_start_muted','') ); 879 if($wpstream_vod_start_muted===1){ 880 $muted=true; 881 } 882 $wpstream_vod_autoplay = intval ( get_option('wpstream_vod_autoplay','') ); 883 if($wpstream_vod_autoplay===1){ 884 $autoplay=true; 885 } 886 887 $poster_data = 'poster="'.esc_url($poster_thumb).'"'; 888 $has_trailer_class=''; 889 if($trailer_attachment_id !=0){ 890 $poster_data=''; // cancel poster for theme 891 $has_trailer_class='wpstream_theme_player_has_trailer'; 892 } 893 894 echo '<video id="wpstream-video-vod-'.$now.'" class="'.esc_attr($has_trailer_class).' video-js vjs-default-skin vjs-fluid kuk wpstream_video_on_demand vjs-wpstream" data-me="'.esc_attr($usernamestream).'" data-product-id="'.$product_id.'" playsinline preload="auto" 895 '. $poster_data.' '.$wpstream_data_setup.'> 896 <p class="vjs-no-js"> 897 To view this video please enable JavaScript, and consider upgrading to a web browser that 898 <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a> 899 </p> 900 </video>'; 901 902 if($trailer_attachment_id !=0){ 903 print '<div class="wpstream_theme_trailer_wrapper">'; 904 print '<div id="wpstream_video_on_demand_play_trailer_btn_' . $now . '" class="wpstream_video_on_demand_play_trailer"> 905 <svg width="30" height="24" viewBox="0 0 30 24" fill="none" xmlns="http://www.w3.org/2000/svg"> 906 <path fill-rule="evenodd" clip-rule="evenodd" d="M26.6667 1.5H3.33337C2.50495 1.5 1.83337 2.17157 1.83337 3V21C1.83337 21.8284 2.50495 22.5 3.33338 22.5H26.6667C27.4951 22.5 28.1667 21.8284 28.1667 21V3C28.1667 2.17157 27.4951 1.5 26.6667 1.5ZM3.33337 0C1.67652 0 0.333374 1.34315 0.333374 3V21C0.333374 22.6569 1.67652 24 3.33338 24H26.6667C28.3236 24 29.6667 22.6569 29.6667 21V3C29.6667 1.34315 28.3236 0 26.6667 0H3.33337ZM4.83337 4C4.55723 4 4.33337 4.22386 4.33337 4.5V6.16667C4.33337 6.44281 4.55723 6.66667 4.83337 6.66667H6.50004C6.77618 6.66667 7.00004 6.44281 7.00004 6.16667V4.5C7.00004 4.22386 6.77618 4 6.50004 4H4.83337ZM23.5 4C23.2239 4 23 4.22386 23 4.5V6.16667C23 6.44281 23.2239 6.66667 23.5 6.66667H25.1667C25.4428 6.66667 25.6667 6.44281 25.6667 6.16667V4.5C25.6667 4.22386 25.4428 4 25.1667 4H23.5ZM4.33337 11.167C4.33337 10.8909 4.55723 10.667 4.83337 10.667H6.50004C6.77618 10.667 7.00004 10.8909 7.00004 11.167V12.8337C7.00004 13.1098 6.77618 13.3337 6.50004 13.3337H4.83337C4.55723 13.3337 4.33337 13.1098 4.33337 12.8337V11.167ZM23.5001 10.667C23.224 10.667 23.0001 10.8909 23.0001 11.167V12.8337C23.0001 13.1098 23.224 13.3337 23.5001 13.3337H25.1668C25.4429 13.3337 25.6668 13.1098 25.6668 12.8337V11.167C25.6668 10.8909 25.4429 10.667 25.1668 10.667H23.5001ZM4.33337 17.833C4.33337 17.5569 4.55723 17.333 4.83337 17.333H6.50004C6.77618 17.333 7.00004 17.5569 7.00004 17.833V19.4997C7.00004 19.7758 6.77618 19.9997 6.50004 19.9997H4.83337C4.55723 19.9997 4.33337 19.7758 4.33337 19.4997V17.833ZM23.5001 17.333C23.224 17.333 23.0001 17.5569 23.0001 17.833V19.4997C23.0001 19.7758 23.224 19.9997 23.5001 19.9997H25.1668C25.4429 19.9997 25.6668 19.7758 25.6668 19.4997V17.833C25.6668 17.5569 25.4429 17.333 25.1668 17.333H23.5001ZM19.0677 13.0997L13.4077 16.5087C13.0434 16.7281 12.6092 16.7094 12.2661 16.5091C11.9218 16.3081 11.6666 15.9224 11.6666 15.4086V8.59072C11.6666 8.07698 11.9218 7.69125 12.2661 7.49026C12.6092 7.28999 13.0434 7.27126 13.4077 7.49064L19.0677 10.8996C19.8663 11.3805 19.8663 12.6188 19.0677 13.0997Z"/> 907 </svg> 908 '.esc_html__('Play Trailer','wpstream').'</div>'; 909 910 print '<div class="wpstream_video_on_demand_play_video_wrapper" id="wpstream_video_on_demand_play_video_btn_' . $now . '" > 911 <div class="wpstream_video_on_demand_play_video"> 912 <svg width="29" height="30" viewBox="0 0 29 30" fill="none" xmlns="http://www.w3.org/2000/svg"> 913 <path fill-rule="evenodd" clip-rule="evenodd" d="M6.1808 28.9035L26.274 18.1652C29.1087 16.6503 29.1087 12.7497 26.274 11.2348L6.1808 0.496557C4.88769 -0.194506 3.34623 -0.1355 2.1283 0.495357C0.906043 1.12846 1.0095e-06 2.34351 9.38766e-07 3.96179L0 25.4382C-7.07369e-08 27.0565 0.906042 28.2715 2.1283 28.9046C3.34622 29.5355 4.88769 29.5945 6.1808 28.9035ZM24.8221 13.8026C25.5742 14.2045 25.5742 15.1955 24.8221 15.5974L4.72891 26.3356C3.94628 26.7539 3.01386 26.2165 3.01386 25.4382L3.01386 3.96179C3.01386 3.18347 3.94628 2.6461 4.72891 3.06436L24.8221 13.8026Z" fill="#F1F1F1"/> 914 </svg> 915 </div> 916 '.esc_html__('Play Video','wpstream').' 917 </div>'; 918 919 920 921 print '<div id="wpstream_video_on_demand_mute_trailer_btn_' . $now . '" class="wpstream_video_on_demand_mute_trailer"> 949 <svg width="37" height="36" viewBox="0 0 37 36" fill="none" xmlns="http://www.w3.org/2000/svg"> 950 <path fill-rule="evenodd" clip-rule="evenodd" d="M1.32143 10.0789H8.69499L18.8964 0L21.1428 0.921053V35.1316L18.8964 36L8.69499 25.8684H1.32143L0 24.5526V11.3947L1.32143 10.0789ZM10.175 23.6842L18.5 31.9474V4.10526L10.175 12.3158L9.24999 12.7105H2.64286V23.2368H9.24999L10.175 23.6842ZM37 17.9737C37.0069 22.2216 35.5329 26.3401 32.8295 29.6263L30.9478 27.7579C33.1613 24.9734 34.3629 21.5249 34.3571 17.9737C34.3571 14.2895 33.0885 10.8974 30.9637 8.21053L32.8454 6.34211C35.5382 9.62494 37.0062 13.735 37 17.9737ZM31.7143 17.9737C31.7193 20.8255 30.7895 23.6011 29.0661 25.8789L27.1738 23.9947C28.4127 22.2295 29.0752 20.1272 29.0714 17.9737C29.0751 15.8287 28.4174 13.7344 27.1871 11.9737L29.0793 10.0895C30.7338 12.2868 31.7143 15.0158 31.7143 17.9737ZM26.4286 17.9737C26.4286 19.4842 26.0057 20.8947 25.2657 22.0947L23.3126 20.1526C23.6249 19.4729 23.7876 18.7345 23.7899 17.9869C23.7922 17.2394 23.634 16.5001 23.3258 15.8184L25.2789 13.8737C26.0083 15.0684 26.4286 16.4737 26.4286 17.9737Z" fill="white"/> 951 </svg> 952 </div>'; 953 print '<div id="wpstream_video_on_demand_unmute_trailer_btn_' . $now . '" class="wpstream_video_on_demand_unmute_trailer"> 954 <svg width="33" height="32" viewBox="0 0 33 32" fill="none" xmlns="http://www.w3.org/2000/svg"> 955 <path fill-rule="evenodd" clip-rule="evenodd" d="M1.15625 8.85688H7.60813L16.5344 0L18.5 0.809375V30.8719L16.5344 31.635L7.60813 22.7319H1.15625L0 21.5756V10.0131L1.15625 8.85688ZM8.90313 20.8125L16.1875 28.0738V3.6075L8.90313 10.8225L8.09375 11.1694H2.3125V20.4194H8.09375L8.90313 20.8125ZM30.5967 11.3127L32.2316 12.9477L28.2287 16.9506L32.2316 20.9559L30.5967 22.5908L26.5938 18.5856L22.5885 22.5908L20.9536 20.9559L24.9588 16.9506L20.9513 12.95L22.5862 11.3151L26.5938 15.3157L30.5967 11.3127Z" fill="white"/> 956 </svg> 957 958 </div>'; 959 print '<script type="text/javascript"> 960 //<![CDATA[ 961 jQuery(document).ready(function(){ 962 console.log("wpstream_video_on_demand_player 886"); 963 wpstream_player_initialize_vod({ 964 titleOverlayElementId:"'.$overlay_video_div_id.'", 965 videoElementId: "wpstream-video-vod-'.$now.'", 966 trailerUrl: "'.$video_trailer.'", 967 videoUrl: "'.$video_path_final.'", 968 autoplay: '.var_export($autoplay, true).', 969 muted: '.var_export($muted, true).', 970 playTrailerButtonElementId: "wpstream_video_on_demand_play_trailer_btn_'.$now.'", 971 muteTrailerButtonElementId: "wpstream_video_on_demand_mute_trailer_btn_'.$now.'", 972 unmuteTrailerButtonElementId: "wpstream_video_on_demand_unmute_trailer_btn_'.$now.'", 973 playVideoButtonElementId: "wpstream_video_on_demand_play_video_btn_'.$now.'", 974 playerLogoSettings: { 975 image: "'. $this->wpstream_get_video_player_logo() . '", 976 position: "' . esc_html( get_option('wpstream_player_logo_position','top-right') ) . '", 977 opacity: ' . ( intval ( esc_html( get_option('wpstream_player_logo_opacity','100') ) ) / 100 ) . ', 978 width: 100, 979 height: "auto", 980 padding: 10, 981 }, 982 }); 983 }); 984 //]]> 985 </script>'; 986 print '</div>'; 987 } 988 else { 989 print '<script type="text/javascript"> 990 //<![CDATA[ 991 jQuery(document).ready(function(){ 922 992 923 <svg width="37" height="36" viewBox="0 0 37 36" fill="none" xmlns="http://www.w3.org/2000/svg"> 924 <path fill-rule="evenodd" clip-rule="evenodd" d="M1.32143 10.0789H8.69499L18.8964 0L21.1428 0.921053V35.1316L18.8964 36L8.69499 25.8684H1.32143L0 24.5526V11.3947L1.32143 10.0789ZM10.175 23.6842L18.5 31.9474V4.10526L10.175 12.3158L9.24999 12.7105H2.64286V23.2368H9.24999L10.175 23.6842ZM37 17.9737C37.0069 22.2216 35.5329 26.3401 32.8295 29.6263L30.9478 27.7579C33.1613 24.9734 34.3629 21.5249 34.3571 17.9737C34.3571 14.2895 33.0885 10.8974 30.9637 8.21053L32.8454 6.34211C35.5382 9.62494 37.0062 13.735 37 17.9737ZM31.7143 17.9737C31.7193 20.8255 30.7895 23.6011 29.0661 25.8789L27.1738 23.9947C28.4127 22.2295 29.0752 20.1272 29.0714 17.9737C29.0751 15.8287 28.4174 13.7344 27.1871 11.9737L29.0793 10.0895C30.7338 12.2868 31.7143 15.0158 31.7143 17.9737ZM26.4286 17.9737C26.4286 19.4842 26.0057 20.8947 25.2657 22.0947L23.3126 20.1526C23.6249 19.4729 23.7876 18.7345 23.7899 17.9869C23.7922 17.2394 23.634 16.5001 23.3258 15.8184L25.2789 13.8737C26.0083 15.0684 26.4286 16.4737 26.4286 17.9737Z" fill="white"/> 925 </svg> 926 </div>'; 927 print '<div id="wpstream_video_on_demand_unmute_trailer_btn_' . $now . '" class="wpstream_video_on_demand_unmute_trailer"> 928 <svg width="33" height="32" viewBox="0 0 33 32" fill="none" xmlns="http://www.w3.org/2000/svg"> 929 <path fill-rule="evenodd" clip-rule="evenodd" d="M1.15625 8.85688H7.60813L16.5344 0L18.5 0.809375V30.8719L16.5344 31.635L7.60813 22.7319H1.15625L0 21.5756V10.0131L1.15625 8.85688ZM8.90313 20.8125L16.1875 28.0738V3.6075L8.90313 10.8225L8.09375 11.1694H2.3125V20.4194H8.09375L8.90313 20.8125ZM30.5967 11.3127L32.2316 12.9477L28.2287 16.9506L32.2316 20.9559L30.5967 22.5908L26.5938 18.5856L22.5885 22.5908L20.9536 20.9559L24.9588 16.9506L20.9513 12.95L22.5862 11.3151L26.5938 15.3157L30.5967 11.3127Z" fill="white"/> 930 </svg> 931 932 </div>'; 933 print '<script type="text/javascript"> 934 //<![CDATA[ 935 jQuery(document).ready(function(){ 936 console.log("wpstream_video_on_demand_player 886"); 937 wpstream_player_initialize_vod({ 938 titleOverlayElementId:"'.$overlay_video_div_id.'", 939 videoElementId: "wpstream-video-vod-'.$now.'", 940 trailerUrl: "'.$video_trailer.'", 941 videoUrl: "'.$video_path_final.'", 942 autoplay: '.var_export($autoplay, true).', 943 muted: '.var_export($muted, true).', 944 playTrailerButtonElementId: "wpstream_video_on_demand_play_trailer_btn_'.$now.'", 945 muteTrailerButtonElementId: "wpstream_video_on_demand_mute_trailer_btn_'.$now.'", 946 unmuteTrailerButtonElementId: "wpstream_video_on_demand_unmute_trailer_btn_'.$now.'", 947 playVideoButtonElementId: "wpstream_video_on_demand_play_video_btn_'.$now.'", 948 }); 949 }); 950 //]]> 951 </script>'; 952 print '</div>'; 953 } 954 else { 955 print '<script type="text/javascript"> 956 //<![CDATA[ 957 jQuery(document).ready(function(){ 958 959 console.log("wpstream_video_on_demand_player 907"); 960 961 wpstream_player_initialize_vod({ 962 titleOverlayElementId:"'.$overlay_video_div_id.'", 963 videoElementId: "wpstream-video-vod-'.$now.'", 964 videoUrl: "'.$video_path_final.'", 965 autoplay: '.var_export($autoplay, true).', 966 muted: '.var_export($muted, true).', 967 }); 968 }); 969 //]]> 970 </script>'; 971 } 972 }else{ 973 print '<div class="wpstream_insuficent_res">'.esc_html__('Insufficient resources to stream this title','wpstream').'</div>'; 974 } 993 console.log("wpstream_video_on_demand_player 907"); 994 995 wpstream_player_initialize_vod({ 996 titleOverlayElementId:"'.$overlay_video_div_id.'", 997 videoElementId: "wpstream-video-vod-'.$now.'", 998 videoUrl: "'.$video_path_final.'", 999 autoplay: '.var_export($autoplay, true).', 1000 muted: '.var_export($muted, true).', 1001 playerLogoSettings: { 1002 image: "'. $this->wpstream_get_video_player_logo() . '", 1003 position: "' . esc_html( get_option('wpstream_player_logo_position','top-right') ) . '", 1004 opacity: ' . ( intval ( esc_html( get_option('wpstream_player_logo_opacity','100') ) ) / 100 ) . ', 1005 width: 100, 1006 height: "auto", 1007 padding: 10, 1008 } 1009 }); 1010 }); 1011 //]]> 1012 </script>'; 1013 } 1014 }else{ 1015 print '<div class="wpstream_insuficent_res">'.esc_html__('Insufficient resources to stream this title','wpstream').'</div>'; 1016 } 975 1017 976 1018 } … … 986 1028 wp_enqueue_script('video.min'); 987 1029 wp_enqueue_script('wpstream-player'); 988 989 1030 1031 1032 $player_theme = $this->wpstream_get_player_theme(); 990 1033 $now = time().rand(0,1000000); 991 1034 $overlay_video_div_id = "random_id_".$now; … … 1017 1060 1018 1061 1019 // TODO (crerem) populate these from VOD settings 1020 $autoplay = false; 1021 $muted = true; 1062 $autoplay = false; 1063 $muted = false; 1064 1065 if( intval ( get_option('wpstream_vod_start_muted','') ) === 1){ 1066 $muted = true; 1067 } 1068 if( intval ( get_option('wpstream_vod_autoplay','') ) === 1 ){ 1069 $autoplay = true; 1070 } 1022 1071 $video_path_final=''; 1023 1072 $has_trailer_class='wpstream_theme_player_has_trailer'; 1024 1073 1025 echo '<video id="wpstream-video-vod-'.$now.'" class="video-js vjs-default-skin vjs-fluid kuk wpstream_video_on_demand vjs-wpstream '.esc_attr( $has_trailer_class ).' " data-me="'.esc_attr($usernamestream).'" data-product-id="'.$product_id.'" playsinline preload="auto"1074 echo '<video id="wpstream-video-vod-'.$now.'" class="video-js vjs-default-skin vjs-fluid kuk wpstream_video_on_demand vjs-wpstream '.esc_attr( $has_trailer_class ).' ' . $player_theme . '" data-me="'.esc_attr($usernamestream).'" data-product-id="'.$product_id.'" playsinline preload="auto" 1026 1075 > 1027 1076 <p class="vjs-no-js"> … … 1066 1115 playTrailerButtonElementId: "wpstream_video_on_demand_play_trailer_btn_'.$now.'", 1067 1116 muteTrailerButtonElementId: "wpstream_video_on_demand_mute_trailer_btn_'.$now.'", 1068 unmuteTrailerButtonElementId: "wpstream_video_on_demand_unmute_trailer_btn_'.$now.'", 1117 unmuteTrailerButtonElementId: "wpstream_video_on_demand_unmute_trailer_btn_'.$now.'",, 1118 playerLogoSettings: { 1119 image: "'. $this->wpstream_get_video_player_logo() . '", 1120 position: "' . esc_html( get_option('wpstream_player_logo_position','top-right') ) . '", 1121 opacity: ' . ( intval ( esc_html( get_option('wpstream_player_logo_opacity','100') ) ) / 100 ) . ', 1122 width: 100, 1123 height: "auto", 1124 padding: 10, 1125 }, 1069 1126 }); 1070 1127 }); … … 1471 1528 1472 1529 } 1473 1474 1530 1531 /** 1532 * Get the video player logo URL. 1533 * 1534 * @return mixed|string 1535 */ 1536 public function wpstream_get_video_player_logo() { 1537 if ( $this->wpstream_is_streamify_user() ) { 1538 return WPSTREAM_PLUGIN_DIR_URL . 'img/default_300.png'; 1539 } 1540 1541 $logo = get_option( 'wpstream_player_logo', '' ); 1542 if ( ! empty( $logo ) ) { 1543 return $logo; 1544 } 1545 } 1546 1547 public function wpstream_is_streamify_user() { 1548 $pack_details = $this->main->wpstream_live_connection->wpstream_request_pack_data_per_user(); 1549 if ( isset( $pack_details['total_data_mb'] ) && $pack_details['total_data_mb'] === 500 && 1550 isset( $pack_details['total_storage_mb'] ) && $pack_details['total_storage_mb'] === 100 1551 ) { 1552 return true; 1553 } 1554 return false; 1555 } 1475 1556 } -
wpstream/trunk/public/class-wpstream-public.php
r3278949 r3312871 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.min.css', array(), WPSTREAM_PLUGIN_VERSION, 'all'); 75 wp_enqueue_style('videojs-wpstream-player', plugin_dir_url( __FILE__ ).'/css/videojs-wpstream.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 wp_enqueue_style( 76 'videojs-wpstream-player', 77 plugin_dir_url( __FILE__ ).'/css/videojs-wpstream.css', 78 array(), 79 WPSTREAM_PLUGIN_VERSION . '.' . filemtime( plugin_dir_path(__FILE__) . 'css/videojs-wpstream.css' ), 80 'all' 81 ); 76 82 wp_enqueue_style('wpstream-integrations', plugin_dir_url( __DIR__ ) .'integrations/css/integrations.css',array(), WPSTREAM_PLUGIN_VERSION, 'all' ); 77 83 } … … 84 90 public function enqueue_scripts() { 85 91 86 87 wp_register_script('video.min', 'https://vjs.zencdn.net/8.20.0/video.min.js', WPSTREAM_PLUGIN_VERSION, true); 92 // Register the VideoJS script 93 // Enqueuing is happing directly wherever is used 94 wp_register_script('video.min', 'https://vjs.zencdn.net/8.20.0/video.min.js', WPSTREAM_PLUGIN_VERSION, true); 95 96 // Enqueue the VideoJS Logo plugin script 97 wp_enqueue_script( 98 'videojs-logo', 99 'https://cdn.jsdelivr.net/npm/videojs-logo@latest/dist/videojs-logo.min.js', 100 array('video.min'), 101 '3.0.0', 102 true 103 ); 88 104 wp_register_script('youtube.min', 89 105 plugin_dir_url( __FILE__ ).'js/youtube.min.js', … … 91 107 WPSTREAM_PLUGIN_VERSION, true); 92 108 93 wp_register_script('wpstream-player', 94 plugin_dir_url( __FILE__ ).'js/wpstream-player.js', 95 array('video.min'), 96 WPSTREAM_PLUGIN_VERSION,true); 97 98 wp_localize_script('wpstream-player', 'wpstream_player_vars', 109 wp_register_script( 110 'wpstream-player', 111 plugin_dir_url( __FILE__ ).'js/wpstream-player.js', 112 array('video.min'), 113 WPSTREAM_PLUGIN_VERSION . '.' . filemtime(plugin_dir_path(__FILE__) . 'js/wpstream-player.js'), 114 true 115 ); 116 117 wp_localize_script('wpstream-player', 'wpstream_player_vars', 99 118 array( 100 119 'admin_url' => get_admin_url(), … … 106 125 'wpstream_player_state_paused_msg' => esc_html__('The live stream is paused','wpstream'), 107 126 'wpstream_player_state_ended_msg' => esc_html__('The live stream has ended','wpstream'), 127 'wpstream_player_theme' => get_option('wpstream_video_player_theme'), 128 'playerLogoSettings' => array( 129 'imageUrl' => $this->main->wpstream_player->wpstream_get_video_player_logo(), 130 'position' => get_option( 'wpstream_player_logo_position', 'top-left' ), 131 'opacity' => get_option('wpstream_player_logo_opacity', '100'), 132 ), 108 133 ) 109 134 ); … … 181 206 182 207 } 208 183 209 184 210 -
wpstream/trunk/public/css/video-js.css
r2162139 r3312871 594 594 height: 3.0em; 595 595 background-color: #2B333F; 596 background-color: rgba(43, 51, 63, 0.7); } 596 background-color: rgba(43, 51, 63, 0.7); 597 } 598 599 .video-js:not(.vjs-theme-default) .vjs-control-bar { 600 height: 54px; 601 } 602 603 /* Fantasy theme */ 604 .video-js.vjs-theme-fantasy .vjs-control { 605 height: 100%; 606 align-items: center; 607 } 608 609 .video-js.vjs-theme-fantasy .vjs-control-bar .vjs-play-control { 610 width: 4em; 611 } 612 613 .video-js.vjs-theme-fantasy .vjs-play-progress:before { 614 content: ''; 615 } 616 617 .vjs-wpstream.vjs-theme-fantasy .vjs-play-control.vjs-button>.vjs-icon-placeholder:before { 618 font-size: 1.8em; 619 } 620 621 .vjs-wpstream.vjs-theme-fantasy .vjs-button > .vjs-icon-placeholder:before { 622 display: flex; 623 align-items: center; 624 width: 1.2em; 625 } 626 627 .wp-theme-hello-wpstream .vjs-wpstream.vjs-theme-fantasy .vjs-button > .vjs-icon-placeholder:before { 628 line-height: 1.9 !important; 629 } 630 631 .video-js.vjs-theme-fantasy .vjs-play-progress:before { 632 top: -.25em; 633 } 634 635 .video-js.vjs-theme-fantasy .vjs-play-progress { 636 background-color: var(--vjs-theme-fantasy--primary); 637 } 638 639 .vjs-wpstream.vjs-theme-fantasy .vjs-volume-panel .vjs-button > .vjs-icon-placeholder:before { 640 display: block; 641 line-height: 54px; 642 } 643 644 .wpstream-featured-player-wrapper .video-js.vjs-theme-fantasy .vjs-live-display { 645 margin: 0; 646 } 647 /* End of Fantasy theme */ 648 649 /* City theme */ 650 .video-js.vjs-theme-city .vjs-control-bar { 651 height: 60px; 652 } 653 654 .video-js.vjs-theme-city .vjs-control-bar .vjs-remaining-time { 655 display: flex; 656 align-content: center; 657 flex-wrap: wrap; 658 659 flex: 3 1; 660 line-height: 50px; 661 order: 1; 662 text-align: left; 663 height: 100%; 664 left: 20px; 665 } 666 667 .function_wpstream_live_event_player .video-js.vjs-theme-city .vjs-control-bar .vjs-remaining-time { 668 display: none; 669 } 670 671 .function_wpstream_live_event_player .video-js.vjs-theme-city .vjs-live-control { 672 flex: 3 1; 673 left: 20px; 674 } 675 676 .function_wpstream_live_event_player .video-js.vjs-theme-city .vjs-live-control .vjs-live-display { 677 background-color: #670000; 678 margin-top: 11px; 679 } 680 681 .video-js.vjs-theme-city .vjs-progress-control { 682 width: 100%; 683 position: absolute; 684 height: 20px; 685 } 686 687 .video-js.vjs-theme-city > .vjs-control-bar { 688 background-color: initial; 689 } 690 691 .video-js.vjs-theme-city > .vjs-control-bar > .vjs-play-control { 692 flex: 8 1; 693 } 694 695 .video-js.vjs-theme-city .vjs-progress-control .vjs-progress-holder { 696 margin: 0; 697 } 698 699 .video-js.vjs-theme-city .vjs-progress-control .vjs-volume-panel .vjs-volume-bar { 700 background-color: initial; 701 } 702 703 .video-js.vjs-theme-city .vjs-volume-panel .vjs-volume-bar { 704 background-color: initial; 705 } 706 707 .video-js.vjs-theme-city .vjs-volume-panel.vjs-volume-panel-horizontal:hover { 708 width: 3em; 709 } 710 711 .video-js.vjs-theme-city .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal { 712 width: 3em !important; 713 height: 100%; 714 opacity: 1; 715 } 716 717 .video-js.vjs-theme-city .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-horizontal { 718 height: 100%; 719 } 720 721 .video-js.vjs-theme-city .vjs-volume-panel > *, 722 .video-js.vjs-theme-forest .vjs-volume-panel > * { 723 transition: none !important; 724 } 725 726 .video-js.vjs-theme-city .vjs-volume-level, 727 .video-js.vjs-theme-forest .vjs-volume-level { 728 background-color: transparent !important; 729 } 730 731 .video-js.vjs-theme-city .vjs-volume-level:before { 732 position: relative; 733 } 734 735 .video-js.vjs-theme-city .vjs-volume-panel { 736 width: 34px !important; 737 flex: 1 !important; 738 padding-top: 0; 739 } 740 741 .video-js.vjs-theme-city .vjs-volume-bar:before { 742 position: relative; 743 } 744 745 .video-js.vjs-theme-city .vjs-volume-panel:not(:hover) .vjs-volume-control .vjs-mouse-display { 746 visibility: hidden; 747 } 748 749 .vjs-wpstream.vjs-theme-city .vjs-picture-in-picture-control, 750 .vjs-wpstream.vjs-theme-city .vjs-fullscreen-control, 751 .vjs-wpstream.vjs-theme-city .vjs-fullscreen-control:hover { 752 background-size: auto !important; 753 background-position: 50% 54% !important; 754 } 755 /* End of City theme */ 756 757 /* Forest theme */ 758 .video-js.vjs-theme-forest .vjs-control-bar { 759 height: 3em; 760 background-color: transparent; 761 } 762 .video-js.vjs-theme-forest .vjs-control-bar button .vjs-icon-placeholder:before, .vjs-wpstream .vjs-live-control { 763 line-height: 1.6; 764 } 765 .video-js.vjs-theme-forest .vjs-control-bar .vjs-picture-in-picture-control, 766 .video-js.vjs-theme-forest .vjs-control-bar .vjs-fullscreen-control { 767 width: 3em; 768 height: 3em; 769 } 770 .video-js.vjs-theme-forest .vjs-volume-panel.vjs-volume-panel-horizontal:hover { 771 width: 34px; 772 transition: none; 773 } 774 .video-js.vjs-theme-forest .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal { 775 transition: none; 776 } 777 .video-js.vjs-theme-forest .vjs-volume-panel .vjs-slider { 778 background-color: transparent; 779 } 780 .video-js.vjs-theme-forest .vjs-volume-panel:not(:hover) .vjs-volume-control .vjs-mouse-display { 781 visibility: hidden; 782 } 783 .video-js.vjs-theme-forest .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal { 784 width: 5em; 785 height: 3em; 786 opacity: 1; 787 } 788 789 .video-js.vjs-theme-forest .vjs-big-play-button .vjs-icon-placeholder { 790 display: block; 791 } 792 793 .video-js.vjs-theme-forest .vjs-progress-control:hover .vjs-time-tooltip, 794 .video-js.vjs-theme-forest .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip { 795 font-size: 1em; 796 } 797 798 /* End of Forest theme */ 799 800 /* Sea theme */ 801 .video-js.vjs-theme-sea .vjs-control-bar { 802 height: 4em; 803 } 804 .video-js.vjs-theme-sea .vjs-progress-control { 805 height: 4em; 806 } 807 .vjs-wpstream.vjs-theme-sea .vjs-time-control { 808 height: 4em; 809 line-height: 4em; 810 } 811 .video-js.vjs-theme-sea .vjs-volume-panel { 812 height: 4em; 813 } 814 815 .theme-hello-wpstream .function_wpstream_live_event_player .video-js.vjs-theme-sea .vjs-live-control .vjs-live-display { 816 background-color: #670000; 817 margin-top: 11px; 818 } 819 /* End of Sea theme */ 820 821 .video-js .vjs-poster img { 822 width: 100%; 823 } 597 824 598 825 .vjs-has-started .vjs-control-bar { -
wpstream/trunk/public/css/videojs-wpstream.css
r2438830 r3312871 1 .vjs-wpstream .vjs-control-bar {1 .vjs-wpstream.vjs-theme-default .vjs-control-bar { 2 2 background-color: hsl(0 0% 100% / 0); 3 3 padding: 0px 12px; 4 4 height: auto; 5 5 height: 4em; 6 align-items: center; 6 7 } 7 8 … … 41 42 font-size: 1.1em; 42 43 line-height: 3em; 44 height: 4em; 43 45 } 44 46 … … 46 48 .vjs-wpstream .vjs-volume-panel .vjs-volume-control { 47 49 margin: 0px 0px 0px 0px; 50 } 51 52 .vjs-wpstream .vjs-volume-panel .vjs-volume-control .vjs-volume-tooltip { 53 position: static; 54 margin-top: -20px; 48 55 } 49 56 -
wpstream/trunk/public/css/wpstream_style.css
r3288783 r3312871 213 213 .video-js:hover .vjs-icon-placeholder{ 214 214 opacity: 1; 215 } 216 217 .video-js.vjs-logo.logo-top .vjs-logo-content { 218 top: 30px !important; 219 } 220 221 .video-js.vjs-logo.logo-bottom .vjs-logo-content { 222 bottom: 40px !important; 223 } 224 225 .video-js .vjs-logo-content { 226 position: absolute; 227 } 228 229 .video-js.vjs-has-started .vjs-logo-content img { 230 height: auto; 231 } 232 233 .video-js .vjs-volume-level:before { 234 font-size: 10px !important; 235 /*top: 0 !important;*/ 215 236 } 216 237 -
wpstream/trunk/public/js/wpstream-player.js
r3288783 r3312871 297 297 }); 298 298 299 this.applyTheme(wpstream_player_vars.wpstream_player_theme) 300 301 if ( typeof this.player.logo === 'function' && wpstream_player_vars.playerLogoSettings ) { 302 this.player.logo({ 303 image: wpstream_player_vars.playerLogoSettings.imageUrl, 304 position: wpstream_player_vars.playerLogoSettings.position, 305 width: 100, 306 height: 'auto', 307 opacity: parseFloat(wpstream_player_vars.playerLogoSettings.opacity)/100, 308 padding: 10, 309 }); 310 } 311 299 312 if (this.master.settings.theaterModeButtons) { 300 313 const Button = videojs.getComponent("Button"); … … 451 464 if (!this.playingTrailer) this.qoe.error(); 452 465 }); 466 } 467 468 applyTheme(themeName) { 469 const themes = ['vjs-theme-city', 'vjs-theme-forest', 'vjs-theme-sunset', 'vjs-theme-sea']; 470 themes.forEach(theme => { 471 this.player.removeClass(theme); 472 }) 473 474 this.player.addClass(`vjs-theme-${themeName}`); 475 } 476 477 initThemeSelector() { 478 const Button = videojs.getComponent('Button'); 479 const owner = this; 480 453 481 } 454 482 … … 1240 1268 player.muted(settings.muted); 1241 1269 1270 if ( typeof player.logo === 'function' && settings.playerLogoSettings ) { 1271 player.logo(settings.playerLogoSettings); 1272 } 1273 1242 1274 const originalPoster = player.poster(); 1243 1275 -
wpstream/trunk/readme.txt
r3296345 r3312871 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.1 7 Stable tag: 4.6.7. 37 Stable tag: 4.6.7.4 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.6.7.4 = 141 * Feature - Give the video player a different look using the theme option 142 * Feature - Display a logo over the video player 143 * Enhancement - Fix issue regarding the basic streaming functionality when the video doesn't start 144 140 145 = 4.6.7.3 = 141 146 * Fix - Broken WpStream login functionality -
wpstream/trunk/streamify/streamify.php
r3233738 r3312871 342 342 343 343 function wpstreamify_add_rewrite_rules() { 344 add_rewrite_rule('^wpstreamify/(.+)$', 'index.php?wpstreamify_path=$matches[1]', 'top'); 344 $rewrite_rules = get_option('rewrite_rules'); 345 $rule_pattern = '^wpstreamify/(.+)$'; 346 $rule_target = 'index.php?wpstreamify_path=$matches[1]'; 347 348 // Check if the rewrite rule already exists 349 if (!isset($rewrite_rules[$rule_pattern]) || $rewrite_rules[$rule_pattern] !== $rule_target) { 350 add_rewrite_rule($rule_pattern, $rule_target, 'top'); 351 flush_rewrite_rules(); 352 } 345 353 } 346 354 add_action('init', 'wpstreamify_add_rewrite_rules'); -
wpstream/trunk/wpstream.php
r3296345 r3312871 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. 36 * Version: 4.6.7.4 7 7 * Author: wpstream 8 8 * Author URI: http://wpstream.net … … 15 15 die; 16 16 } 17 define('WPSTREAM_PLUGIN_VERSION', '4.6.7. 3');17 define('WPSTREAM_PLUGIN_VERSION', '4.6.7.4'); 18 18 define('WPSTREAM_CLUBLINK', 'wpstream.net'); 19 19 define('WPSTREAM_CLUBLINKSSL', 'https');
Note: See TracChangeset
for help on using the changeset viewer.