Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @copyright Copyright (c) 2016 AmyTheme (http://www.amytheme.com). All rights reserved.
- * @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
- */
- defined('ABSPATH') or die;
- global $post;
- $streaming = get_post_meta($post->ID, '_movie_streaming', true);
- wp_enqueue_style( 'wp-mediaelement' );
- wp_enqueue_script('wp-mediaelement');
- ?>
- <div class="movie-steaming">
- <div class="amy-movie-item-play">
- <div class="container">
- <div class="box-player" id="amyStream">
- <?php
- $video_link = '';
- $video_type = '';
- if (!empty($streaming['servers'])) {
- $s = $streaming['servers'][1];
- $p = $s['parts'];
- $x = reset($p);
- $video_link = $x['link'];
- if (strpos($video_link, 'youtube') == true) {
- $video_type = 'youtube';
- } else if (strpos($video_link, 'vimeo') == true) {
- $video_type = 'vimeo';
- } else {
- $video_type = 'video';
- }
- }
- ?>
- <?php if (strpos($video_link, 'youtube') == true || strpos($video_link, 'vimeo') == true) : ?>
- <video id='amyplayer' data-source='<?php echo ($video_link); ?>' data-type='<?php echo ($video_type); ?>' data-poster='' controls playsinline></video>
- <?php else : ?>
- <div class="amy-iframe">
- <iframe src="<?php echo ($video_link); ?>" allowfullscreen></iframe>
- </div>
- <?php endif; ?>
- </div>
- <div class="div-control">
- <span class="btn-action btn_lightbulb" title="<?php echo esc_html__('Turn off the light', 'moviezone'); ?>">
- <i class="fa fa-lightbulb-o"></i>
- <span class="turn-off"><?php echo esc_html__('Turn off the light', 'moviezone'); ?></span>
- <span class="turn-on"><?php echo esc_html__('Turn on the light', 'moviezone'); ?></span>
- </span>
- </div>
- </div>
- </div>
- <div class="amy-movie-item-content-header">
- <div class="container">
- <header class="amy-movie-item-header">
- <div class="amy-movie-item-header-left">
- <?php get_template_part('movie/single/parts/title'); ?>
- </div>
- <div class="amy-movie-item-header-right">
- <?php get_template_part('movie/single/parts/social'); ?>
- </div>
- </header>
- <?php if (!empty($streaming['servers'])) : ?>
- <div class="amy-movie-list-server">
- <?php $j = 0; ?>
- <?php foreach ($streaming['servers'] as $server) : ?>
- <div class="amy-movie-serve-item">
- <div class="amy-movie-serve-name">
- <span>
- <i class="fa fa-database"></i>
- <?php echo esc_attr($server['title']); ?>
- </span>
- </div>
- <?php if (!empty($server['parts'])) : ?>
- <?php $i = 0; ?>
- <div class="amy-movie-serve-options">
- <?php foreach ($server['parts'] as $part) : ?>
- <?php
- if ($i == 0 && $j == 0) {
- $classactive = 'active';
- } else {
- $classactive = '';
- }
- if (strpos($part['link'], 'youtube') == true) {
- $data_type = 'youtube';
- } else if (strpos($part['link'], 'vimeo.com') == true) {
- $data_type = 'vimeo';
- } else {
- $data_type = 'video';
- }
- ?>
- <span class="optinal-link amy-streaming-link <?php echo esc_attr($classactive); ?>" data-type="<?php echo esc_attr($data_type); ?>" data-source="<?php echo esc_url($part['link']); ?>">
- <?php echo esc_attr($part['title']); ?>
- </span>
- <?php $i++; ?>
- <?php endforeach; ?>
- </div>
- <?php endif; ?>
- </div>
- <?php $j++; ?>
- <?php endforeach; ?>
- </div>
- <?php endif; ?>
- <div class="amy-movie-list-info">
- <h3>
- <?php echo esc_html__('Movie Info', 'amy-movie'); ?>
- </h3>
- <?php get_template_part('movie/single/parts/info-list'); ?>
- </div>
- </div>
- </div>
- <div class="amy-movie-item-comments">
- <div class="container">
- <?php
- if (comments_open() || '0' != get_comments_number()) {
- comments_template('/comments.php', true);
- }
- ?>
- </div>
- </div>
- </div>
Add Comment
Please, Sign In to add comment