<?php if ($pt->is_movie) { ?>
   <link rel="stylesheet" href="{{CONFIG theme_url}}/css/night-mode.css">
   <style>
      .video-options {
      margin-top: 0;border-top: none;
      }
   </style>
<?php } ?>
<div class="top-video video-player-page six_padding_15" id="padding_15">
   <div class="row">
      <div class="<?php echo(($pt->is_wl || $pt->is_list) ? 'play-list-player' : '') ?>">
         <div class="col-md-<?php echo($pt->is_movie ? '12' : '8') ?> player-video yp_pub_elemnt <?php echo($pt->is_movie ? 'movie' : '') ?>">
            <?php if (!$pt->shouldSubscribers) { ?>
            <?php if ($pt->showSubscripation) { ?>
            <?php if (($pt->config->require_login == 'on' && IS_LOGGED) || $pt->config->require_login == 'off') { ?>
            <?php if ($pt->continent_hide == false) { ?>
            <?php if ((($pt->config->sell_videos_system == 'on' && $pt->get_video->sell_video > 0 && $pt->get_video->owner->subscriber_price == 0) || ($pt->get_video->sell_video == 0 && $pt->get_video->owner->subscriber_price == 0)) || ($pt->config->payed_subscribers == 'on' && ($pt->get_video->owner->subscriber_price > 0 || $pt->get_video->owner->subscriber_price == 0) ) || $pt->get_video->is_owner ) { ?>
            <?php
               if (($pt->get_video->owner->subscriber_price == 0 || ($pt->get_video->owner->subscriber_price > 0 && $pt->show_user_video == 1)) || ($pt->config->sell_videos_system == 'on' && $pt->get_video->sell_video > 0)  || $pt->get_video->is_owner) {
               
                if ($pt->get_video->sell_video == 0 || $pt->get_video->is_owner || $pt->video_approved == false  || !empty($pt->get_video->demo) || ($pt->get_video->sell_video > 0 && $pt->is_paid > 0)) { ?>
            <?php if ($pt->video_approved == true || PT_IsAdmin()) { ?>
            <?php if ($pt->get_video->age == false || PT_IsAdmin()) { ?>
            <?php if ($pt->video_type == 'public' || PT_IsAdmin()) { ?>
            <div class="video-player pt_video_player {{USR_AD_TRANS}}" id="post_live_video_<?php echo($pt->get_video->id) ?>">
               <?php if (!empty($pt->vast_url) && empty($pt->get_video->facebook) && empty($pt->get_video->ok) && empty($pt->get_video->vimeo) && empty($pt->get_video->daily) && empty($pt->get_video->twitch)) { ?>
               <div id="adContainer"></div>
               <?php } ?>
               <?php if (!empty($pt->get_video->demo) && PT_GetMedia($pt->get_video->demo) == $pt->get_video->video_location) { ?>
               <?php if (!IS_LOGGED) { ?>
               <?php if (!empty($pt->get_video->main_video_price)) { ?>
               <button class="btn btn-main btn_to_purchase_vid" onselectstart="return false" onclick="location.href = site_url+'/login';">{{LANG pay}} {{CURRENCY}}<?php echo $pt->get_video->main_video_price; ?> </button>
               <?php } ?>
               <?php if (!empty($pt->get_video->rent_price)) { ?>
               <button class="btn btn-main btn_to_purchase_vid" style="right: 125px" onselectstart="return false" onclick="location.href = site_url+'/login';">{{LANG rent}} {{CURRENCY}}<?php echo $pt->get_video->rent_price; ?> </button>
               <?php } ?>
               <?php } else{ ?>
               <?php if (!empty($pt->get_video->main_video_price)) { ?>
               <button class="btn btn-main p_t_show_btn_ p_t_show_btn_buy btn_to_purchase_vid" onselectstart="return false" onclick="pay_to_see(<?php echo $pt->get_video->id; ?>,<?php echo $pt->get_video->main_video_price; ?>)">{{LANG pay}} {{CURRENCY}}<?php echo $pt->get_video->main_video_price; ?> </button>
               <?php } ?>
               <?php if (!empty($pt->get_video->rent_price)) { ?>
               <button class="btn btn-main p_t_show_btn_ p_t_show_btn_rent btn_to_purchase_vid" style="right: 125px" onselectstart="return false" onclick="pay_to_see(<?php echo $pt->get_video->id; ?>,<?php echo $pt->get_video->rent_price; ?>,'rent')">{{LANG rent}} {{CURRENCY}}<?php echo $pt->get_video->rent_price; ?> </button>
               <?php } ?>
               <?php } ?>
               <?php } ?>
               <?php if (!empty($pt->config->watermark)) { ?>
               <div class="watermark">
                  <a href="{{CONFIG site_url}}"><img src="{{CONFIG watermark}}" alt='watermark logo'></a>
               </div>
               <?php } ?>
               <?php if ($pt->converted === true && $pt->in_queue == false): ?>
               <?php if (!empty($pt->get_video->facebook)) {?>
               <div class="fb-video" data-href="https://www.facebook.com/<?php echo urldecode($pt->get_video->facebook) ?>" data-width="500" data-show-text="false"></div>
               <?php } else if (!empty($pt->get_video->embed)) {?>
                  <div class="pt_vdo_plyr">
                     <div class="embed-responsive embed-responsive-16by9"><iframe width="100%" src="<?php echo $pt->get_video->video_location ?>" allowfullscreen></iframe></div>
                  </div>
               <?php } else if (!empty($pt->get_video->ok)) {?>
               <div class="pt_vdo_plyr">
                  <div class="embed-responsive embed-responsive-16by9"><iframe width="100%" src="//ok.ru/videoembed/<?php echo $pt->get_video->ok ?>" allowfullscreen></iframe></div>
               </div>
               <?php } else if (!empty($pt->get_video->vimeo)) {?>
               <div class="pt_vdo_plyr">
                  <div class="embed-responsive embed-responsive-16by9"><iframe src="https://player.vimeo.com/video/{{VIDEO_ID}}?api=1;title=0&amp;byline=0&amp;portrait=0&amp;autoplay=1" width="100%" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>
               </div>
               <?php } else if (!empty($pt->get_video->daily)) { ?>
               <div class="pt_vdo_plyr">
                  <div class="embed-responsive embed-responsive-16by9"><iframe width="100%" src="//www.dailymotion.com/embed/video/{{VIDEO_ID}}?PARAMS" allowfullscreen></iframe></div>
               </div>
               <?php } else if (!empty($pt->get_video->youtube) && $pt->config->youtube_player == 'on') { ?>
               <div class="pt_vdo_plyr">
                  <div class="embed-responsive embed-responsive-16by9"><iframe width="100%" src="https://www.youtube.com/embed/<?php echo($pt->get_video->youtube); ?>" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>
               </div>
               <?php } else if (!empty($pt->get_video->twitch)) {
                  if ($pt->get_video->twitch_type != 'streams') {
                     $host = 'localhost';
                     $parse = parse_url($pt->config->site_url);
                     if (!empty($parse) && !empty($parse['host'])) {
                        $host = $parse['host'];
                     }

                     if ($pt->get_video->twitch_type == 'videos') {
                        $link = 'https://player.twitch.tv/?video='.$pt->get_video->twitch.'&parent='.$host;
                     }
                     else{
                        $link = 'https://clips.twitch.tv/embed?clip='.$pt->get_video->twitch.'&parent='.$host;
                     }
                  ?>
               <div class="pt_vdo_plyr">
                  <div class="embed-responsive embed-responsive-16by9"><iframe width="100%" src="<?php echo($link) ?>&autoplay=false" allowfullscreen></iframe></div>
               </div>
               <?php }else{ ?>
               <div class="pt_vdo_plyr">
                  <div class="embed-responsive embed-responsive-16by9">
                     <div id="twitch_player__"></div>
                  </div>
               </div>
               <script type="text/javascript">
                  var options = {
                    width: '100%',
                    channel: "<?php echo($pt->get_video->twitch) ?>",
                  };
                  var player = new Twitch.Player("twitch_player__", options);
               </script>
               <?php } ?>
               <?php } else {  ?>
               <?php if (!empty($pt->cards)) { ?>
               <?php  foreach ($pt->cards as $key => $card) {
                  ?>
               <div style="position: absolute;z-index: 888;display: none;<?php echo (!empty($card->color) ? 'color: '.$card->color.' !important;' : ''); echo (!empty($card->background_color) ? 'background-color: '.$card->background_color.' !important;' : ''); echo (!empty($card->part) && $card->part == 'top_left' ? 'top: 10px !important; left: 10px !important;' : ''); echo (!empty($card->part) && $card->part == 'top_right' ? 'top: 10px !important; right: 10px !important;' : ''); echo (!empty($card->part) && $card->part == 'bottom_left' ? 'bottom: 40px !important; left: 10px !important;' : ''); echo (!empty($card->part) && $card->part == 'bottom_right' ? 'bottom: 40px !important; right: 10px !important;' : ''); echo (!empty($card->part) && $card->part == 'center' ? 'top: 50% !important; left: 40% !important;' : ''); ?>" class="<?php if($card->type == 'text'){ ?>card_<?php echo(str_replace(':', '_', $card->duration)) ?><?php } ?> <?php echo ($card->type == 'video' || $card->type == 'subscribe' ? 'card_end' : ''); ?>">
                  <?php if ($card->type == 'text' && !empty($card->url)) { ?>
                  <a href="<?php echo($card->url) ?>" target="_blank" style="<?php echo (!empty($card->color) ? 'color: '.$card->color.' !important;' : ''); ?>"><?php echo($card->title) ?></a>
                  <?php }elseif ($card->type == 'text' && empty($card->url)) { ?>
                  <p style="<?php echo (!empty($card->color) ? 'color: '.$card->color.' !important;' : ''); ?>"><?php echo($card->title) ?></p>
                  <?php } ?>
                  <?php if ($card->type == 'subscribe') { ?>
                  <div class="user-wrapper vid_pop_channls <?php if($card->part == 'top_left' || $card->part == 'bottom_left'){echo('pull-left');} if($card->part == 'top_right' || $card->part == 'bottom_right'){echo('pull-right');} ?>">
                     <div class="video-thumb">
                        <a href="<?php echo($pt->get_video->owner->url) ?>" data-load="?link1=timeline&id=<?php echo($pt->get_video->owner->username) ?>">
                        <img src="<?php echo($pt->get_video->owner->avatar) ?>" alt="<?php echo($pt->get_video->owner->name) ?>">
                        </a>
                     </div>
                     <div class="video-title">
                        <a href="<?php echo($pt->get_video->owner->url) ?>" data-load="?link1=timeline&id=<?php echo($pt->get_video->owner->username) ?>">
                           <h4 style="margin-top: 0"><?php echo($pt->get_video->owner->name) ?></h4>
                        </a>
                        <h6>
                           <?php echo($pt->get_video->owner->about) ?>
                        </h6>
                        <?php if (!IS_LOGGED) { ?>
                        <?php if ($pt->get_video->owner->subscriber_price) { ?>
                        <br><br><button class="btn btn-main" onselectstart="return false"onclick="location.href = site_url+'/login';">{{LANG subscribe}} {{CURRENCY}}<?php echo $pt->get_video->owner->subscriber_price; ?> </button>
                        <?php }else{ ?>
                        {{SUBSCIBE_BUTTON}}
                        <?php } ?>
                        <?php }else{ ?>
                        <?php if ($pt->get_video->owner->subscriber_price) { ?>
                        <button class="btn btn-main" onselectstart="return false" onclick="PT_PaySubscribe(<?php echo $pt->get_video->user_id; ?>,this,'subscribe')">{{LANG subscribe}} {{CURRENCY}}<?php echo $pt->get_video->owner->subscriber_price; ?> </button>
                        <?php }else{ ?>
                        {{SUBSCIBE_BUTTON}}
                        <?php } } ?>
                     </div>
                  </div>
                  <?php } ?>
                  <?php if ($card->type == 'video') {
                     $ref_video = PT_GetVideoByID($card->ref_video, 0, 1,2);
                     if (!empty($ref_video) && $ref_video->user_id == $card->user_id) {
                     ?>
                  <div class="video-wrapper <?php if($card->part == 'top_left' || $card->part == 'bottom_left'){echo('pull-left');} if($card->part == 'top_right' || $card->part == 'bottom_right'){echo('pull-right');} ?>" style="max-width: 25%;" data-id="54" id="video-54">
                     <div>
                        <div class="video-thumb">
                           <a href="<?php echo($ref_video->url) ?>" data-load="?link1=watch&id=<?php echo(PT_Slug($ref_video->title, $ref_video->video_id)) ?>"><img src="<?php echo($ref_video->thumbnail) ?>" alt="<?php echo($ref_video->title) ?>" style="width: 100%;"></a>
                        </div>
                        <div class="video-info">
                           <div>
                              <div class="video-title">
                                 <a href="<?php echo($ref_video->url) ?>" title="<?php echo($ref_video->title) ?>" data-load="?link1=watch&id=<?php echo(PT_Slug($ref_video->title, $ref_video->video_id)) ?>"><?php echo($ref_video->title) ?></a>
                              </div>
                           </div>
                        </div>
                        <div class="clear"></div>
                     </div>
                  </div>
                  <?php } } ?>
               </div>
               <?php }} ?>
               <video id="my-video<?php if ($pt->config->player_type == 'fluidPlayer' || $pt->config->player_type == 'plyr') { ?>_<?php echo $pt->get_video->id; ?><?php } ?>" controls  <?php if ($pt->config->player_type == 'videojs') { ?>   class="video-js" data-setup=''  <?php } ?> <?php if (empty($pt->ad_image)) { ?>  <?php } ?> style="width:100%; height:100%;position: relative;" poster="{{THUMBNAIL}}" autoplay playsinline>
                  <?php if (!empty($pt->video_4096)) { ?>
                  <source src="{{VIDEO_LOCATION_4096}}" type="{{VIDEO_TYPE}}" data-quality="4K" title='4K' label='4K' res='4096' size='4096'>
                  <?php } ?>
                  <?php if (!empty($pt->video_2048)) { ?>
                  <source src="{{VIDEO_LOCATION_2048}}" type="{{VIDEO_TYPE}}" data-quality="2K" title='2K' label='2K' res='2048' size='2048'>
                  <?php } ?>
                  <?php if (!empty($pt->video_1080)) { ?>
                  <source src="{{VIDEO_LOCATION_1080}}" type="{{VIDEO_TYPE}}" data-quality="1080p" title='1080p' label='1080p' res='1080' size='1080'>
                  <?php } ?>
                  <?php if (!empty($pt->video_720)) { ?>
                  <source src="{{VIDEO_LOCATION_720}}" type="{{VIDEO_TYPE}}" data-quality="720p" title='720p' label='720p' res='720' size='720'>
                  <?php } ?>
                  <?php if (!empty($pt->video_480)) { ?>
                  <source src="{{VIDEO_LOCATION_480}}" type="{{VIDEO_TYPE}}" data-quality="480p" title='480p' label='480p' res='480' size='480'>
                  <?php } ?>
                  <?php if (!empty($pt->video_360)) { ?>
                  <source src="{{VIDEO_LOCATION_360}}" type="{{VIDEO_TYPE}}" data-quality="360p" title='360p' label='360p' res='360' size='360'>
                  <?php } ?>
                  <?php if (!empty($pt->video_240)) { ?>
                  <source src="{{VIDEO_LOCATION_240}}" type="{{VIDEO_TYPE}}" data-quality="240p" title='240p' label='240p' res='240' size='240'>
                  <?php } ?>
                  <?php if (!empty($pt->get_video->youtube) || (!empty($pt->get_video->video_location) && empty($pt->video_240))) { ?>
                  <source src="{{VIDEO_LOCATION}}" type="{{VIDEO_TYPE}}" data-quality="HD" title='HD' label='HD' res='<?php echo(!empty($pt->video_res) ? $pt->video_res : '360') ?>'>
                  <?php } ?>
                  Your browser does not support HTML5 video.
                  <!-- //src="http://www.youtube.com/watch?v=nOEw9iiopwI" type="video/youtube" -->
               </video>
               <?php if (!empty($pt->ad_image)) { ?>
               <a href="{{AD_P_LINK}}" class="ad-link" target="_blank">
                  <div class="ad-image">
                     <div class="ads-test">Advertisement will close in <span class="timer"><span>{{AD_SKIP_NUM}}</span>s</span></div>
                     <img src="{{AD_IMAGE}}" alt="Ads" />
                  </div>
               </a>
               <?php } ?>
               <?php if ($pt->config->resize_video == 'on') { ?>
               <div class="icons hidde">
                  <span class="expend-player">
                     <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                        <path fill="currentColor" d="M10,21V19H6.41L10.91,14.5L9.5,13.09L5,17.59V14H3V21H10M14.5,10.91L19,6.41V10H21V3H14V5H17.59L13.09,9.5L14.5,10.91Z" />
                     </svg>
                  </span>
               </div>
               <?php } ?>
               <?php } ?>
               {{USER_ADS_DESC_OVERLAY}}
               <?php else: ?>
               <div class="video-processing">
                  <img src="{{THUMBNAIL}}" alt="" style="width: 100%;">
                  <div>
                     <h5>
                        <?php if ($pt->in_queue == true) { ?>
                        <?php if (!empty($pt->video_owner)): ?>
                        {{LANG ur_video_queue}}
                        <?php else: ?>
                        {{LANG this_video_queue}}
                        <?php endif; ?>
                        <?php }else{ ?>
                        <p>
                           <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="feather feather-loader spin spin-svg">
                              <path d="M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z" />
                           </svg>
                        </p>
                        <?php if (!empty($pt->video_owner)): ?>
                        {{LANG ur_video_porcessing}}
                        <?php else: ?>
                        {{LANG this_video_porcessing}}
                        <?php endif; ?>
                        <?php } ?>
                     </h5>
                  </div>
               </div>
               <?php endif; ?>
            </div>
            <div class="clear"></div>
            <?php } else { ?>
            <div class="video-processing">
               <img src="{{THUMBNAIL}}" alt="" style="width: 100%;">
               <div>
                  <h5>
                     <p>
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-shield">
                           <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
                        </svg>
                     </p>
                     {{LANG video_private_text}}
                  </h5>
               </div>
            </div>
            <?php } ?>
            <?php } else { ?>
            <div class="video-processing">
               <img src="{{THUMBNAIL}}" alt="" style="width: 100%;">
               <div>
                  <h5>
                     <p>
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user-x">
                           <path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
                           <circle cx="8.5" cy="7" r="4"></circle>
                           <line x1="18" y1="8" x2="23" y2="13"></line>
                           <line x1="23" y1="8" x2="18" y2="13"></line>
                        </svg>
                     </p>
                     {{LANG age_restrict_text}}
                     <?php if (!IS_LOGGED) { ?>
                     <br><br>
                     <p>{{LANG age_restrcit_text_2}}</p>
                     <?php } ?>
                  </h5>
               </div>
            </div>
            <?php } ?>
            <?php } else { ?>
            <div class="video-processing">
               <img src="{{THUMBNAIL}}" alt="" style="width: 100%;">
               <div>
                  <h5>
                     <p>
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock">
                           <circle cx="12" cy="12" r="10"></circle>
                           <polyline points="12 6 12 12 16 14"></polyline>
                        </svg>
                     </p>
                     {{LANG video_approve_text}}
                  </h5>
               </div>
            </div>
            <?php } ?>
            <?php }else{ ?>
            <div class="video-processing">
               <img src="{{THUMBNAIL}}" alt="" style="width: 100%;">
               <div>
                  <h5>
                     <p>
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-dollar-sign">
                           <line x1="12" y1="1" x2="12" y2="23"></line>
                           <path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path>
                        </svg>
                     </p>
                     <?php if (!empty($pt->get_video->main_video_price) && $pt->get_video->main_video_price > 0) { ?>
                     {{LANG pay_to_see}}
                     <?php }
                        elseif (!empty($pt->get_video->rent_price) && $pt->get_video->rent_price > 0) { ?>
                     {{LANG you_have_to_rent_video}}
                     <?php } ?>
                     <?php if ($pt->get_video->owner->subscriber_price) {
                        $text = str_replace('{{PRICE}}', $pt->currency.$pt->get_video->owner->subscriber_price, $lang_array['buy_or_subscribe']);
                        $text = str_replace('{{USERNAME}}',$pt->get_video->owner->name, $text);
                        echo($text);
                        ?>
                     <?php } ?>
                     <br><br>
                     <?php if (!IS_LOGGED) { ?>
                     <?php if (!empty($pt->get_video->main_video_price)) { ?>
                     <button class="btn btn-main" onselectstart="return false" onclick="location.href = site_url+'/login';">{{LANG pay}} {{CURRENCY}}<?php echo $pt->get_video->main_video_price; ?> </button>
                     <?php }if ($pt->get_video->rent_price){ ?>
                     <button class="btn btn-main" onselectstart="return false" onclick="location.href = site_url+'/login';">{{LANG rent}} {{CURRENCY}}<?php echo $pt->get_video->rent_price; ?> </button>
                     <?php } ?>
                     <?php if ($pt->get_video->owner->subscriber_price) { ?>
                     <br><br><button class="btn btn-main" onselectstart="return false"onclick="location.href = site_url+'/login';">{{LANG subscribe}} {{CURRENCY}}<?php echo $pt->get_video->owner->subscriber_price; ?> </button>
                     <?php } ?>
                     <?php } else{ ?>
                     <?php if (!empty($pt->get_video->main_video_price)) { ?>
                     <button class="btn btn-main p_t_show_btn_ p_t_show_btn_buy" onselectstart="return false" onclick="pay_to_see(<?php echo $pt->get_video->id; ?>,<?php echo $pt->get_video->main_video_price; ?>)">{{LANG pay}} {{CURRENCY}}<?php echo $pt->get_video->main_video_price; ?> </button>
                     <?php }if ($pt->get_video->rent_price){ ?>
                     <button class="btn btn-main p_t_show_btn_ p_t_show_btn_rent" onselectstart="return false" onclick="pay_to_see(<?php echo $pt->get_video->id; ?>,<?php echo $pt->get_video->rent_price; ?>,'rent')">{{LANG rent}} {{CURRENCY}}<?php echo $pt->get_video->rent_price; ?> </button>
                     <?php } ?>
                     <?php if ($pt->get_video->owner->subscriber_price) { ?>
                     <button class="btn btn-main" onselectstart="return false" onclick="PT_PaySubscribe(<?php echo $pt->get_video->user_id; ?>,this,'subscribe')">{{LANG subscribe}} {{CURRENCY}}<?php echo $pt->get_video->owner->subscriber_price; ?> </button>
                     <?php } } ?>
                  </h5>
               </div>
            </div>
            <?php } ?>
            <?php }else{ ?>
            <div class="video-processing">
               <img src="{{THUMBNAIL}}" alt="" style="width: 100%;">
               <div>
                  <h5>
                     <p>
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-dollar-sign">
                           <line x1="12" y1="1" x2="12" y2="23"></line>
                           <path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path>
                        </svg>
                     </p>
                     <?php if ($pt->get_video->owner->subscriber_price) {
                        echo(str_replace('{{PRICE}}', $pt->currency.$pt->get_video->owner->subscriber_price, $lang_array['subscribe_to_see']));
                        ?>
                     <?php }else{ ?>
                     {{LANG pay_to_see}}
                     <?php } ?>
                     <br><br>
                     <?php if (!IS_LOGGED) { ?>
                     <button class="btn btn-main" onselectstart="return false" onclick="location.href = site_url+'/login';">{{LANG subscribe}} {{CURRENCY}}<?php echo $pt->get_video->owner->subscriber_price; ?> </button>
                     <?php } else{ ?>
                     <?php if ($pt->get_video->owner->subscriber_price) { ?>
                     <button class="btn btn-main" onselectstart="return false" onclick="PT_PaySubscribe(<?php echo $pt->get_video->user_id; ?>,this,'subscribe')">{{LANG subscribe}} {{CURRENCY}}<?php echo $pt->get_video->owner->subscriber_price; ?> </button>
                     <?php } } ?>
                  </h5>
               </div>
            </div>
            <?php } }else{ ?>
            <div class="video-processing">
               <img src="{{THUMBNAIL}}" alt="" style="width: 100%;">
               <div>
                  <h5>
                     <p>
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x">
                           <line x1="18" y1="6" x2="6" y2="18"></line>
                           <line x1="6" y1="6" x2="18" y2="18"></line>
                        </svg>
                     </p>
                     {{LANG video_not_available}}
                  </h5>
               </div>
            </div>
            <?php } } else{ ?>
            <div class="video-processing">
               <img src="{{THUMBNAIL}}" alt="" style="width: 100%;">
               <div>
                  <h5>
                     <?php if (empty($_COOKIE['r'])) { ?>
                     <p>
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="feather feather-loader spin spin-svg">
                           <path d="M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z" />
                        </svg>
                     </p>
                     <a href="{{URL}}" data-load="?link1=watch&id={{VIDEO_ID_}}" id="redirect_to_video_page"></a>
                     <?php  } else if (!in_array(base64_decode($_COOKIE['r']), $pt->continents)) { ?>
                     <p>
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x">
                           <line x1="18" y1="6" x2="6" y2="18"></line>
                           <line x1="6" y1="6" x2="18" y2="18"></line>
                        </svg>
                     </p>
                     {{LANG unknown_location}}
                     <?php  } else{ ?>
                     <p>
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x">
                           <line x1="18" y1="6" x2="6" y2="18"></line>
                           <line x1="6" y1="6" x2="18" y2="18"></line>
                        </svg>
                     </p>
                     {{LANG video_not_available_location}}
                     <?php } ?>
                  </h5>
               </div>
            </div>
            <?php } ?>
            <?php }else{ ?>
            <div class="video-processing">
               <img src="{{THUMBNAIL}}" alt="" style="width: 100%;">
               <div>
                  <h5>
                     <p>
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x">
                           <line x1="18" y1="6" x2="6" y2="18"></line>
                           <line x1="6" y1="6" x2="18" y2="18"></line>
                        </svg>
                     </p>
                     <a href='{{PLEASE_LOGIN_LINK}}'><?php echo $lang_array['please_login_to_see_video']; ?></a>
                  </h5>
               </div>
            </div>
            <?php } ?>
            <?php }else{ ?>
            <div class="video-processing">
               <img src="{{THUMBNAIL}}" alt="" style="width: 100%;">
               <div>
                  <h5>
                     <p>
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x">
                           <line x1="18" y1="6" x2="6" y2="18"></line>
                           <line x1="6" y1="6" x2="18" y2="18"></line>
                        </svg>
                     </p>
                     <p>{{LANG requires_subscription}}</p>
                     <?php if (IS_LOGGED) { ?>
                        <button class="btn btn-main" onselectstart="return false" onclick="location.href = site_url+'/go_pro';">{{LANG go_pro}}</button>
                     <?php }else{ ?>
                        <button class="btn btn-main" onselectstart="return false" onclick="location.href = site_url+'/login';">{{LANG login}}/{{LANG register}}</button>
                     <?php } ?>
                  </h5>
               </div>
            </div>
            <?php }}else{ ?>
               <div class="video-processing">
                  <img src="{{THUMBNAIL}}" alt="" style="width: 100%;">
                  <div>
                     <h5>
                        <p>
                           <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x">
                              <line x1="18" y1="6" x2="6" y2="18"></line>
                              <line x1="6" y1="6" x2="18" y2="18"></line>
                           </svg>
                        </p>
                        <p>{{LANG please_subscribe_to_watch}}</p>
                        {{SUBSCIBE_BUTTON}}
                     </h5>
                  </div>
               </div>
            <?php } ?>
            <div class="clear"></div>
         </div>
         <?php if (!$pt->is_movie) { ?>
         <div class="col-md-4 no-padding-left pull-right <?php echo(($pt->is_wl || $pt->is_list) ? 'pt_playlist_right_vid_side play-list-cont-wrapper col-xs-12' : 'desktop') ?>">
            <?php if (!$pt->is_wl && !$pt->is_list) { ?>
            <div class="ads-placment">{{WATCH_SIDEBAR_AD}}</div>
            <div class="article-categories no-padding-both">
               <div class="pt_categories">
                  <ul>
                     <?php foreach($pt->categories as $key => $category) {
                        if (1) { ?>
                     <li><a class="" href="{{LINK videos/category/<?php echo $key?>}}" data-load="?link1=videos&page=category&id=<?php echo $key?>"><?php echo $category?></a></li>
                     <?php } }?>
                  </ul>
                  <div class="clear"></div>
               </div>
            </div>
            <?php if ($pt->config->autoplay_system == 'on') { ?>
            <div class="next-video">
               <div class="next-text pull-left">
                  <h4>{{LANG up_next}}</h4>
               </div>
               <div class="pt_mn_wtch_switch pull-right">
                  <input id="autoplay" type="checkbox" {{COOKIE}} class="tgl autoplay-video">
                  <label class="tgl-btn" for="autoplay">{{LANG autoplay}}</label>
               </div>
               <div class="clear"></div>
            </div>
            <div class="videos-list" id="next-video">
               {{VIDEO_NEXT_SIDEBAR}}
            </div>
            <?php } ?>
            <div class="videos-list related-videos">
               {{VIDEO_SIDEBAR}}
            </div>
            <div class="load-related-videos">
               <button class="btn btn-default" id="load-related-videos">
               <span>{{LANG load_more}}</span><i class="fa fa-circle-o-notch spin hidden"></i>
               </button>
            </div>
            <?php } ?>
            <?php if($pt->is_wl || $pt->is_list){ ?>
                  <div class="content play-list-container">
                     <div class="next-video pt_plist_hdr">
                        <div class="next-text">
                           <h4>
                              <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
                                 <path fill="none" d="M0 0h24v24H0z"/>
                                 <path fill="currentColor" d="M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832z"/>
                              </svg>
                              <?php if ($pt->is_wl) { ?>
                              &nbsp;&nbsp;{{LANG watch_later}} - {{USER name}}
                              <?php }else{ ?>
                              &nbsp;&nbsp;{{LIST_NAME}} - {{LIST_OWNERNAME}}
                              <?php } ?>
                              
                           </h4>
                           <div class="checkbox checkbox-info">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{VID_INDEX}}/{{LIST_COUNT}} {{LANG videos}}</div>
                        </div>
                     </div>
                     <div class="videos-list play-list-cont" id="next-video">{{LIST_SIDEBAR}}</div>
                  </div>
            <?php } ?>
         </div>
         <?php } ?>
      </div>
      <?php if (!$pt->is_movie) { ?>
      <div class="col-md-8 ">
         <div class="content pt_shadow">
            <div class="video-title pt_video_info">
               <input type="hidden" value="{{ID}}" id="video-id">
               <div class="video-big-title">
                  <h1 itemprop="title">{{TITLE}}
                     <?php if ($pt->get_video->privacy == 1 && $pt->get_video->publication_date > 0) { ?> <span class="private-text">{{LANG scheduled}} <?php echo (date('Y,m,d h:i:s A',$pt->get_video->publication_date)); ?></span><?php } ?>
                     <?php if ($pt->get_video->privacy == 1 && $pt->get_video->publication_date == 0) { ?> <span class="private-text">{{LANG private}}</span><?php } ?>
                     <?php if ($pt->get_video->privacy == 2) { ?> <span class="private-text">{{LANG unlisted}}</span><?php } ?>
                     <?php if ($pt->get_video->sell_video > 0) { ?>
                     <?php if ($pt->video_approved == true) { ?>
                     <span><i class="fa fa-check-circle fa-fw verified" title="{{LANG video_verified}}"></i></span>
                     <?php } ?>
                     <?php } ?>
                  </h1>
               </div>
               <div>
                  <?php if (($pt->config->sell_videos_system == 'on') || $pt->get_video->sell_video == 0 ) { ?>
                  <div class="video-likes pull-right">
                     <div class="like-btn {{LIKE_ACTIVE_CLASS}}" id="likes-bar" onclick="Wo_LikeSystem('{{ID}}', 'like', this, 'is_ajax')" data-likes="{{RAEL_LIKES}}" {{ISLIKED}}>
                     <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="thumbs_up">
                        <path fill="currentColor" d="M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.58 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h4v12H1z" />
                     </svg>
                     <span class="likes" id="likes">{{LIKES}}</span>
                  </div>
                  <div class="video-info-element pull-right">
                     <div class="views-bar" style="width: {{DISLIKES_P}}%"></div>
                     <div class="views-bar blue" style="width: {{LIKES_P}}%"></div>
                     <div class="clear"></div>
                  </div>
                  <div class="like-btn text-right {{DIS_ACTIVE_CLASS}}" id="dislikes-bar" onclick="Wo_LikeSystem('{{ID}}', 'dislike', this, 'is_ajax')" data-likes="{{RAEL_DISLIKES}}" {{ISDISLIKED}}>
                  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="thumbs_down">
                     <path fill="currentColor" d="M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h4v12h-4z" />
                  </svg>
                  <span class="likes" id="dislikes">{{DISLIKES}}</span>
               </div>
               <div class="clear"></div>
            </div>
            <?php } ?>
         </div>
         <div class="video-views">
            <span id="video-views-count">{{VIEWS}}</span>&nbsp;{{LANG views}}<span class="bold middot">·</span>
            <?php if ($pt->get_video->sell_video > 0) { ?>
            <span><?php echo $pt->purchased; ?>&nbsp;{{LANG purchased}}</span><span class="bold middot">·</span>
            <?php } ?>
            <span title="{{LANG published_on}} {{TIME}}">{{TIME}}</span>
         </div>
         <?php if ($pt->get_video->sell_video > 0 && PT_IsAdmin()) { ?>
         <br>
         <div class="alert alert-danger">
            <span>{{LANG admin_can_see}}</span>
            <br>
            <?php if (!empty($pt->get_video->main_video_price)) { ?>
            {{LANG video_price}} {{CURRENCY}}<?php echo $pt->get_video->main_video_price; ?>
            <?php } ?>
            <?php if (!empty($pt->get_video->rent_price)) { ?>
            <br>
            {{LANG video_rent_price}} {{CURRENCY}}<?php echo $pt->get_video->rent_price; ?>
            <?php } ?>
         </div>
         <?php } ?>
         <?php if (!empty($pt->video_end)) { ?>
         <br>
         <div class="alert alert-danger">
            <span>{{LANG rent_time_will}} : <?php echo $pt->video_end; ?></span>
         </div>
         <?php } ?>
         <div class="video-options">
            <button class="btn-share" data-toggle="modal" data-target="#share_box">
               <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                  <path fill="currentColor" d="M21,11L14,4V8C7,9 4,14 3,19C5.5,15.5 9,13.9 14,13.9V18L21,11Z" />
               </svg>
               {{LANG share}}
            </button>
            <?php if (empty($pt->get_video->stream_name)) { ?>
            <?php if ($pt->config->embed_system == 'on' && $pt->get_video->embedding == 0) {?>
            <?php if ($pt->get_video->sell_video == 0) { ?>
            <button class="btn-share" data-toggle="modal" data-target="#embed_box">
               <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                  <path fill="currentColor" d="M14.6,16.6L19.2,12L14.6,7.4L16,6L22,12L16,18L14.6,16.6M9.4,16.6L4.8,12L9.4,7.4L8,6L2,12L8,18L9.4,16.6Z" />
               </svg>
               {{LANG embed}}
            </button>
            <?php } ?>
            <?php } } ?>
            <?php if ($pt->get_video->is_owner == true) { ?>
            <a class="btn btn-share" href="{{LINK edit-video/{{ID}}}}" data-load="?link1=edit-video&id=category&id={{ID}}">
               <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                  <path fill="currentColor" d="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z" />
               </svg>
               {{LANG edit_video}}
            </a>
            <?php } if (empty($pt->get_video->stream_name)) { ?>
            <?php
               if (($pt->config->payed_subscribers == 'on' && $pt->get_video->owner->subscriber_price > 0 && $pt->is_paid > 0) || ($pt->config->payed_subscribers == 'off') || ($pt->config->payed_subscribers == 'on' && $pt->get_video->owner->subscriber_price == 0) || (($pt->is_paid > 0 || $pt->get_video->sell_video == 0) && $pt->config->stock_videos == 'on' && $pt->get_video->is_stock == 1) ) {
               if ($pt->config->download_videos == 'on' && empty($pt->get_video->daily) && empty($pt->get_video->vimeo) && empty($pt->get_video->youtube) && $pt->get_video->converted == 1 && empty($pt->get_video->facebook) && $pt->get_video->age == false && $pt->video_approved == true) { ?>
            <?php if ($pt->get_video->sell_video == 0 || (($pt->is_paid > 0 || $pt->get_video->sell_video == 0) && $pt->config->stock_videos == 'on' && $pt->get_video->is_stock == 1)) { ?>
            <?php if ($pt->get_video->privacy != 1 || ($pt->get_video->privacy == 1 && $pt->get_video->is_owner)) { ?>
            <button class="btn-share" data-toggle="modal" data-target="#download_box">
               <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                  <path fill="currentColor" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z" />
               </svg>
               {{LANG download}}
            </button>
            <?php } } } ?>
            <?php } ?>
            <?php if ($pt->get_video->is_owner == false && $pt->config->donate_system == 'on' && !empty($pt->user_data->donation_paypal_email) && $pt->get_video->sell_video == 0) { ?>
            <button class="btn-share" onclick="location.href = 'https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business={{USER donation_paypal_email}}&lc=US&item_name=Donation+to+{{USER name}}&no_note=0&cn=&currency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted'">
               <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                  <path fill="currentColor" d="M22,12V20A2,2 0 0,1 20,22H4A2,2 0 0,1 2,20V12A1,1 0 0,1 1,11V8A2,2 0 0,1 3,6H6.17C6.06,5.69 6,5.35 6,5A3,3 0 0,1 9,2C10,2 10.88,2.5 11.43,3.24V3.23L12,4L12.57,3.23V3.24C13.12,2.5 14,2 15,2A3,3 0 0,1 18,5C18,5.35 17.94,5.69 17.83,6H21A2,2 0 0,1 23,8V11A1,1 0 0,1 22,12M4,20H11V12H4V20M20,20V12H13V20H20M9,4A1,1 0 0,0 8,5A1,1 0 0,0 9,6A1,1 0 0,0 10,5A1,1 0 0,0 9,4M15,4A1,1 0 0,0 14,5A1,1 0 0,0 15,6A1,1 0 0,0 16,5A1,1 0 0,0 15,4M3,8V10H11V8H3M13,8V10H21V8H13Z" />
               </svg>
               {{LANG donate}}
            </button>
            <?php } ?>
            <?php if (IS_LOGGED): ?>
            <button class="btn-share" onclick="PT_AddToList('{{ID}}');">
               <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                  <path fill="currentColor" d="M2,16H10V14H2M18,14V10H16V14H12V16H16V20H18V16H22V14M14,6H2V8H14M14,10H2V12H14V10Z" />
               </svg>
               {{LANG add_to}}
            </button>
            <?php if ($pt->get_video->is_owner == false) { ?>
            <?php if ($pt->reported === true): ?>
            <button class="btn-share btn-report active" onclick="PT_ReportVideo('{{ID}}',this);" data-rep="0">
               <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                  <path fill="currentColor" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" />
               </svg>
               <span>{{LANG cancel_report}}</span>
            </button>
            <?php else: ?>
            <button class="btn-share btn-report" onclick="PT_ReportVideo('{{ID}}',this);" data-rep="1">
               <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                  <path fill="currentColor" d="M14.4,6L14,4H5V21H7V14H12.6L13,16H20V6H14.4Z" />
               </svg>
               <span>{{LANG report}}</span>
            </button>
            <?php endif; ?>
            <?php if (IS_LOGGED && $pt->config->report_copyright == 'on') { ?>
            <button class="btn-share btn-report pull-right" onclick="PT_ReportCopyVideo('{{ID}}',this);" data-rep="1">
               <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                  <path fill="currentColor" d="M14.4,6L14,4H5V21H7V14H12.6L13,16H20V6H14.4Z" />
               </svg>
               <span>{{LANG report_copyright}}</span>
            </button>
            <?php } ?>
            <?php }  ?>
            <?php endif; ?>
            <?php if ($pt->get_video->is_owner) { ?>
            <a href="{{LINK view_analytics/{{VIDEO_ID_}}}}&type=today" class="btn-share btn-report" data-load="?link1=view_analytics&id={{VIDEO_ID_}}&type=today" data-rep="1">
               <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                  <polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline>
                  <polyline points="17 6 23 6 23 12"></polyline>
               </svg>
               <span>{{LANG analytics}}</span>
            </a>
            <?php } ?>
            <?php } ?>
         </div>
         <div class="publisher-element">
            <div class="publisher-avatar pull-left hide-in-mobile-720">
               <a href="{{USER url}}" data-load="?link1=timeline&id={{USER username}}"><img src="{{USER avatar}}" alt="{{USER name}}"></a>
            </div>
            <div class="publisher-name">
               <a href="{{USER url}}" data-load="?link1=timeline&id={{USER username}}">{{USER name_v}}</a><br>
               <?php if ($pt->get_video->owner->privacy->show_subscriptions_count == 'yes') { ?><span>{{SUBS}} {{LANG subscribers}}</span><?php } ?>
            </div>
            <div class="publisher-subscribe-button">{{NOTIFY_BUTTON}}{{SUBSCIBE_BUTTON}}</div>
            <div class="clear"></div>
         </div>
         <div class="clear"></div>
         <div class="video-published">
            <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24">
               <path fill="#666" d="M5.5,7A1.5,1.5 0 0,1 4,5.5A1.5,1.5 0 0,1 5.5,4A1.5,1.5 0 0,1 7,5.5A1.5,1.5 0 0,1 5.5,7M21.41,11.58L12.41,2.58C12.05,2.22 11.55,2 11,2H4C2.89,2 2,2.89 2,4V11C2,11.55 2.22,12.05 2.59,12.41L11.58,21.41C11.95,21.77 12.45,22 13,22C13.55,22 14.05,21.77 14.41,21.41L21.41,14.41C21.78,14.05 22,13.55 22,13C22,12.44 21.77,11.94 21.41,11.58Z" />
            </svg>
            {{LANG in}}
            <a href="{{LINK videos/category/{{CATEGORY_ID}}}}" data-load="?link1=videos&page=category&id={{CATEGORY_ID}}">{{CATEGORY}}</a> <?php if (!empty($pt->sub_category)) { ?>/ <a href="{{LINK videos/category/{{CATEGORY_ID}}/<?php echo($pt->get_video->sub_category) ?>}}" data-load="?link1=videos&page=category&id={{CATEGORY_ID}}&sub_id=<?php echo($pt->get_video->sub_category) ?>">{{SUB_CATEGORY}}</a><?php  } ?>
            <?php if ($pt->config->stock_videos == 'on' && $pt->get_video->is_stock == 1 && !empty($pt->get_video->license)) { ?>
            / <span>{{LANG <?php echo $pt->get_video->license; ?>}}</span>
            <?php } ?>
         </div>
         <div class="watch-video-description">
            <p dir="auto" itemprop="description">{{DESC}}</p>
         </div>
         <div class="watch-video-show-more desc">
            {{LANG show_more}}
         </div>
      </div>
      <?php } else{ ?>
         <br>
         <div class="clear"></div>
         <div class="container">
            <div class="wtch_mv_info_main">
               <div class="content pt_shadow">
                  <div class="video-title pt_video_info">
                     <input type="hidden" value="{{ID}}" id="video-id">
                     <div class="row wtch_mv_main_row">
                        <div class="col-md-3 no-padding-right">
                           <div class="wtch_mv_img">
                              <img src="{{THUMBNAIL}}">
                              <div class="wtch_mv_info_bsc">
                                 <div>
                                    <span><?php echo (!empty($pt->get_video->movie_release) ? $pt->get_video->movie_release : ''); ?></span> <span class="bold">·</span> <span><?php echo (!empty($countries_name[$pt->get_video->country]) ? $countries_name[$pt->get_video->country] : ''); ?></span>
                                 </div>
                                 <span class="mv_qualt"><?php echo (!empty($pt->get_video->quality) ? $pt->get_video->quality : ''); ?></span>
                              </div>
                              <div class="stars" data-stars="<?php echo (!empty($pt->get_video->rating) ? $pt->get_video->rating : ''); ?>">
                                 <svg height="25" width="23" class="star rating" viewBox="0 0 24 24" data-rating="1">
                                    <path d="M6.516,14.323l-1.49,6.452c-0.092,0.399,0.068,0.814,0.406,1.047C5.603,21.94,5.801,22,6,22 c0.193,0,0.387-0.056,0.555-0.168L12,18.202l5.445,3.63c0.348,0.232,0.805,0.223,1.145-0.024c0.338-0.247,0.487-0.68,0.372-1.082 l-1.829-6.4l4.536-4.082c0.297-0.268,0.406-0.686,0.278-1.064c-0.129-0.378-0.47-0.644-0.868-0.676L15.378,8.05l-2.467-5.461 C12.75,2.23,12.393,2,12,2s-0.75,0.23-0.911,0.589L8.622,8.05L2.921,8.503C2.529,8.534,2.192,8.791,2.06,9.16 c-0.134,0.369-0.038,0.782,0.242,1.056L6.516,14.323z"/>
                                 </svg>
                                 <svg height="25" width="23" class="star rating" viewBox="0 0 24 24" data-rating="2">
                                    <path d="M6.516,14.323l-1.49,6.452c-0.092,0.399,0.068,0.814,0.406,1.047C5.603,21.94,5.801,22,6,22 c0.193,0,0.387-0.056,0.555-0.168L12,18.202l5.445,3.63c0.348,0.232,0.805,0.223,1.145-0.024c0.338-0.247,0.487-0.68,0.372-1.082 l-1.829-6.4l4.536-4.082c0.297-0.268,0.406-0.686,0.278-1.064c-0.129-0.378-0.47-0.644-0.868-0.676L15.378,8.05l-2.467-5.461 C12.75,2.23,12.393,2,12,2s-0.75,0.23-0.911,0.589L8.622,8.05L2.921,8.503C2.529,8.534,2.192,8.791,2.06,9.16 c-0.134,0.369-0.038,0.782,0.242,1.056L6.516,14.323z"/>
                                 </svg>
                                 <svg height="25" width="23" class="star rating" viewBox="0 0 24 24" data-rating="3">
                                    <path d="M6.516,14.323l-1.49,6.452c-0.092,0.399,0.068,0.814,0.406,1.047C5.603,21.94,5.801,22,6,22 c0.193,0,0.387-0.056,0.555-0.168L12,18.202l5.445,3.63c0.348,0.232,0.805,0.223,1.145-0.024c0.338-0.247,0.487-0.68,0.372-1.082 l-1.829-6.4l4.536-4.082c0.297-0.268,0.406-0.686,0.278-1.064c-0.129-0.378-0.47-0.644-0.868-0.676L15.378,8.05l-2.467-5.461 C12.75,2.23,12.393,2,12,2s-0.75,0.23-0.911,0.589L8.622,8.05L2.921,8.503C2.529,8.534,2.192,8.791,2.06,9.16 c-0.134,0.369-0.038,0.782,0.242,1.056L6.516,14.323z"/>
                                 </svg>
                                 <svg height="25" width="23" class="star rating" viewBox="0 0 24 24" data-rating="4">
                                    <path d="M6.516,14.323l-1.49,6.452c-0.092,0.399,0.068,0.814,0.406,1.047C5.603,21.94,5.801,22,6,22 c0.193,0,0.387-0.056,0.555-0.168L12,18.202l5.445,3.63c0.348,0.232,0.805,0.223,1.145-0.024c0.338-0.247,0.487-0.68,0.372-1.082 l-1.829-6.4l4.536-4.082c0.297-0.268,0.406-0.686,0.278-1.064c-0.129-0.378-0.47-0.644-0.868-0.676L15.378,8.05l-2.467-5.461 C12.75,2.23,12.393,2,12,2s-0.75,0.23-0.911,0.589L8.622,8.05L2.921,8.503C2.529,8.534,2.192,8.791,2.06,9.16 c-0.134,0.369-0.038,0.782,0.242,1.056L6.516,14.323z"/>
                                 </svg>
                                 <svg height="25" width="23" class="star rating" viewBox="0 0 24 24" data-rating="5">
                                    <path d="M6.516,14.323l-1.49,6.452c-0.092,0.399,0.068,0.814,0.406,1.047C5.603,21.94,5.801,22,6,22 c0.193,0,0.387-0.056,0.555-0.168L12,18.202l5.445,3.63c0.348,0.232,0.805,0.223,1.145-0.024c0.338-0.247,0.487-0.68,0.372-1.082 l-1.829-6.4l4.536-4.082c0.297-0.268,0.406-0.686,0.278-1.064c-0.129-0.378-0.47-0.644-0.868-0.676L15.378,8.05l-2.467-5.461 C12.75,2.23,12.393,2,12,2s-0.75,0.23-0.911,0.589L8.622,8.05L2.921,8.503C2.529,8.534,2.192,8.791,2.06,9.16 c-0.134,0.369-0.038,0.782,0.242,1.056L6.516,14.323z"/>
                                 </svg>
                                 <svg height="25" width="23" class="star rating" viewBox="0 0 24 24" data-rating="6">
                                    <path d="M6.516,14.323l-1.49,6.452c-0.092,0.399,0.068,0.814,0.406,1.047C5.603,21.94,5.801,22,6,22 c0.193,0,0.387-0.056,0.555-0.168L12,18.202l5.445,3.63c0.348,0.232,0.805,0.223,1.145-0.024c0.338-0.247,0.487-0.68,0.372-1.082 l-1.829-6.4l4.536-4.082c0.297-0.268,0.406-0.686,0.278-1.064c-0.129-0.378-0.47-0.644-0.868-0.676L15.378,8.05l-2.467-5.461 C12.75,2.23,12.393,2,12,2s-0.75,0.23-0.911,0.589L8.622,8.05L2.921,8.503C2.529,8.534,2.192,8.791,2.06,9.16 c-0.134,0.369-0.038,0.782,0.242,1.056L6.516,14.323z"/>
                                 </svg>
                                 <svg height="25" width="23" class="star rating" viewBox="0 0 24 24" data-rating="7">
                                    <path d="M6.516,14.323l-1.49,6.452c-0.092,0.399,0.068,0.814,0.406,1.047C5.603,21.94,5.801,22,6,22 c0.193,0,0.387-0.056,0.555-0.168L12,18.202l5.445,3.63c0.348,0.232,0.805,0.223,1.145-0.024c0.338-0.247,0.487-0.68,0.372-1.082 l-1.829-6.4l4.536-4.082c0.297-0.268,0.406-0.686,0.278-1.064c-0.129-0.378-0.47-0.644-0.868-0.676L15.378,8.05l-2.467-5.461 C12.75,2.23,12.393,2,12,2s-0.75,0.23-0.911,0.589L8.622,8.05L2.921,8.503C2.529,8.534,2.192,8.791,2.06,9.16 c-0.134,0.369-0.038,0.782,0.242,1.056L6.516,14.323z"/>
                                 </svg>
                                 <svg height="25" width="23" class="star rating" viewBox="0 0 24 24" data-rating="8">
                                    <path d="M6.516,14.323l-1.49,6.452c-0.092,0.399,0.068,0.814,0.406,1.047C5.603,21.94,5.801,22,6,22 c0.193,0,0.387-0.056,0.555-0.168L12,18.202l5.445,3.63c0.348,0.232,0.805,0.223,1.145-0.024c0.338-0.247,0.487-0.68,0.372-1.082 l-1.829-6.4l4.536-4.082c0.297-0.268,0.406-0.686,0.278-1.064c-0.129-0.378-0.47-0.644-0.868-0.676L15.378,8.05l-2.467-5.461 C12.75,2.23,12.393,2,12,2s-0.75,0.23-0.911,0.589L8.622,8.05L2.921,8.503C2.529,8.534,2.192,8.791,2.06,9.16 c-0.134,0.369-0.038,0.782,0.242,1.056L6.516,14.323z"/>
                                 </svg>
                                 <svg height="25" width="23" class="star rating" viewBox="0 0 24 24" data-rating="9">
                                    <path d="M6.516,14.323l-1.49,6.452c-0.092,0.399,0.068,0.814,0.406,1.047C5.603,21.94,5.801,22,6,22 c0.193,0,0.387-0.056,0.555-0.168L12,18.202l5.445,3.63c0.348,0.232,0.805,0.223,1.145-0.024c0.338-0.247,0.487-0.68,0.372-1.082 l-1.829-6.4l4.536-4.082c0.297-0.268,0.406-0.686,0.278-1.064c-0.129-0.378-0.47-0.644-0.868-0.676L15.378,8.05l-2.467-5.461 C12.75,2.23,12.393,2,12,2s-0.75,0.23-0.911,0.589L8.622,8.05L2.921,8.503C2.529,8.534,2.192,8.791,2.06,9.16 c-0.134,0.369-0.038,0.782,0.242,1.056L6.516,14.323z"/>
                                 </svg>
                                 <svg height="25" width="23" class="star rating" viewBox="0 0 24 24" data-rating="10">
                                    <path d="M6.516,14.323l-1.49,6.452c-0.092,0.399,0.068,0.814,0.406,1.047C5.603,21.94,5.801,22,6,22 c0.193,0,0.387-0.056,0.555-0.168L12,18.202l5.445,3.63c0.348,0.232,0.805,0.223,1.145-0.024c0.338-0.247,0.487-0.68,0.372-1.082 l-1.829-6.4l4.536-4.082c0.297-0.268,0.406-0.686,0.278-1.064c-0.129-0.378-0.47-0.644-0.868-0.676L15.378,8.05l-2.467-5.461 C12.75,2.23,12.393,2,12,2s-0.75,0.23-0.911,0.589L8.622,8.05L2.921,8.503C2.529,8.534,2.192,8.791,2.06,9.16 c-0.134,0.369-0.038,0.782,0.242,1.056L6.516,14.323z"/>
                                 </svg>
                              </div>
                           </div>
                        </div>
                        <div class="col-md-9">
                           <?php if (!empty($pt->get_video->trailer)) { ?>
                           <button type="button" class="btn btn-success pt_mve_btn" data-toggle="modal" data-target="#movie_trailer">
                              <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                                 <path fill="currentColor" d="M20.84 2.18L16.91 2.96L19.65 6.5L21.62 6.1L20.84 2.18M13.97 3.54L12 3.93L14.75 7.46L16.71 7.07L13.97 3.54M9.07 4.5L7.1 4.91L9.85 8.44L11.81 8.05L9.07 4.5M4.16 5.5L3.18 5.69A2 2 0 0 0 1.61 8.04L2 10L6.9 9.03L4.16 5.5M2 10V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V10H2Z" />
                              </svg>
                              {{LANG video_trailer}}
                           </button>
                           <?php } ?>
                           <div class="video-big-title">
                              <h1 itemprop="title">{{TITLE}}
                                 <?php if ($pt->get_video->privacy == 1) { ?> <span class="private-text">{{LANG private}}</span><?php } ?>
                                 <?php if ($pt->get_video->privacy == 2) { ?> <span class="private-text">{{LANG unlisted}}</span><?php } ?>
                                 <?php if ($pt->get_video->sell_video > 0) { ?>
                                 <?php if ($pt->video_approved == true) { ?>
                                 <span><i class="fa fa-check-circle fa-fw verified" title="{{LANG video_verified}}"></i></span>
                                 <?php } ?>
                                 <?php } ?>
                              </h1>
                           </div>
                           <div>
                              <?php if (($pt->config->sell_videos_system == 'on') || $pt->get_video->sell_video == 0 ) { ?>
                              <div class="video-likes pull-right">
                                 <div class="like-btn {{LIKE_ACTIVE_CLASS}}" id="likes-bar" onclick="Wo_LikeSystem('{{ID}}', 'like', this, 'is_ajax')" data-likes="{{RAEL_LIKES}}" {{ISLIKED}}>
                                 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-thumbs-up">
                                    <path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path>
                                 </svg>
                                 <span class="likes" id="likes">{{LIKES}}</span>
                              </div>
                              <div class="video-info-element pull-right">
                                 <div class="views-bar" style="width: {{DISLIKES_P}}%"></div>
                                 <div class="views-bar blue" style="width: {{LIKES_P}}%"></div>
                                 <div class="clear"></div>
                              </div>
                              <div class="like-btn text-right {{DIS_ACTIVE_CLASS}}" id="dislikes-bar" onclick="Wo_LikeSystem('{{ID}}', 'dislike', this, 'is_ajax')" data-likes="{{RAEL_DISLIKES}}" {{ISDISLIKED}}>
                              <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-thumbs-down">
                                 <path d="M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"></path>
                              </svg>
                              <span class="likes" id="dislikes">{{DISLIKES}}</span>
                           </div>
                           <div class="clear"></div>
                        </div>
                        <?php } ?>
                     </div>
                     <div class="video-views">
                        <span id="video-views-count">{{VIEWS}}</span>&nbsp;{{LANG views}}
                        <?php if ($pt->get_video->sell_video > 0) { ?>
                        &nbsp;   &nbsp;<span><?php echo $pt->purchased; ?> {{LANG purchased}}</span>
                        <?php } ?>
                     </div>
                     <?php if ($pt->get_video->sell_video > 0 && PT_IsAdmin()) { ?>
                     <br>
                     <div class="alert alert-danger">
                        <span>{{LANG admin_can_see}}</span>
                        <br>
                        <?php if (!empty($pt->get_video->main_video_price)) { ?>
                        {{LANG video_price}} {{CURRENCY}}<?php echo $pt->get_video->main_video_price; ?>
                        <?php } ?>
                        <?php if (!empty($pt->get_video->rent_price)) { ?>
                        <br>
                        {{LANG video_rent_price}} {{CURRENCY}}<?php echo $pt->get_video->rent_price; ?>
                        <?php } ?>
                     </div>
                     <?php } ?>
                     <?php if (!empty($pt->video_end)) { ?>
                     <br>
                     <div class="alert alert-danger">
                        <span>{{LANG rent_time_will}} : <?php echo $pt->video_end; ?></span>
                     </div>
                     <?php } ?>
                     <div class="publisher-element pull-left">
                        <div class="publisher-avatar pull-left hide-in-mobile-720">
                           <a href="{{USER url}}"><img src="{{USER avatar}}" alt="{{USER name}}"></a>
                        </div>
                        <div class="publisher-name">
                           <a href="{{USER url}}" data-load="?link1=timeline&id={{USER username}}">{{USER name_v}}</a><br>
                           <?php if ($pt->get_video->owner->privacy->show_subscriptions_count == 'yes') { ?><span>{{SUBS}} {{LANG subscribers}}</span><?php } ?>
                        </div>
                        <div class="publisher-subscribe-button">
                           <?php if (!empty($pt->get_video->demo) && PT_GetMedia($pt->get_video->demo) == $pt->get_video->video_location) { ?>
                           <?php if (!IS_LOGGED) { ?>
                           <?php if (!empty($pt->get_video->main_video_price)) { ?>
                           <button class="btn btn-main btn_to_purchase_vid" onselectstart="return false" onclick="location.href = site_url+'/login';">{{LANG pay}} {{CURRENCY}}<?php echo $pt->get_video->main_video_price; ?> </button>
                           <?php } ?>
                           <?php if (!empty($pt->get_video->rent_price)) { ?>
                           <button class="btn btn-main btn_to_purchase_vid" onselectstart="return false" onclick="location.href = site_url+'/login';">{{LANG rent}} {{CURRENCY}}<?php echo $pt->get_video->rent_price; ?> </button>
                           <?php } ?>
                           <?php } else{ ?>
                           <?php if (!empty($pt->get_video->main_video_price)) { ?>
                           <button class="btn btn-main p_t_show_btn_ p_t_show_btn_buy btn_to_purchase_vid" onselectstart="return false" onclick="pay_to_see(<?php echo $pt->get_video->id; ?>,<?php echo $pt->get_video->main_video_price; ?>)">{{LANG pay}} {{CURRENCY}}<?php echo $pt->get_video->main_video_price; ?> </button>
                           <?php } ?>
                           <?php if (!empty($pt->get_video->rent_price)) { ?>
                           <button class="btn btn-main p_t_show_btn_ p_t_show_btn_rent btn_to_purchase_vid" onselectstart="return false" onclick="pay_to_see(<?php echo $pt->get_video->id; ?>,<?php echo $pt->get_video->rent_price; ?>,'rent')">{{LANG rent}} {{CURRENCY}}<?php echo $pt->get_video->rent_price; ?> </button>
                           <?php } ?>
                           <?php } ?>
                           <?php } ?>
                           {{SUBSCIBE_BUTTON}}
                        </div>
                        <div class="clear"></div>
                     </div>
                     <div class="clear"></div>
                     <div class="video-options">
                        <button class="btn-share" data-toggle="modal" data-target="#share_box">
                           <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
                              <path d="M0 0h24v24H0V0z" fill="none"/>
                              <path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92z" fill="currentColor"/>
                           </svg>
                           {{LANG share}}
                        </button>
                        <?php if ($pt->config->embed_system == 'on' && $pt->get_video->embedding == 0) {?>
                        <?php if ($pt->get_video->sell_video == 0) { ?>
                        <button class="btn-share" data-toggle="modal" data-target="#embed_box">
                           <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
                              <path d="M0 0h24v24H0V0z" fill="none"/>
                              <path d="M8.7 15.9L4.8 12l3.9-3.9c.39-.39.39-1.01 0-1.4-.39-.39-1.01-.39-1.4 0l-4.59 4.59c-.39.39-.39 1.02 0 1.41l4.59 4.6c.39.39 1.01.39 1.4 0 .39-.39.39-1.01 0-1.4zm6.6 0l3.9-3.9-3.9-3.9c-.39-.39-.39-1.01 0-1.4.39-.39 1.01-.39 1.4 0l4.59 4.59c.39.39.39 1.02 0 1.41l-4.59 4.6c-.39.39-1.01.39-1.4 0-.39-.39-.39-1.01 0-1.4z" fill="currentColor"/>
                           </svg>
                           {{LANG embed}}
                        </button>
                        <?php } ?>
                        <?php } ?>
                        <?php if ($pt->get_video->is_owner == true) { ?>
                        <a class="btn btn-share" href="{{LINK edit-video/{{ID}}}}" data-load="?link1=edit-video&id=category&id={{ID}}">
                           <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
                              <path d="M0 0h24v24H0V0z" fill="none"/>
                              <path d="M3 17.46v3.04c0 .28.22.5.5.5h3.04c.13 0 .26-.05.35-.15L17.81 9.94l-3.75-3.75L3.15 17.1c-.1.1-.15.22-.15.36zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z" fill="currentColor"/>
                           </svg>
                           {{LANG edit_video}}
                        </a>
                        <?php } ?>
                        <?php if ($pt->get_video->is_owner) { ?>
                        <a href="{{LINK view_analytics/{{VIDEO_ID_}}}}&type=today" class="btn-share btn-report" data-load="?link1=view_analytics&id={{VIDEO_ID_}}&type=today" data-rep="1">
                           <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24" viewBox="0 0 24 24" width="24">
                              <g>
                                 <rect fill="none" height="24" width="24"/>
                                 <rect fill="none" height="24" width="24"/>
                              </g>
                              <g>
                                 <g>
                                    <path d="M21,8c-1.45,0-2.26,1.44-1.93,2.51l-3.55,3.56c-0.3-0.09-0.74-0.09-1.04,0l-2.55-2.55C12.27,10.45,11.46,9,10,9 c-1.45,0-2.27,1.44-1.93,2.52l-4.56,4.55C2.44,15.74,1,16.55,1,18c0,1.1,0.9,2,2,2c1.45,0,2.26-1.44,1.93-2.51l4.55-4.56 c0.3,0.09,0.74,0.09,1.04,0l2.55,2.55C12.73,16.55,13.54,18,15,18c1.45,0,2.27-1.44,1.93-2.52l3.56-3.55 C21.56,12.26,23,11.45,23,10C23,8.9,22.1,8,21,8z" fill="currentColor"/>
                                    <polygon points="15,9 15.94,6.93 18,6 15.94,5.07 15,3 14.08,5.07 12,6 14.08,6.93" fill="currentColor"/>
                                    <polygon points="3.5,11 4,9 6,8.5 4,8 3.5,6 3,8 1,8.5 3,9" fill="currentColor"/>
                                 </g>
                              </g>
                           </svg>
                           <span>{{LANG analytics}}</span>
                        </a>
                        <?php } ?>
                        <?php if ($pt->config->donate_system == 'on' && !empty($pt->user_data->donation_paypal_email) && $pt->get_video->sell_video == 0) { ?>
                        <button class="btn-share" onclick="location.href = 'https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business={{USER donation_paypal_email}}&lc=US&item_name=Donation+to+{{USER name}}&no_note=0&cn=&currency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted'">
                           <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
                              <path d="M0 0h24v24H0V0z" fill="none"/>
                              <path d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm-1 14H5c-.55 0-1-.45-1-1v-5h16v5c0 .55-.45 1-1 1zm1-10H4V7c0-.55.45-1 1-1h14c.55 0 1 .45 1 1v1z" fill="currentColor"/>
                           </svg>
                           {{LANG donate}}
                        </button>
                        <?php } ?>
                        <?php if (IS_LOGGED && $pt->get_video->is_owner == false): ?>
                        <?php if ($pt->reported === true): ?>
                        <button class="btn-share btn-report active pull-right" onclick="PT_ReportVideo('{{ID}}',this);" data-rep="0">
                           <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
                              <path d="M0 0h24v24H0V0z" fill="none"/>
                              <path d="M15.32 3H8.68c-.26 0-.52.11-.7.29L3.29 7.98c-.18.18-.29.44-.29.7v6.63c0 .27.11.52.29.71l4.68 4.68c.19.19.45.3.71.3h6.63c.27 0 .52-.11.71-.29l4.68-4.68c.19-.19.29-.44.29-.71V8.68c0-.27-.11-.52-.29-.71l-4.68-4.68c-.18-.18-.44-.29-.7-.29zM12 17.3c-.72 0-1.3-.58-1.3-1.3s.58-1.3 1.3-1.3 1.3.58 1.3 1.3-.58 1.3-1.3 1.3zm0-4.3c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1z" fill="currentColor"/>
                           </svg>
                           <span>{{LANG cancel_report}}</span>
                        </button>
                        <?php else: ?>
                        <button class="btn-share btn-report pull-right" onclick="PT_ReportVideo('{{ID}}',this);" data-rep="1">
                           <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
                              <path d="M0 0h24v24H0V0z" fill="none"/>
                              <path d="M15.32 3H8.68c-.26 0-.52.11-.7.29L3.29 7.98c-.18.18-.29.44-.29.7v6.63c0 .27.11.52.29.71l4.68 4.68c.19.19.45.3.71.3h6.63c.27 0 .52-.11.71-.29l4.68-4.68c.19-.19.29-.44.29-.71V8.68c0-.27-.11-.52-.29-.71l-4.68-4.68c-.18-.18-.44-.29-.7-.29zM12 17.3c-.72 0-1.3-.58-1.3-1.3s.58-1.3 1.3-1.3 1.3.58 1.3 1.3-.58 1.3-1.3 1.3zm0-4.3c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1z" fill="currentColor"/>
                           </svg>
                           <span>{{LANG report}}</span>
                        </button>
                        <?php endif; ?>
                        <?php if (IS_LOGGED && $pt->config->report_copyright == 'on') { ?>
                        <button class="btn-share btn-report pull-right" onclick="PT_ReportCopyVideo('{{ID}}',this);" data-rep="1">
                           <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
                              <path d="M0 0h24v24H0V0z" fill="none"/>
                              <path d="M15.32 3H8.68c-.26 0-.52.11-.7.29L3.29 7.98c-.18.18-.29.44-.29.7v6.63c0 .27.11.52.29.71l4.68 4.68c.19.19.45.3.71.3h6.63c.27 0 .52-.11.71-.29l4.68-4.68c.19-.19.29-.44.29-.71V8.68c0-.27-.11-.52-.29-.71l-4.68-4.68c-.18-.18-.44-.29-.7-.29zM12 17.3c-.72 0-1.3-.58-1.3-1.3s.58-1.3 1.3-1.3 1.3.58 1.3 1.3-.58 1.3-1.3 1.3zm0-4.3c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1z" fill="currentColor"/>
                           </svg>
                           <span>{{LANG report_copyright}}</span>
                        </button>
                        <?php } ?>
                        <?php endif; ?>
                     </div>
                     <div class="video-published">
                        {{LANG published_on}} {{TIME}} / {{LANG in}}
                        <a href="{{LINK movies?category_={{CATEGORY_ID}}}}" data-load="?link1=movies&category_={{CATEGORY_ID}}"><?php echo $pt->movies_categories[$pt->get_video->category_id]; ?></a>
                     </div>
                     <div class="watch-video-description">
                        <p dir="auto" itemprop="description">{{DESC}}</p>
                        <ul class="list-unstyled vid_mov_e_info">
                           <li>
                              <h4 class="title">{{LANG stars}}</h4>
                              <p><?php echo (!empty($pt->get_video->stars) ? $pt->get_video->stars : ''); ?></p>
                           </li>
                           <li>
                              <h4 class="title">{{LANG producer}}</h4>
                              <p><?php echo (!empty($pt->get_video->producer) ? $pt->get_video->producer : ''); ?></p>
                           </li>
                           <li>
                              <h4 class="title">{{LANG release}}</h4>
                              <p><?php echo (!empty($pt->get_video->movie_release) ? $pt->get_video->movie_release : ''); ?></p>
                           </li>
                           <li>
                              <h4 class="title">{{LANG country}}</h4>
                              <p><?php echo (!empty($countries_name[$pt->get_video->country]) ? $countries_name[$pt->get_video->country] : ''); ?></p>
                           </li>
                           <li>
                              <h4 class="title">{{LANG quality}}</h4>
                              <p><?php echo (!empty($pt->get_video->quality) ? $pt->get_video->quality : ''); ?></p>
                           </li>
                           <li>
                              <h4 class="title">{{LANG category}}</h4>
                              <p><?php echo (!empty($pt->movies_categories[$pt->get_video->category_id]) ? $pt->movies_categories[$pt->get_video->category_id] : ''); ?></p>
                           </li>
                        </ul>
                     </div>
                     <div class="watch-video-show-more desc">
                        {{LANG show_more}}
                     </div>
                  </div>
               </div>
            </div>
         </div>
      <?php } ?>
      <div class="ads-placment">{{COMMENT_AD}}</div>
      <?php if (($pt->config->sell_videos_system == 'on') || $pt->get_video->sell_video == 0 ) { ?>
      {{VIDEO_COMMENTS}}
      <?php }  ?>
   </div>
</div>
<?php if (!empty($pt->get_video->trailer)) { ?>
<div class="modal fade" id="movie_trailer" tabindex="-1" role="dialog" aria-labelledby="movie_trailerLabel">
   <div class="modal-dialog modal-lg" role="document">
      <div class="modal-content">
         <div class="modal-body watch-movie-trailer-modal">
            <div class="embed-responsive-movie">
               <div>
                  <video id="my-trailer" controls style="width: 100%;height: 100%;" poster="{{THUMBNAIL}}" playsinline>
                     <source src="<?php echo(PT_GetMedia($pt->get_video->trailer)) ?>">
                  </video>
               </div>
            </div>
         </div>
      </div>
   </div>
</div>
<script>
   $('#movie_trailer').on('hide.bs.modal', function (e) {
      $('#my-trailer')[0].pause();
   })
</script>
<?php } ?>
<div class="col-md-4 no-padding-left pull-right <?php echo(($pt->is_wl || $pt->is_list) ? '' : 'mobile') ?>">
   <?php if (!$pt->is_wl && !$pt->is_list) { ?>
   <div class="content">
      <div class="next-video">
         <div class="next-text pull-left">
            <h4>{{LANG up_next}}</h4>
         </div>
         <div class="pt_mn_wtch_switch pull-right">
            <input id="autoplay-2" type="checkbox" {{COOKIE}} class="tgl autoplay-video">
            <label class="tgl-btn" for="autoplay-2">{{LANG autoplay}}</label>
         </div>
         <div class="clear"></div>
      </div>
      <div class="videos-list" id="next-video">
         {{VIDEO_NEXT_SIDEBAR}}
      </div>
      <br>
      <div class="related-header">
      </div>
      <div class="videos-list related-videos">
         {{VIDEO_SIDEBAR}}
      </div>
   </div>
   <?php }
         if($pt->is_wl || $pt->is_list){ ?>
         <div class="content">
            <div class="ads-placment">{{WATCH_SIDEBAR_AD}}</div>
            <div class="videos-list related-videos">{{VIDEO_SIDEBAR}}</div>
            <div class="load-related-videos">
               <button class="btn btn-default" id="load-related-videos">
               <span>{{LANG load_more}}</span><i class="fa fa-circle-o-notch spin hidden"></i>
               </button>
            </div>
         </div>
   <?php } ?>
</div>
<div class="clear"></div>
</div>
</div>
<div class="modal fade matdialog" id="share_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
   <div class="modal-dialog modal-sm" role="document">
      <div class="modal-content">
         <div class="modal-header">
            <h4 class="modal-title" id="myModalLabel">{{LANG share}}</h4>
         </div>
         <div class="modal-body">
            <div class="yp_copy_link">
               <input id="copyLink" readonly="" tabindex="1" type="text" value="{{CONFIG site_url}}/v/<?php echo $pt->get_video->short_id; ?>">
               <button class="btn" onclick="copyLinkfn();">
                  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
                     <path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" />
                  </svg>
               </button>
            </div>
            <div class="share-video">
               <div><a href="#" class="fa fa-facebook" onclick="OpenShareWindow('https://www.facebook.com/sharer/sharer.php?u={{ENCODED_URL}}')"></a></div>
               <div><a href="#" class="fa fa-twitter" onclick="OpenShareWindow('https://twitter.com/intent/tweet?url={{ENCODED_URL}}')"></a></div>
               <div><a href="#" class="fa fa-google" onclick="OpenShareWindow('https://plus.google.com/share?url={{ENCODED_URL}}')"></a></div>
               <div><a href="#" class="fa fa-linkedin" onclick="OpenShareWindow('https://www.linkedin.com/shareArticle?mini=true&url={{ENCODED_URL}}&title={{TITLE}}')"></a></div>
               <div><a href="#" class="fa fa-pinterest" onclick="OpenShareWindow('https://pinterest.com/pin/create/button/?url={{ENCODED_URL}}&media={{THUMBNAIL}}')"></a></div>
               <!--<div><a href="#" class="fa fa-tumblr" onclick="OpenShareWindow('http://www.tumblr.com/share/link?url={{ENCODED_URL}}')"></a></div>-->
               <div><a href="#" class="fa fa-reddit" onclick="OpenShareWindow('http://www.reddit.com/submit?url={{ENCODED_URL}}')"></a></div>
               <?php if (!empty($pt->config->wowonder_domain_uri) && $pt->config->wowonder_img) {?>
               <div><a href="#" class="share-third" onclick="OpenShareWindow('{{CONFIG wowonder_domain_uri}}/sharer?url={{ENCODED_URL}}')"><img src="{{CONFIG wowonder_img}}" alt="share to "></a></div>
               <?php } ?>
            </div>
         </div>
         <div class="modal-footer">
            <button type="button" class="matbtn btn btn-default" data-dismiss="modal">{{LANG close}}</button>
         </div>
      </div>
   </div>
</div>
<?php if ($pt->config->embed_system == 'on' && $pt->get_video->embedding == 0) {?>
<?php if ($pt->get_video->sell_video == 0) { ?>
<div class="modal fade matdialog" id="embed_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
   <div class="modal-dialog modal-md" role="document">
      <div class="modal-content">
         <div class="modal-header">
            <h4 class="modal-title" id="myModalLabel">{{LANG embed}}</h4>
         </div>
         <div class="modal-body">
            <div class="embed-placement">
               <input type="text" name="embed" id="embed" class="form-control" onclick="this.select()" value='<iframe src="{{LINK embed/{{VIDEO_MAIN_ID}}}}" frameborder="0" width="700" height="400" allowfullscreen></iframe>' autocomplete="off">
               &nbsp;&nbsp;&nbsp;
               <div class="colorpickerf input-group colorpicker-component">
                  <input id="demo" type="text" class="form-control" value="#04abf2" onchange="ChangeIframeColor(this)" />
                  <span class="input-group-addon"><i></i></span>
               </div>
            </div>
            <div class="pt_embed_playr">
               <iframe src="{{LINK embed/{{VIDEO_MAIN_ID}}}}" frameborder="0" width="542" height="400" allowfullscreen></iframe>
            </div>
         </div>
         <div class="modal-footer">
            <button type="button" class="matbtn btn btn-default" data-dismiss="modal">{{LANG close}}</button>
         </div>
      </div>
   </div>
</div>
<script>
   $('.colorpickerf').colorpicker({
      horizontal: true,
      fallbackColor: '#04abf2'
   });
   function ChangeIframeColor(self) {
      let src = "{{LINK embed/{{VIDEO_MAIN_ID}}}}";
      let final_src = src + "?color=" + $(self).val().replace('#','');
      $('#embed_box').find('#embed').val('<iframe src="'+final_src+'" frameborder="0" width="700" height="400" allowfullscreen></iframe>')
      $('#embed_box').find('iframe').attr('src',final_src);
   }
</script>
<?php } ?>
<?php } ?>
<?php if ($pt->is_wl || $pt->is_list) { ?>
<style>
   .mejs__fullscreen .play-list-player .mejs__container {
   max-height: 100% !important;
   }
   /*.play-list-player .mejs__container {
   max-height: 555px !important;
   }*/
   .mejs__fullscreen .play-list-player video {
   max-height: 100% !important;
   }
   .play-list-player .vjs-fullscreen video {
   max-height: 100% !important;
   }
   /*.play-list-player video {
   max-height: 555px !important;
   }*/
   .fluid_video_wrapper.fluid_player_layout_default:-webkit-full-screen video{max-height: 100% !important;}
   /*.play-list-player{
   max-height: 640px !important;
   }*/
   .mejs__offscreen {
   clip: initial !important;
   clip-path: inherit !important;
   -webkit-clip-path: inherit !important;
   opacity: 0;
   }
</style>
<script type="text/javascript">
   $.getScript('{{CONFIG theme_url}}/js/Sortable.min.js', function(data, textStatus) {
      var el = document.getElementById('next-video');
      var sortable = Sortable.create(el,{
         delay: 100,
         onEnd: function (/**Event*/evt) {
            var video_array = [];
            $('[data-litsitem-id]').each(function(i, obj) {
               video_array[i] = $(obj).attr('data-video-id');
               if (i == $('[data-litsitem-id]').length-1) {
                  $.post('{{LINK aj/lists?type=list&a=sort}}', {video_array: video_array,type: "<?php echo($pt->is_list ? 'list' : 'wl') ?>"}, function(data, textStatus, xhr) {});
               }
            });
         }
      });
   });
</script>
<?php } ?>
<?php if ($pt->config->download_videos == 'on' && empty($pt->get_video->daily) && empty($pt->get_video->vimeo) && empty($pt->get_video->youtube) && $pt->get_video->converted == 1 && $pt->get_video->age == false && $pt->video_approved == true) { ?>
<?php if ($pt->get_video->sell_video == 0 || (($pt->is_paid > 0 || $pt->get_video->sell_video == 0) && $pt->config->stock_videos == 'on' && $pt->get_video->is_stock == 1)) { ?>
<div class="modal fade matdialog" id="download_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
   <div class="modal-dialog modal-sm" role="document">
      <div class="modal-content">
         <div class="modal-header">
            <h4 class="modal-title" id="myModalLabel">{{LANG download}}</h4>
         </div>
         <div class="modal-body">
            <div class="download-placement">
               <?php if (!empty($pt->video_4096)) { ?>
               <a href="{{VIDEO_LOCATION_4096}}" download>4K</a>
               <?php } ?>
               <?php if (!empty($pt->video_2048)) { ?>
               <a href="{{VIDEO_LOCATION_2048}}" download>2K</a>
               <?php } ?>
               <?php if (!empty($pt->video_1080)) { ?>
               <a href="{{VIDEO_LOCATION_1080}}" download>1080p</a>
               <?php } ?>
               <?php if (!empty($pt->video_720)) { ?>
               <a href="{{VIDEO_LOCATION_720}}" download>720p</a>
               <?php } ?>
               <?php if (!empty($pt->video_480)) { ?>
               <a href="{{VIDEO_LOCATION_480}}" download>480p</a>
               <?php } ?>
               <?php if (!empty($pt->video_360)) { ?>
               <a href="{{VIDEO_LOCATION_360}}" download>360p</a>
               <?php } else if (!empty($pt->get_video->video_location)) { ?>
               <a href="{{VIDEO_LOCATION}}" download>{{LANG original}}</a>
               <?php } ?>
               <?php if (!empty($pt->video_240)) { ?>
               <a href="{{VIDEO_LOCATION_240}}" download>240p</a>
               <?php } ?>
            </div>
         </div>
         <div class="modal-footer">
            <button type="button" class="matbtn btn btn-default" data-dismiss="modal">{{LANG close}}</button>
         </div>
      </div>
   </div>
</div>
<?php } ?>
<?php } ?>
<script type="text/javascript">
   jQuery(document).ready(function($) {
      <?php if ($pt->shouldSubscribers) { ?>
      $(".subscribe-id-<?php echo($pt->get_video->owner->id) ?>").on('click',() => {
         window.location.reload();
      });
      <?php } ?>
        const video = document.querySelector('video');
        video.addEventListener('timeupdate', (event) => {
           end_time = parseInt((video.duration * 99) / 100);
           currentTime = parseInt(video.currentTime);
           if($('.card_end').length > 0 && currentTime === end_time){
              $('.card_end').slideDown();
              HideCard('card_end');
           }
           ad_date = '';
           minutes = parseInt(video.currentTime / 60, 10);
           seconds = parseInt(video.currentTime % 60);
           if (minutes < 10 && minutes > 0) {
              ad_date = '0'+minutes+'_';
           }
           else if (minutes > 9) {
              ad_date = minutes+'_';
           }
           else if (minutes == 0) {
              ad_date = '00_';
           }
           if (seconds < 10 && seconds > 0) {
              ad_date = ad_date + '0'+seconds;
           }
           else if (seconds > 9) {
              ad_date = ad_date + seconds;
           }
           else if (seconds == 0) {
              ad_date = ad_date + '00';
           }
           if($('.card_'+ad_date).length > 0){
              $('.card_'+ad_date).slideDown();
              HideCard('card_'+ad_date);
           }
        });
     });
   
   
   
   
   <?php if (!empty($pt->get_video->demo) && PT_GetMedia($pt->get_video->demo) == $pt->get_video->video_location) { ?>
        $("video").bind("ended", function() {
           var link_ = "'"+site_url+"/login'";
           var rent = "'rent'";
           <?php if ($pt->get_video->owner->subscriber_price) { ?>
              var type = "'subscribe'";
              var text = "<?php $text = str_replace('{{PRICE}}', $pt->currency.$pt->get_video->owner->subscriber_price, $lang_array['buy_or_subscribe']);
      $text = str_replace('{{USERNAME}}',$pt->get_video->owner->name, $text);
         echo($text); ?>";
              $('.video-player').prepend('<div class="video-processing pay_to_content"><div class="pay_to_content_background"></div><div style="background: rgba(0,0,0,0.8) !important;"><h5><p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-dollar-sign"><line x1="12" y1="1" x2="12" y2="23"></line><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path></svg></p>'+text+'<br><br><?php if (!IS_LOGGED) { ?><?php if (!empty($pt->get_video->main_video_price)) { ?><button class="btn btn-main" onselectstart="return false" onclick="location.href = '+link_+';">{{LANG pay}} {{CURRENCY}}<?php echo $pt->get_video->main_video_price; ?> </button><?php } ?><?php if(!empty($pt->get_video->rent_price)){ ?><button class="btn btn-main p_t_show_btn_ p_t_show_btn_rent" onselectstart="return false" onclick="location.href = '+link_+';">{{LANG rent}} {{CURRENCY}}<?php echo $pt->get_video->rent_price; ?> </button><?php } ?><?php if ($pt->get_video->owner->subscriber_price) { ?><br><br><button class="btn btn-main" onselectstart="return false"onclick="location.href = '+link_+';">{{LANG subscribe}} {{CURRENCY}}<?php echo $pt->get_video->owner->subscriber_price; ?></button><?php } ?><?php } else{ ?><?php if(!empty($pt->get_video->main_video_price)){ ?><button class="btn btn-main p_t_show_btn_ p_t_show_btn_buy" onselectstart="return false" onclick="pay_to_see(<?php echo $pt->get_video->id; ?>,<?php echo $pt->get_video->main_video_price; ?>)">{{LANG pay}} {{CURRENCY}}<?php echo $pt->get_video->main_video_price; ?> </button><?php } ?><br><br><?php if(!empty($pt->get_video->rent_price)){ ?><button class="btn btn-main p_t_show_btn_ p_t_show_btn_rent" onselectstart="return false" onclick="pay_to_see(<?php echo $pt->get_video->id; ?>,<?php echo $pt->get_video->rent_price; ?>,'+rent+')">{{LANG rent}} {{CURRENCY}}<?php echo $pt->get_video->rent_price; ?> </button><?php } ?><br><br><button class="btn btn-main" onselectstart="return false" onclick="PT_PaySubscribe(<?php echo $pt->get_video->user_id; ?>,this,'+type+')">{{LANG subscribe}} {{CURRENCY}}<?php echo $pt->get_video->owner->subscriber_price; ?> </button><?php } ?></h5></div></div>');
   
           <?php }else{ ?>
              $('.video-player').prepend('<div class="video-processing pay_to_content"><div class="pay_to_content_background"></div><div style="background: rgba(0,0,0,0.8) !important;"><h5><p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-dollar-sign"><line x1="12" y1="1" x2="12" y2="23"></line><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path></svg></p>{{LANG pay_to_see_video}}<br><br><?php if (!IS_LOGGED) { ?><?php if (!empty($pt->get_video->main_video_price)) { ?><button class="btn btn-main" onselectstart="return false" onclick="location.href = '+link_+';">{{LANG pay}} {{CURRENCY}}<?php echo $pt->get_video->main_video_price; ?> </button><?php } ?><?php if(!empty($pt->get_video->rent_price)){ ?><button class="btn btn-main p_t_show_btn_ p_t_show_btn_rent" onselectstart="return false" onclick="location.href = '+link_+';">{{LANG rent}} {{CURRENCY}}<?php echo $pt->get_video->rent_price; ?> </button><?php } ?><?php } else{ ?><?php if (!empty($pt->get_video->main_video_price)) { ?><button class="btn btn-main p_t_show_btn_ p_t_show_btn_buy" onselectstart="return false" onclick="pay_to_see(<?php echo $pt->get_video->id; ?>,<?php echo $pt->get_video->main_video_price; ?>)">{{LANG pay}} {{CURRENCY}}<?php echo $pt->get_video->main_video_price; ?> </button><?php } ?><?php if(!empty($pt->get_video->rent_price)){ ?><button class="btn btn-main p_t_show_btn_ p_t_show_btn_rent" onselectstart="return false" onclick="pay_to_see(<?php echo $pt->get_video->id; ?>,<?php echo $pt->get_video->rent_price; ?>,'+rent+')">{{LANG rent}} {{CURRENCY}}<?php echo $pt->get_video->rent_price; ?> </button><?php } ?><?php } ?></h5></div></div>');
   
           <?php } ?>
        });
     <?php } ?>
     var sources = [];
     for (var i = 0 ; i < $('video').find('source').length; i++) {
        sources[i] = parseFloat($($('video').find('source')[i]).attr('res'));
     }
   
     // var imageAddr = "http://www.kenrockwell.com/contax/images/g2/examples/31120037-5mb.jpg";
     // var downloadSize = 4995374;
     var imageAddr = site_url+"/upload/photos/speed.jpg";
     var downloadSize = 1082828;
     function getQuality() {
      MeasureConnectionSpeed();
   
   
        function MeasureConnectionSpeed() {
         if (getCookie('internet_speed') > 0) {
            showResults(getCookie('internet_speed'));
         }
         else{
            var startTime, endTime;
            var download = new Image();
            download.onload = function () {
                endTime = (new Date()).getTime();
                showResults();
            }
   
            download.onerror = function (err, msg) {
                ShowProgressMessage(0);
            }
   
            startTime = (new Date()).getTime();
            var cacheBuster = "?nnn=" + startTime;
            download.src = imageAddr + cacheBuster;
         }
         //console.log($.cookie("internet_speed"));
   
   
            function showResults(speed = 0) {
               if (speed == 0) {
                  var duration = (endTime - startTime) / 1000;
                 var bitsLoaded = downloadSize * 8;
                 var speedBps = (bitsLoaded / duration).toFixed(2);
                 var speedKbps = (speedBps / 1024).toFixed(2);
                 var speedMbps = (speedKbps / 1024).toFixed(2);
                 setCookie("internet_speed", speedKbps,1);
   
               }
               else{
                  speedKbps = speed;
                  if (speed < 240) {
                     speedKbps = 250;
                  }
               }
                for (var i = 0 ; i < sources.length; i++) {
                 if (sources[i] < parseFloat(speedKbps)) {
                    is_clicked = true;
                    video_source = sources[i];
                    <?php if ($pt->config->player_type == 'fluidPlayer' && empty($pt->get_video->youtube)) { ?>
                       $('#source_my-video_{{ID}}_'+video_source+'p').click();
                       $('.source_button_icon').removeClass('source_selected');
                       $('#source_my-video_{{ID}}_auto').find('span').addClass('source_selected');
                    <?php } elseif ($pt->config->player_type == 'videojs' && empty($pt->get_video->youtube)) { ?>
                       $( ".vjs-menu-item-text:contains('"+video_source+"p')" ).click();
                       $('.vjs-resolution-button-label').text('auto');
                    <?php }else{ ?>
                       $('#'+$('.mejs__container').attr('id')+'-qualities-'+video_source+'p').click();
                       $('.mejs__qualities-button').find('button').text('auto');
                       $('.mejs__qualities-selector-label').removeClass('mejs__qualities-selected');
                       $('#quality__auto').addClass('mejs__qualities-selected');
                    <?php } ?>
                    break;
                 }
                }
            }
        }
     }
     function setAuto(self) {
        <?php if ($pt->config->player_type == 'fluidPlayer' && empty($pt->get_video->youtube)) { ?>
           $('.source_button_icon').removeClass('source_selected');
           $('#source_my-video_{{ID}}_auto').find('span').addClass('source_selected');
        <?php } elseif ($pt->config->player_type == 'videojs' && empty($pt->get_video->youtube)) { ?>
           $('.vjs-resolution-button-label').text('auto');
        <?php }else{ ?>
           $('.mejs__qualities-button').find('button').text('auto');
           $('.mejs__qualities-selector-label').removeClass('mejs__qualities-selected');
           $('#quality__auto').addClass('mejs__qualities-selected');
        <?php } ?>
        getQuality();
        setTimeout(function (argument) {
           setCookie('auto', 'auto', 1);
        },1000);
     }
     $(document).ready(function(){
        document.querySelector('video').addEventListener("loadeddata", function(){
          setCookie('auto', '', 1);
        });
     });
     <?php if (!empty($_COOKIE['auto'])) { ?>
        setTimeout(function (argument) {
           setAuto('');
        },2000);
     <?php } ?>
</script>
<?php if ($pt->config->player_type == 'videojs' && empty($pt->get_video->youtube)) { ?>
<script src="{{CONFIG theme_url}}/player/js/video_js/video.js"></script>
<script src="{{CONFIG theme_url}}/player/js/video_js/videojs-contrib-ads.min.js"></script>
<script src="{{CONFIG theme_url}}/player/js/video_js/videojs-resolution-switcher.js"></script>
<script src="{{CONFIG theme_url}}/player/js/video_js/videojs.ima.js"></script>
<?php } ?>
<?php if (empty($pt->get_video->facebook) && empty($pt->get_video->vimeo) && empty($pt->get_video->daily)) { ?>
<script type="text/javascript">
   function go_to_duration(duration) {
   window.scrollTo(0, 0);
   var vid = document.querySelector("video");
   vid.currentTime = duration;
   vid.play();
   }
</script>
<?php } ?>
<?php if (empty($pt->get_video->facebook) && empty($pt->get_video->vimeo) && empty($pt->get_video->daily) && ($pt->get_video->sell_video == 0 || $pt->get_video->is_owner || $pt->video_approved == false  || !empty($pt->get_video->demo) || ($pt->get_video->sell_video > 0 && $pt->is_paid > 0))) { ?>
<script type="text/javascript">
   <?php if ($pt->config->player_type == 'fluidPlayer' && empty($pt->get_video->youtube)) { ?>
   
      if ('{{VAST_URL}}' != '') {
         myFluidPlayer = fluidPlayer(
            'my-video_<?php echo $pt->get_video->id; ?>',
             {
                 vastOptions: {
                     adList: [ {roll : "preRoll",
                  vastTag : "{{VAST_URL}}",
                  vastTimeout: {{AD_SKIP_NUM}} * 1000 }],
                  vastAdvanced: {
                      vastLoadedCallback:       (function() {  }),
                      noVastVideoCallback:      (function() {  }),
                      vastVideoSkippedCallback: (function() {
                        setTimeout(function () {
                           if ($('#autoplay').is(":checked")) {
                              var media = document.querySelector("video");
                              media.addEventListener('ended', function (e) {
                                 if ($('#autoplay').is(":checked")) {
                                 var url = $('#next-video').find('a').attr('href');
                                 if (url) {
                                    window.location.href = url;
                                 }
                              }
                              else{
                                /* pass */
                              }
                               }, false);
   
                           }
                        },2000);
                       }),
                      vastVideoEndedCallback:   (function() {
                        setTimeout(function () {
                           if ($('#autoplay').is(":checked")) {
                              var media = document.querySelector("video");
                              media.addEventListener('ended', function (e) {
                                 if ($('#autoplay').is(":checked")) {
                                 var url = $('#next-video').find('a').attr('href');
                                 if (url) {
                                    window.location.href = url;
                                 }
                              }
                              else{
                                /* pass */
                              }
                               }, false);
   
                           }
                        },2000);
   
                       })
                  }
                 },
                 layoutControls: {
                  playbackRateEnabled:    true,
                  fillToContainer:true,
                  autoPlay: true
                 }
             }
         );
            myFluidPlayer.on('play', function(){
               // if (pt_elexists('.ads-overlay-info')) {
               //   $('.ads-overlay-info').remove();
               // }
   
               $('.ads-test').remove();
   
               if ($('body').attr('resized') == 'true') {
                   PT_Resize(true);
               }
               $('.mejs__container').css('height', ($('.mejs__container').width() / 1.77176216) + 'px');
               $('video, iframe').css('height', '100%');
             });
      }else{
         <?php if (!empty($pt->ad_image)) { ?>
         myFluidPlayer = fluidPlayer('my-video_<?php echo $pt->get_video->id; ?>',{
                 layoutControls: {
                  playbackRateEnabled:    true,
                  fillToContainer:true,
                  autoPlay: false,
                  playButtonShowing: true,
                  playPauseAnimation: false
   
                 }
         });
         if ($('#autoplay').is(":checked")) {
            var media = document.querySelector("video");
            media.addEventListener('ended', function (e) {
               if ($('#autoplay').is(":checked")) {
                  var url = $('#next-video').find('a').attr('href');
                  if (url) {
                     window.location.href = url;
                  }
               }
               else{
                 /* pass */
               }
             }, false);
   
         }
         <?php }else{ ?>
            myFluidPlayer = fluidPlayer('my-video_<?php echo $pt->get_video->id; ?>',{
                 layoutControls: {
                  playbackRateEnabled:    true,
                  fillToContainer:true,
                  autoPlay: true,
                  playButtonShowing: true,
                  playPauseAnimation: false
   
                 }
            });
            if ($('#autoplay').is(":checked")) {
               var media = document.querySelector("video");
               media.addEventListener('ended', function (e) {
                  if ($('#autoplay').is(":checked")) {
                     var url = $('#next-video').find('a').attr('href');
                     if (url) {
                        window.location.href = url;
                     }
                  }
                  else{
                    /* pass */
                  }
                }, false);
   
            }
         <?php } ?>
   
      }
   
      if (sources.length > 1) {
         setTimeout(function () {
            $('#my-video_{{ID}}_fluid_control_video_source_list').append('<div id="source_my-video_{{ID}}_auto" class="fluid_video_source_list_item" onclick="setAuto(this)"><span class="source_button_icon"></span>auto</div>');
         },1000);
      }
   
   
   <?php }elseif ($pt->config->player_type == 'videojs' && empty($pt->get_video->youtube)) { ?>
   
      if ({{AD_MEDIA}} != '') {
         var ad_started = false;
            //var player = videojs("my-video", { "controls": true, "autoplay": 'play', "preload": "auto" });
            var player = videojs('my-video', {
                controls: true,
                plugins: {
                  videoJsResolutionSwitcher: {
                    default: 'low', // Default resolution [{Number}, 'low', 'high'],
                    dynamicLabel: true
                  }
                }
              }, function(){
                var player = this;
                window.player = player
                player.updateSrc([
                   <?php if (!empty($pt->video_4096)) { ?>
                  {
                    src: '{{VIDEO_LOCATION_4096}}',
                    type: '{{VIDEO_TYPE}}',
                    label: '4K',
                    res: 4096
                  },
                  <?php } ?>
                  <?php if (!empty($pt->video_2048)) { ?>
                  {
                    src: '{{VIDEO_LOCATION_2048}}',
                    type: '{{VIDEO_TYPE}}',
                    label: '2K',
                    res: 2048
                  },
                  <?php } ?>
                  <?php if (!empty($pt->video_1080)) { ?>
                  {
                    src: '{{VIDEO_LOCATION_1080}}',
                    type: '{{VIDEO_TYPE}}',
                    label: '1080p',
                    res: 1080
                  },
                  <?php } ?>
                  <?php if (!empty($pt->video_720)) { ?>
                  {
                    src: '{{VIDEO_LOCATION_720}}',
                    type: '{{VIDEO_TYPE}}',
                    label: '720p',
                    res: 720
                  },
                  <?php } ?>
                  <?php if (!empty($pt->video_480)) { ?>
                  {
                    src: '{{VIDEO_LOCATION_480}}',
                    type: '{{VIDEO_TYPE}}',
                    label: '480p',
                    res: 480
                  },
                  <?php } ?>
                  <?php if (!empty($pt->video_360)) { ?>
                  {
                    src: '{{VIDEO_LOCATION_360}}',
                    type: '{{VIDEO_TYPE}}',
                    label: '360p',
                    res: 360
                  },
                  <?php } ?>
                  <?php if (!empty($pt->video_240)) { ?>
                  {
                    src: '{{VIDEO_LOCATION_240}}',
                    type: '{{VIDEO_TYPE}}',
                    label: '240p',
                    res: 240
                  },
                  <?php } ?>
                  <?php if (!empty($pt->get_video->youtube) || (!empty($pt->get_video->video_location) && empty($pt->video_360))) { ?>
                  {
                    src: '{{VIDEO_LOCATION}}',
                    type: '{{VIDEO_TYPE}}',
                    label: <?php echo(!empty($pt->video_quality) ? '"'.$pt->video_quality.'"' : '"360p"') ?>,
                    res: <?php echo(!empty($pt->video_res) ? $pt->video_res : 360) ?>
                  },
                  <?php } ?>
                ])
   
              });
   
            player.ads(); // initialize videojs-contrib-ads
   
            // request ads whenever there's new video content
            player.on('contentchanged', function() {
              // in a real plugin, you might fetch your ad inventory here
              player.trigger('adsready');
            });
            player.on('readyforpreroll', function() {
               if (ad_started == false) {
                  player.ads.startLinearAdMode();
                  // play your linear ad content
                 // in this example, we use a static mp4
                 player.src({{AD_MEDIA}});
                  ad_started = true;
                  $('.vjs-resolution-button').hide();
               }
              // send event when ad is playing to remove loading spinner
              player.one('adplaying', function() {
   
   
               if (pt_elexists('.ads-overlay-info')) {
                 $('.ads-overlay-info').remove();
               }
   
               $('.ads-test').remove();
   
               if ($('body').attr('resized') == 'true') {
                   PT_Resize(true);
               }
               $('.mejs__container').css('height', ($('.mejs__container').width() / 1.77176216) + 'px');
               $('video, iframe').css('height', '100%');
   
   
                player.trigger('ads-ad-started');
   
                 num = {{AD_SKIP_NUM}};
                 $('.video-player').append('<span class="video_js_skip_ad">Skip in '+num+'</span>');
                  setInterval(function () {
                     num = num -1;
   
                     if (num == 0 || num < 0) {
                        $('.video_js_skip_ad').html('<a href="javascript:void(0)" onclick="end_video_js_ad()">{{LANG skip_ad}}</a>');
   
                        //$('.video-player').attr('onclick', '');
                     }
                     if (num > 0) {
                        $('.video-player').attr('onclick', 'window.open("'+{{AD_LINK}}+'");');
                        $('.video_js_skip_ad').text('Skip in '+(num));
                     }
                  },1000);
              });
   
              // resume content when all your linear ads have finished
              player.one('adended', function() {
                player.ads.endLinearAdMode();
                $('.video_js_skip_ad').remove();
                $('.video-player').attr('onclick', '');
                setTimeout(function () {
                  if ($('#autoplay').is(":checked")) {
                     var media = document.querySelector("video");
                     media.addEventListener('ended', function (e) {
                        if ($('#autoplay').is(":checked")) {
                           var url = $('#next-video').find('a').attr('href');
                           if (url) {
                              window.location.href = url;
                           }
                        }
                        else{
                          /* pass */
                        }
                      }, false);
   
                  }
               },2000);
                 $('.vjs-resolution-button').show();
              });
            });
   
            player.trigger('adsready');
            function end_video_js_ad() {
               player.ads.endLinearAdMode();
               $('.video_js_skip_ad').remove();
               $('.video-player').attr('onclick', '');
                setTimeout(function () {
                  if ($('#autoplay').is(":checked")) {
                     var media = document.querySelector("video");
                     media.addEventListener('ended', function (e) {
                        if ($('#autoplay').is(":checked")) {
                           var url = $('#next-video').find('a').attr('href');
                           if (url) {
                              window.location.href = url;
                           }
                        }
                        else{
                          /* pass */
                        }
                      }, false);
   
                  }
               },2000);
                 $('.vjs-resolution-button').show();
   
            }
         }else{
            <?php if (!empty($pt->ad_image)) { ?>
            //videojs("my-video", { "controls": true, "autoplay": false, "preload": "auto" });
            videojs('my-video', {
                controls: true,
                plugins: {
                  videoJsResolutionSwitcher: {
                    default: 'low', // Default resolution [{Number}, 'low', 'high'],
                    dynamicLabel: true
                  }
                }
              }, function(){
                var player = this;
                window.player = player
                player.updateSrc([
                   <?php if (!empty($pt->video_4096)) { ?>
                  {
                    src: '{{VIDEO_LOCATION_4096}}',
                    type: '{{VIDEO_TYPE}}',
                    label: '4K',
                    res: 4096
                  },
                  <?php } ?>
                  <?php if (!empty($pt->video_2048)) { ?>
                  {
                    src: '{{VIDEO_LOCATION_2048}}',
                    type: '{{VIDEO_TYPE}}',
                    label: '2K',
                    res: 2048
                  },
                  <?php } ?>
                  <?php if (!empty($pt->video_1080)) { ?>
                  {
                    src: '{{VIDEO_LOCATION_1080}}',
                    type: '{{VIDEO_TYPE}}',
                    label: '1080p',
                    res: 1080
                  },
                  <?php } ?>
                  <?php if (!empty($pt->video_720)) { ?>
                  {
                    src: '{{VIDEO_LOCATION_720}}',
                    type: '{{VIDEO_TYPE}}',
                    label: '720p',
                    res: 720
                  },
                  <?php } ?>
                  <?php if (!empty($pt->video_480)) { ?>
                  {
                    src: '{{VIDEO_LOCATION_480}}',
                    type: '{{VIDEO_TYPE}}',
                    label: '480p',
                    res: 480
                  },
                  <?php } ?>
                  <?php if (!empty($pt->video_360)) { ?>
                  {
                    src: '{{VIDEO_LOCATION_360}}',
                    type: '{{VIDEO_TYPE}}',
                    label: '360p',
                    res: 360
                  },
                  <?php } ?>
                  <?php if (!empty($pt->video_240)) { ?>
                  {
                    src: '{{VIDEO_LOCATION_240}}',
                    type: '{{VIDEO_TYPE}}',
                    label: '240p',
                    res: 240
                  },
                  <?php } ?>
                  <?php if (!empty($pt->get_video->youtube) || (!empty($pt->get_video->video_location) && empty($pt->video_360))) { ?>
                  {
                    src: '{{VIDEO_LOCATION}}',
                    type: '{{VIDEO_TYPE}}',
                    label: <?php echo(!empty($pt->video_quality) ? '"'.$pt->video_quality.'"' : '"360p"') ?>,
                    res: <?php echo(!empty($pt->video_res) ? $pt->video_res : 360) ?>
                  },
                  <?php } ?>
                ])
   
              });
            if ($('#autoplay').is(":checked")) {
                  var media = document.querySelector("video");
                  media.addEventListener('ended', function (e) {
                     if ($('#autoplay').is(":checked")) {
                        var url = $('#next-video').find('a').attr('href');
                        if (url) {
                           window.location.href = url;
                        }
                     }
                     else{
                       /* pass */
                     }
                   }, false);
   
               }
            <?php }else{ ?>
               //videojs("my-video", { "controls": true, "autoplay": 'play', "preload": "auto" });
               videojs('my-video', {
                   controls: true,
                   plugins: {
                     videoJsResolutionSwitcher: {
                       default: 'low', // Default resolution [{Number}, 'low', 'high'],
                       dynamicLabel: true
                     }
                   }
                 }, function(){
                   var player = this;
                   window.player = player
                   player.updateSrc([
                      <?php if (!empty($pt->video_4096)) { ?>
                     {
                       src: '{{VIDEO_LOCATION_4096}}',
                       type: '{{VIDEO_TYPE}}',
                       label: '4K',
                       res: 4096
                     },
                     <?php } ?>
                     <?php if (!empty($pt->video_2048)) { ?>
                     {
                       src: '{{VIDEO_LOCATION_2048}}',
                       type: '{{VIDEO_TYPE}}',
                       label: '2K',
                       res: 2048
                     },
                     <?php } ?>
                     <?php if (!empty($pt->video_1080)) { ?>
                     {
                       src: '{{VIDEO_LOCATION_1080}}',
                       type: '{{VIDEO_TYPE}}',
                       label: '1080p',
                       res: 1080
                     },
                     <?php } ?>
                     <?php if (!empty($pt->video_720)) { ?>
                     {
                       src: '{{VIDEO_LOCATION_720}}',
                       type: '{{VIDEO_TYPE}}',
                       label: '720p',
                       res: 720
                     },
                     <?php } ?>
                     <?php if (!empty($pt->video_480)) { ?>
                     {
                       src: '{{VIDEO_LOCATION_480}}',
                       type: '{{VIDEO_TYPE}}',
                       label: '480p',
                       res: 480
                     },
                     <?php } ?>
                     <?php if (!empty($pt->video_360)) { ?>
                     {
                       src: '{{VIDEO_LOCATION_360}}',
                       type: '{{VIDEO_TYPE}}',
                       label: '360p',
                       res: 360
                     },
                     <?php } ?>
                     <?php if (!empty($pt->video_240)) { ?>
                     {
                       src: '{{VIDEO_LOCATION_240}}',
                       type: '{{VIDEO_TYPE}}',
                       label: '240p',
                       res: 240
                     },
                     <?php } ?>
                     <?php if (!empty($pt->get_video->youtube) || (!empty($pt->get_video->video_location) && empty($pt->video_360))) { ?>
                     {
                       src: '{{VIDEO_LOCATION}}',
                       type: '{{VIDEO_TYPE}}',
                       label: <?php echo(!empty($pt->video_quality) ? '"'.$pt->video_quality.'"' : '"360p"') ?>,
                       res: <?php echo(!empty($pt->video_res) ? $pt->video_res : 360) ?>
                     },
                     <?php } ?>
                   ]);
                   if ('{{VAST_URL}}' != '') {
                     var options = {
                          id: 'my-video',
                          adTagUrl: "{{VAST_URL}}",
                           vastLoadTimeout:{{AD_SKIP_NUM}} * 1000
                        };
   
                        player.ima(options);
   
                        // Remove controls from the player on iPad to stop native controls from stealing
                        // our click
                        var contentPlayer =  document.getElementById('my-video_html5_api');
                        if ((navigator.userAgent.match(/iPad/i) ||
                              navigator.userAgent.match(/Android/i)) &&
                            contentPlayer.hasAttribute('controls')) {
                          contentPlayer.removeAttribute('controls');
                        }
   
                        // Initialize the ad container when the video player is clicked, but only the
                        // first time it's clicked.
                        var initAdDisplayContainer = function() {
                          player.ima.initializeAdDisplayContainer();
                          wrapperDiv.removeEventListener(startEvent, initAdDisplayContainer);
                        }
   
                        var startEvent = 'click';
                        if (navigator.userAgent.match(/iPhone/i) ||
                            navigator.userAgent.match(/iPad/i) ||
                            navigator.userAgent.match(/Android/i)) {
                          startEvent = 'touchend';
                        }
   
                        var wrapperDiv = document.getElementById('my-video');
                        wrapperDiv.addEventListener(startEvent, initAdDisplayContainer);
   
   
   
                    }
   
                 });
               if ($('#autoplay').is(":checked")) {
                  var media = document.querySelector("video");
                  media.addEventListener('ended', function (e) {
                     if ($('#autoplay').is(":checked")) {
                        var url = $('#next-video').find('a').attr('href');
                        if (url) {
                           window.location.href = url;
                        }
                     }
                     else{
                       /* pass */
                     }
                   }, false);
   
               }
            <?php } ?>
   
         }
         if (sources.length > 1) {
            setTimeout(function () {
               $('.vjs-menu-content').append('<li class="vjs-menu-item" tabindex="-1" role="menuitem" aria-disabled="false" onclick="setAuto(this)"><span class="vjs-menu-item-text">auto</span><span class="vjs-control-text" aria-live="polite"></span></li>');
            },1000);
         }
   
   
   <?php }else if($pt->config->player_type == 'default' || !empty($pt->get_video->youtube)){ ?>
   
   
   
       $('video').mediaelementplayer({
         pluginPath: 'https://cdnjs.com/libraries/mediaelement-plugins/',
         shimScriptAccess: 'always',
         autoplay: true,
         features: ['playpause', 'current', 'progress', 'duration', 'speed', 'skipback', 'jumpforward', 'tracks', 'markers', 'volume', 'chromecast', 'contextmenu', 'flash' <?php echo ($pt->config->ffmpeg_system == 'on' && empty($pt->get_video->youtube)) ? ", 'quality'" : ''?> {{ADS}} {{VAT}}, 'fullscreen'],
         vastAdTagUrl: '{{VAST_URL}}',
         vastAdsType: '{{VAST_TYPE}}',
         jumpForwardInterval: 10,
         adsPrerollMediaUrl: [{{AD_MEDIA}}],
         adsPrerollAdUrl: [{{AD_LINK}}],
         adsPrerollAdEnableSkip: {{AD_SKIP}},
         adsPrerollAdSkipSeconds: {{AD_SKIP_NUM}},
        contextMenuItems: [{ isSeparator: true }],
         success: function (media) {
             media.addEventListener('ended', function (e) {
               $('#adContainer').slideUp();
               src = $('video').attr('src');
               sources = $('video').find('source');
               for (var i = sources.length - 1; i >= 0; i--) {
                  if ($(sources[i]).attr('src') == src) {
                     if ($('#autoplay').is(":checked")) {
                        var url = $('#next-video').find('a').attr('href');
                        if (url) {
                           window.location.href = url;
                        }
                     }
                     else{
                       /* pass */
                     }
                  }
               }
   
   
             }, false);
   
             media.addEventListener('playing', function (e) {
               if (pt_elexists('.ads-overlay-info')) {
                 $('.ads-overlay-info').remove();
               }
   
   
   
               $('.ads-test').remove();
   
               if ($('body').attr('resized') == 'true') {
                   PT_Resize(true);
               }
               $('.mejs__container').css('height', ($('.mejs__container').width() / 1.77176216) + 'px');
               $('video, iframe').css('height', '100%');
             });
             <?php if (!empty($pt->get_video->youtube)) { ?>
               //    $(document).on('click', '.mejs__container', function(event) {
   
               //    $('.mejs__layer').css('display', 'flex');
               //    $('.mejs__overlay-play').css('display', 'none');
               //    media.play();
               // });
            <?php } ?>
         },
       });
       if (sources.length > 1) {
         setTimeout(function () {
            $('.mejs__qualities-selector-list').append('<li class="mejs__qualities-selector-list-item" onclick="setAuto(this)"><input class="mejs__qualities-selector-input" type="radio" name="mep_0_qualities" value="auto" id="mep_0-qualities-auto"><label for="mep_0-qualities-auto" class="mejs__qualities-selector-label" id="quality__auto">auto</label></li>');
         },1000);
      }
   
   
   
   
   
   <?php } ?>
</script>
<?php } ?>
<?php if ($pt->config->player_type == 'plyr' && empty($pt->get_video->youtube)) { ?>
<script type="text/javascript">
   const player_<?php echo $pt->get_video->id.'_'.time(); ?> = new Plyr('#my-video_<?php echo $pt->get_video->id; ?>', {
      <?php if (empty($pt->ad_image)) { ?>
     autoplay:true,
     <?php } ?>
      quality:{ default: 4096, options: [<?php if (!empty($pt->video_4096)) { ?> 4096 ,<?php } ?><?php if (!empty($pt->video_2048)) { ?> 2048 ,<?php } ?><?php if (!empty($pt->video_1080)) { ?> 1080 ,<?php } ?><?php if (!empty($pt->video_720)) { ?> 720 ,<?php } ?><?php if (!empty($pt->video_480)) { ?> 480 ,<?php } ?><?php if (!empty($pt->video_360)) { ?> 360 ,<?php } ?><?php if (!empty($pt->video_240)) { ?> 240 <?php } ?>] }
   });
   setTimeout(function () {
     if ($('#autoplay').is(":checked")) {
     var media = document.querySelector("video");
     media.addEventListener('ended', function (e) {
      setTimeout(function () {
      <?php if (!empty($pt->vast_url)) { ?>
         var media2 = document.querySelector("video");
       media2.addEventListener('ended', function (e) {
         if ($('#autoplay').is(":checked")) {
             var url = $('#next-video').find('a').attr('href');
             if (url) {
                window.location.href = url;
             }
          }
          else{
            /* pass */
          }
       }, false);
      <?php }else{ ?>
         if ($('#autoplay').is(":checked")) {
            var url = $('#next-video').find('a').attr('href');
            if (url) {
               window.location.href = url;
            }
         }
         else{
           /* pass */
         }
      <?php } ?>
     },500);
   
      }, false);
   
   }
   },1000);
   
</script>
<?php } ?>
<?php if($pt->config->player_type == 'cloudinary' && empty($pt->get_video->youtube)){ echo PT_LoadPage('watch/cloudinary_player');} ?>
<?php if (!empty($pt->get_video->facebook)) { ?>
<div id="fb-root"></div>
<script>(function(d, s, id) {
   var js, fjs = d.getElementsByTagName(s)[0];
   if (d.getElementById(id)) return;
   js = d.createElement(s); js.id = id;
   js.src = 'https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v3.1&appId={{CONFIG facebook_app_ID}}&autoLogAppEvents=1';
   fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>
<?php } ?>
<script>
   function copyLinkfn() {
     var copyText = document.getElementById("copyLink");
     copyText.select();
     document.execCommand("copy");
   };
   
   <?php if (!empty($pt->get_video->vimeo)) {?>
   var $window = $(window);
   var $videoWrap = $('.pt_vdo_plyr');
   var $video = $('.embed-responsive');
   var videoHeight = $videoWrap.outerHeight();
   
   $window.on('scroll',  function() {
     var windowScrollTop = $window.scrollTop();
     var videoBottom = videoHeight + $videoWrap.offset().top;
   
     if (windowScrollTop > videoBottom) {
       $videoWrap.height(videoHeight);
       $video.addClass('stuck');
     } else {
       $videoWrap.height('auto');
       $video.removeClass('stuck');
     }
   });
   <?php } else if (!empty($pt->get_video->daily)) { ?>
   var $window = $(window);
   var $videoWrap = $('.pt_vdo_plyr');
   var $video = $('.embed-responsive');
   var videoHeight = $videoWrap.outerHeight();
   
   $window.on('scroll',  function() {
     var windowScrollTop = $window.scrollTop();
     var videoBottom = videoHeight + $videoWrap.offset().top;
   
     if (windowScrollTop > videoBottom) {
       $videoWrap.height(videoHeight);
       $video.addClass('stuck');
     } else {
       $videoWrap.height('auto');
       $video.removeClass('stuck');
     }
   });
   <?php } else { ?>
   <?php } ?>
   
   <?php if ($pt->converted !== true): ?>
   setInterval(function () {
     $.get('{{LINK aj/check-video-status}}', {id: $('#video-id').val()}, function(data) {
       if (data.status == 200) {
         location.reload();
       }
     });
   }, 5000);
   <?php endif; ?>
   jQuery(window).ready(function($) {
       var width = $('.video-player').width().toString();
       var width = width.substring(0, width.lastIndexOf("."))
       $('.fb-video').attr('data-width', width);
       //$( 'iframe' ).attr( 'src', function ( i, val ) { return val; });
       $("#load-related-videos").click(function(event) {
         let id = 0;
         if ($("div[data-sidebar-video]").length > 0) {
           id = $("div[data-sidebar-video]").last().attr('data-sidebar-video');
         }
   
         $("#load-related-videos").find('i.spin').removeClass('hidden');
   
         $.ajax({
           url: '{{LINK aj/load-related-videos}}',
           type: 'GET',
           dataType: 'json',
           data: {id: id,video_id:'{{ID}}'},
         })
         .done(function(data) {
           if (data.status == 200) {
             $(".related-videos").append(data.html);
           }
           else{
             $("#load-related-videos").find('span').text('{{LANG no_more_videos}}');
           }
           $("#load-related-videos").find('i.spin').addClass('hidden');
   
         });
       });
   });
   
   $('.ad-link').on('click', function(event) {
     $('.ad-link').remove();
     $('video')[0].play();
   });
   
   <?php if (!empty($pt->ad_image)) { ?>
   var counter = {{AD_SKIP_NUM}};
   var interval = setInterval(function() {
       counter--;
       $('.timer span').text(counter);
       if (counter == 0 || counter < 0) {
           $('.ad-link').remove();
           $('video')[0].play();
           clearInterval(interval);
       }
   }, 1000);
   <?php } ?>
   $('.autoplay-video').on('change', function(event) {
     event.preventDefault();
     checked = 1;
     if($(this).is(":checked")) {
       checked = 2;
     }
     $.post('{{LINK aj/set-cookies}}', {name: 'autoplay', value: checked});
   });
   $('.ads-test').on('click', function(event) {
     $(this).remove();
   });
   
   
   $(function () {
      <?php if ($pt->is_wl || $pt->is_list) { ?>
      $(".play-list-cont-wrapper").height(($(".player-video").height()));
      $(".play-list-cont").height(($(".player-video").height()-60));
      $(window).resize(function(event) {
       $(".play-list-cont-wrapper").height(($(".player-video").height()));
       $(".play-list-cont").height(($(".player-video").height()-60));
      });
      <?php } ?>

       $('.rad-transaction').click(function(event) {
         $(this).off("click").removeClass('rad-transaction');
         $.get('{{LINK aj/ads/rad-transaction}}', function(data){ /* pass */ });
       });
   
       if ($('[data-litsitem-id]').length > 4) {
         var listItemtopPos = $("div[data-litsitem-id=<?php echo $pt->get_id; ?>]").offset();
         $('.play-list-cont').scrollTop((listItemtopPos.top - 170));
       }
   
      $('#save-button').on('click', function(event) {
         event.preventDefault();
         var logged = $('#main-container').attr('data-logged');
         if (!logged) {
            window.location.href = "{{LINK login?to=<?php echo $pt->actual_link;?>}}";
            return false;
         }
         var video_id = $('#video-id').val();
         if ($(this).attr('saved')) {
            $(this).html('<i class="fa fa-floppy-o fa-fw"></i> {{LANG save}}');
            $(this).removeAttr('saved');
         } else {
            $(this).html('<i class="fa fa-check fa-fw"></i> {{LANG saved}}');
            $(this).attr('saved', 'true');
         }
         $.post('{{LINK aj/save-video}}', {video_id: video_id});
      });
      $('.desc').on('click', function(event) {
         event.preventDefault();
         if ($(this).hasClass('expended')) {
           $('.watch-video-description').css({
              'max-height': '100px',
              'height': '100px',
              'overflow': 'hidden'
           });
           $(this).removeClass('expended');
           $(this).text("{{LANG show_more}}");
         } else {
           $('.watch-video-description').css({
              'max-height': '4000px',
              'height': 'auto',
              'overflow': 'auto'
           });
           $(this).addClass('expended');
           $(this).text("{{LANG show_less}}");
         }
      });
   
      <?php if (!empty($pt->get_video->youtube)) { ?>
      setTimeout(function () {
        $('iframe').css({ width: '100%', height: '100%'});
      }, 2000);
      <?php } ?>
   
      //  $('video').mediaelementplayer({
      //    pluginPath: 'https://cdnjs.com/libraries/mediaelement-plugins/',
      //    shimScriptAccess: 'always',
      //    autoplay: true,
      //    features: ['playpause', 'current', 'progress', 'duration', 'speed', 'skipback', 'jumpforward', 'tracks', 'markers', 'volume', 'chromecast', 'contextmenu', 'flash' <?php echo ($pt->config->ffmpeg_system == 'on' && empty($pt->get_video->youtube)) ? ", 'quality'" : ''?> {{ADS}} {{VAT}}, 'fullscreen'],
      //    vastAdTagUrl: '{{VAST_URL}}',
      //    vastAdsType: '{{VAST_TYPE}}',
      //    jumpForwardInterval: 10,
      //    adsPrerollMediaUrl: [{{AD_MEDIA}}],
      //    adsPrerollAdUrl: [{{AD_LINK}}],
      //    adsPrerollAdEnableSkip: {{AD_SKIP}},
      //    adsPrerollAdSkipSeconds: {{AD_SKIP_NUM}},
        // contextMenuItems: [{ isSeparator: true }],
      //    success: function (media) {
      //        media.addEventListener('ended', function (e) {
      //          if ($('#autoplay').is(":checked")) {
      //             var url = $('#next-video').find('a').attr('href');
      //             if (url) {
      //                window.location.href = url;
      //             }
      //          }
      //          else{
      //            /* pass */
      //          }
      //        }, false);
   
      //        media.addEventListener('playing', function (e) {
      //          if (pt_elexists('.ads-overlay-info')) {
      //            $('.ads-overlay-info').remove();
      //          }
   
   
   
      //          $('.ads-test').remove();
   
      //          if ($('body').attr('resized') == 'true') {
      //              PT_Resize(true);
      //          }
      //          $('.mejs__container').css('height', ($('.mejs__container').width() / 1.77176216) + 'px');
      //          $('video, iframe').css('height', '100%');
      //        });
      //    },
      //  });
   
       $('.expend-player').on('click', function(event) {
        event.preventDefault();
        $('body').removeClass('side_open');
        SlideEraseCookie('open_slide');
        var resize = 0;
        if ($('.player-video').hasClass('col-md-12')) {
          resize = 0;
        } else {
          resize = 1;
        }
        $.post('{{LINK aj/set-cookies}}', {name: 'resize', value:resize});
        PT_Resize();
       });
      <?php if (!empty($_SESSION['resize']) && $pt->config->resize_video == 'on' && (empty($pt->get_video->daily) && empty($pt->get_video->vimeo))) { ?>
         PT_Resize(true);
       <?php } ?>
      $(window).resize(function(event) {
        if ($('body').attr('resized') == 'true') {
           PT_Resize(true);
        }
      });
   });
   
   function PT_Resize(type) {
     if ($('.player-video').hasClass('col-md-12') && type != true) {
         $('.player-video').addClass('col-md-8');
         $('.player-video').removeClass('col-md-12');
         $('.player-video').css('margin-bottom', '0');
         $('.mejs__container, video, iframe').css('width', '100%');
         $('video, iframe').css('height', '100%');
         $('body').attr('resized', 'false');
        $('.yp_side_drawer').removeClass('hide_side_menu');
        $('.yp_side_menu').addClass('has_side_menu');
      } else {
         $('.player-video').removeClass('col-md-8');
         $('.player-video').addClass('col-md-12');
         $('.player-video').css('margin-bottom', '20px');
         $('.mejs__container, video, iframe').css('width', '100%');
         $('video, iframe').css('height', '100%');
         $('body').attr('resized', 'true');
        $('.yp_side_drawer').addClass('hide_side_menu');
        $('.yp_side_menu').removeClass('has_side_menu');
      }
   };
   
   function growTextarea (i,elem) {
      var elem = $(elem);
      var resizeTextarea = function( elem ) {
         var scrollLeft = window.pageXOffset || (document.documentElement || document.body.parentNode || document.body).scrollLeft;
         var scrollTop  = window.pageYOffset || (document.documentElement || document.body.parentNode || document.body).scrollTop;
         elem.css('height', 'auto').css('height', elem.prop('scrollHeight') );
            window.scrollTo(scrollLeft, scrollTop);
      };
      elem.on('input', function() {
         resizeTextarea( $(this) );
      });
      resizeTextarea( $(elem) );
   }
   
   $('.jTextarea').each(growTextarea);
</script>
<?php
   if (empty($_SESSION['finger'])) {
   ?>
<script>
   var fingerprintReport = function () {
      Fingerprint2.get(function(components) {
        var murmur = Fingerprint2.x64hash128(components.map(function (pair) { return pair.value }).join(), 31)
        $.post('{{LINK aj/views}}?hash=' + $('.main_session').val()+'&type_=set', {finger: murmur}, function(data, textStatus, xhr) {
   
         <?php
      if ($pt->continent_hide == false) {
       if (($pt->video_approved == true  && (($pt->get_video->sell_video > 0 && $pt->is_paid > 0) || $pt->get_video->sell_video == 0) && ($pt->get_video->age == false) && $pt->video_type == 'public') || $pt->get_video->is_owner || PT_IsAdmin()) {
         if ($pt->converted == true) {
         ?>
   
            $.post('{{LINK aj/views}}?hash=' + $('.main_session').val()+'&type_=add', {video_id:{{ID}}}, function(data, textStatus, xhr) {
            if (data.status == 200) {
               $('#video-views-count').html(data.count);
            }
           });
         <?php } } } ?>
   
   
        });
      })
   }
   fingerprintReport();
</script>
<?php }else{ ?>
<?php
   if ($pt->continent_hide == false) {
    if (($pt->video_approved == true  && (($pt->get_video->sell_video > 0 && $pt->is_paid > 0) || $pt->get_video->sell_video == 0) && ($pt->get_video->age == false) && $pt->video_type == 'public') || $pt->get_video->is_owner || PT_IsAdmin()) {
      if ($pt->converted == true) {
      ?>
<script>
   $.post('{{LINK aj/views}}?hash=' + $('.main_session').val()+'&type_=add', {video_id:{{ID}}}, function(data, textStatus, xhr) {
   if (data.status == 200) {
      $('#video-views-count').html(data.count);
   }
   });
</script>
<?php } } } ?>
<?php } ?>
<style>
   .mejs__fullscreen .mejs__container {
   max-height: 100% !important;
   }
   /*.mejs__container {
   max-height: 555px !important;
   }*/
   .mejs__fullscreen video {
   max-height: 100% !important;
   }
   .vjs-fullscreen video {
   max-height: 100% !important;
   }
   .fluid_video_wrapper.fluid_player_layout_default:-webkit-full-screen video{max-height: 100% !important;}
   /*video {
   max-height: 555px !important;
   }*/
   .mejs__offscreen {
   clip: initial !important;
   clip-path: inherit !important;
   -webkit-clip-path: inherit !important;
   opacity: 0;
   }
</style>
<?php echo PT_LoadPage('watch/agora'); ?>
<?php if ($pt->config->sticky_video == 'on' && !$pt->is_movie) { ?>
<script type="text/javascript">
   $.getScript('{{CONFIG theme_url}}/js/sticky_video.js', function(data, textStatus) {
      new StickyVideo('post_live_video_<?php echo($pt->get_video->id) ?>')
   });
</script>
<?php } ?>
<?php if (!empty($pt->vast_url) && empty($pt->get_video->facebook) && empty($pt->get_video->ok) && empty($pt->get_video->vimeo) && empty($pt->get_video->daily) && empty($pt->get_video->twitch) && empty($pt->get_video->stream_name)) { echo PT_LoadPage('watch/ima'); } ?>
<?php if (!empty($pt->get_video->owner->google_tracking_code)) { ?>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo($pt->get_video->owner->google_tracking_code) ?>"></script>
<script>
   window.dataLayer = window.dataLayer || [];
   function gtag(){dataLayer.push(arguments);}
   gtag('js', new Date());
   
   gtag('config', '<?php echo($pt->get_video->owner->google_tracking_code) ?>');
</script>
<?php } ?>