<div class="page-margin video-player-page">
    <div class="col-md-8">
        <div class="top-video">
            <div class="row">
                <div class="content">
                    <div class="related-header">
                        <h4><i class="fa fa-bolt fa-fw"></i> {{LANG featured_video}}</h4>
                    </div>
                    <div class="">
                        <div class="video-player">
                            <?php if (!empty($pt->get_video->vimeo)) {?>
                              <iframe src="http://player.vimeo.com/video/{{VIDEO_ID}}?api=1;title=0&amp;byline=0&amp;portrait=0&amp;autoplay=1" width="100%" height="500" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
                              <?php } else if (!empty($pt->get_video->daily)) { ?>
                                  <iframe frameborder="0" width="100%" height="500" src="//www.dailymotion.com/embed/video/{{VIDEO_ID}}?PARAMS" allowfullscreen></iframe>
                                  <?php } else { ?>
                                      <video id="my-video" controls style="width:100%; height:100%;" poster="{{THUMBNAIL}}">
                                           <?php if (!empty($pt->video_720)) { ?>
                     <source src="{{VIDEO_LOCATION_720}}" type="{{VIDEO_TYPE}}" data-quality="720p">
                     <?php } ?>
                     <?php if (!empty($pt->video_480)) { ?>
                     <source src="{{VIDEO_LOCATION_480}}" type="{{VIDEO_TYPE}}" data-quality="480p">
                     <?php } ?>
                     <source src="{{VIDEO_LOCATION}}" type="{{VIDEO_TYPE}}" data-quality="360p">
                     <?php if (!empty($pt->video_240)) { ?>
                     <source src="{{VIDEO_LOCATION_240}}" type="{{VIDEO_TYPE}}" data-quality="240p">
                     <?php } ?>
                                          
                                      </video>
                                      <?php } ?>
                        </div>
                        <div class="video-title">
                            <input type="hidden" value="{{ID}}" id="video-id">
                            <div class="video-big-title">
                                <a href="{{URL}}">{{TITLE}}</a>
                            </div>
                            <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}}">{{USER name_v}}</a><span class="views-mobile show-in-mobile"> - {{VIEWS}} {{LANG views}}</span>
                                </div>
                                <div class="publisher-subscribe-button">
                                    {{SUBSCIBE_BUTTON}}
                                </div>
                                <div class="clear"></div>
                            </div>
                            <div class="video-info-element pull-right">
                                <div class="video-views hide-in-mobile-720">
                                    {{VIEWS}} {{LANG views}}
                                </div>
                                <div class="views-bar hide-in-mobile-720" style="width: {{DISLIKES_P}}%"></div>
                                <div class="views-bar blue hide-in-mobile-720" style="width: {{LIKES_P}}%"></div>
                                <div class="clear"></div>
                                <div class="video-likes">
                                    <div class="like-btn pull-left {{LIKE_ACTIVE_CLASS}}" id="likes-bar" onclick="Wo_LikeSystem('{{ID}}', 'like', this, 'is_ajax')" data-likes="{{RAEL_LIKES}}" {{ISLIKED}}>
                                        <i class="fa fa-thumbs-up"></i> <span class="likes" id="likes">{{LIKES}}</span>
                                    </div>
                                    <div class="like-btn pull-right text-right {{DIS_ACTIVE_CLASS}}" id="dislikes-bar" onclick="Wo_LikeSystem('{{ID}}', 'dislike', this, 'is_ajax')" data-likes="{{RAEL_DISLIKES}}" {{ISDISLIKED}}>
                                        <i class="fa fa-thumbs-down"></i> <span class="likes" id="dislikes">{{DISLIKES}}</span>
                                    </div>
                                    <div class="clear"></div>
                                </div>
                            </div>
                            <div class="clear"></div>
                            <div class="video-options">
                                <?php if (IS_LOGGED): ?>
                                <button class="btn-share" onclick="PT_AddToList('{{ID}}');">
                                    <i class="fa fa-plus fa-fw"></i> {{LANG add_to}}
                                </button>
                                <?php endif; ?>
                                <button class="btn-share" id="share-video">
                                    <i class="fa fa-share fa-fw"></i> {{LANG share}}
                                </button>
                                <?php if ($pt->config->embed_system == 'on') {?>
                                    <button class="btn-share" id="embed-video">
                                        <i class="fa fa-code fa-fw"></i> {{LANG embed}}
                                    </button>
                                    <?php } ?>
                                        <div class="embed-placement hidden">
                                            <textarea readonly rows="3" class="form-control"><iframe src="{{LINK embed/{{VIDEO_MAIN_ID}}}}" frameborder="0" width="700" height="400" allowfullscreen></iframe>
                                            </textarea>
                                        </div>
                                        <div class="share-video hidden">
                                            <a href="https://www.facebook.com/sharer/sharer.php?u={{ENCODED_URL}}" class="fa fa-facebook"></a>
                                            <a href="https://twitter.com/home?status={{ENCODED_URL}}" class="fa fa-twitter"></a>
                                            <a href="https://plus.google.com/share?url={{ENCODED_URL}}" class="fa fa-google"></a>
                                            <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ENCODED_URL}}&title={{TITLE}}&summary=&" class="fa fa-linkedin"></a>
                                            <a href="ttps://pinterest.com/pin/create/button/?url={{ENCODED_URL}}&media={{THUMBNAIL}}" class="fa fa-pinterest"></a>
                                            <a href="http://www.tumblr.com/share/link?url={{ENCODED_URL}}" class="fa fa-tumblr"></a>
                                            <a href="http://www.reddit.com/submit?url={{ENCODED_URL}}" class="fa fa-reddit"></a>
                                            <a href="#" onclick="copyToClipboard(this)" class="fa fa-link" link="{{URL}}"></a>
                                        </div>
                            </div>
                            <div class="video-published">
                                {{LANG published_on}} {{TIME}} / {{LANG in}} <a href="">{{CATEGORY}}</a>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-4">
            <div class="content">
                <div class="related-header">
                    <h4>{{LANG top_videos}}</h4>
                </div>
                <div class="videos-list">
                    {{TOP_VIDEOS}}
                </div>
            </div>
        </div>
    </div>
    <div class="clear"></div>

    <div class="col-md-12">
        <div class="row">
            <div class="content">
                <div class="home-page-categories">
                    <div class="title">
                        <h4>{{LANG trending}} <span><a href="{{LINK videos/trending}}">{{LANG explore_more}} <i class="fa fa-arrow-right fa-fw"></i> </a></span></h4>
                    </div>
                    <div class="videos">
                        <div class="row">
                            {{TRENDING_LIST}}
                            <div class="clear"></div>
                        </div>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
        </div>
    </div>
    {{SUBSC_HTML}}
    <div class="col-md-12">
        <div class="row">
            <div class="content">
                <div class="home-page-categories">
                    <div class="title">
                        <h4>{{LANG top_videos}} <span><a href="{{LINK videos/top}}">{{LANG explore_more}} <i class="fa fa-arrow-right fa-fw"></i> </a></span></h4>
                    </div>
                    <div class="videos">
                        <div class="row">
                            {{TOP_LIST}}
                            <div class="clear"></div>
                        </div>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
        </div>
    </div>
    <div class="col-md-12">
        <div class="row">
            <div class="content">
                <div class="home-page-categories">
                    <div class="title">
                        <h4>{{LANG latest_videos}} <span><a href="{{LINK videos/latest}}">{{LANG explore_more}} <i class="fa fa-arrow-right fa-fw"></i> </a></span></h4>
                    </div>
                    <div class="videos">
                        <div class="row">
                            {{LATEST_LIST}}
                            <div class="clear"></div>
                        </div>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
        </div>
    </div>
    {{HOME_PAGE_VIDEOS}}
</div>
<script>
$(function () {
    $('#share-video').on('click', function(event) {
      event.preventDefault();
      $('.share-video').toggleClass('hidden');
   });
   $('#embed-video').on('click', function(event) {
      event.preventDefault();
      $('.embed-placement').toggleClass('hidden');
   });
   $('#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});
   });
   	$('video').mediaelementplayer({
   		// Do not forget to put a final slash (/)
   		pluginPath: 'https://cdnjs.com/libraries/mediaelement/',
   		// this will allow the CDN to use Flash without restrictions
   		// (by default, this is set as `sameDomain`)
   		shimScriptAccess: 'always',

      features: ['playpause', 'current', 'progress', 'duration', 'speed', 'skipback', 'jumpforward', 'tracks', 'markers', 'volume', 'chromecast', 'contextmenu', 'flash'<?php echo ($pt->config->ffmpeg_system == 'on') ? ", 'quality'" : ''?>, 'fullscreen'],
   
   		success: function (media) {
   			var isYoutube = ~media.rendererName.indexOf('youtube');
   		}
   		// more configuration
   	});
   });


</script>
<style>
#mep_0 {
  max-height: 100% !important;
}
.mejs__offscreen {
  clip: initial !important;
  clip-path: inherit !important;
  -webkit-clip-path: inherit !important;
  opacity: 0;
}
</style>