pcwriter

streaming.php

Feb 25th, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.06 KB | None | 0 0
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 AmyTheme (http://www.amytheme.com). All rights reserved.
  4. * @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
  5. */
  6.  
  7. defined('ABSPATH') or die;
  8.  
  9. global $post;
  10.  
  11. $streaming = get_post_meta($post->ID, '_movie_streaming', true);
  12.  
  13. wp_enqueue_style( 'wp-mediaelement' );
  14. wp_enqueue_script('wp-mediaelement');
  15. ?>
  16.  
  17. <div class="movie-steaming">
  18. <div class="amy-movie-item-play">
  19. <div class="container">
  20. <div class="box-player" id="amyStream">
  21. <?php
  22. $video_link = '';
  23. $video_type = '';
  24.  
  25. if (!empty($streaming['servers'])) {
  26. $s = $streaming['servers'][1];
  27. $p = $s['parts'];
  28. $x = reset($p);
  29. $video_link = $x['link'];
  30.  
  31. if (strpos($video_link, 'youtube') == true) {
  32. $video_type = 'youtube';
  33. } else if (strpos($video_link, 'vimeo') == true) {
  34. $video_type = 'vimeo';
  35. } else {
  36. $video_type = 'video';
  37. }
  38. }
  39.  
  40. ?>
  41.  
  42.  
  43.  
  44. <?php if (strpos($video_link, 'youtube') == true || strpos($video_link, 'vimeo') == true) : ?>
  45. <video id='amyplayer' data-source='<?php echo ($video_link); ?>' data-type='<?php echo ($video_type); ?>' data-poster='' controls playsinline></video>
  46. <?php else : ?>
  47. <div class="amy-iframe">
  48. <iframe src="<?php echo ($video_link); ?>" allowfullscreen></iframe>
  49. </div>
  50. <?php endif; ?>
  51.  
  52.  
  53.  
  54. </div>
  55. <div class="div-control">
  56. <span class="btn-action btn_lightbulb" title="<?php echo esc_html__('Turn off the light', 'moviezone'); ?>">
  57. <i class="fa fa-lightbulb-o"></i>
  58. <span class="turn-off"><?php echo esc_html__('Turn off the light', 'moviezone'); ?></span>
  59. <span class="turn-on"><?php echo esc_html__('Turn on the light', 'moviezone'); ?></span>
  60. </span>
  61. </div>
  62. </div>
  63. </div>
  64.  
  65. <div class="amy-movie-item-content-header">
  66. <div class="container">
  67. <header class="amy-movie-item-header">
  68. <div class="amy-movie-item-header-left">
  69. <?php get_template_part('movie/single/parts/title'); ?>
  70. </div>
  71. <div class="amy-movie-item-header-right">
  72. <?php get_template_part('movie/single/parts/social'); ?>
  73. </div>
  74. </header>
  75. <?php if (!empty($streaming['servers'])) : ?>
  76. <div class="amy-movie-list-server">
  77. <?php $j = 0; ?>
  78. <?php foreach ($streaming['servers'] as $server) : ?>
  79. <div class="amy-movie-serve-item">
  80. <div class="amy-movie-serve-name">
  81. <span>
  82. <i class="fa fa-database"></i>
  83. <?php echo esc_attr($server['title']); ?>
  84. </span>
  85. </div>
  86. <?php if (!empty($server['parts'])) : ?>
  87. <?php $i = 0; ?>
  88. <div class="amy-movie-serve-options">
  89. <?php foreach ($server['parts'] as $part) : ?>
  90. <?php
  91. if ($i == 0 && $j == 0) {
  92. $classactive = 'active';
  93. } else {
  94. $classactive = '';
  95. }
  96.  
  97. if (strpos($part['link'], 'youtube') == true) {
  98. $data_type = 'youtube';
  99. } else if (strpos($part['link'], 'vimeo.com') == true) {
  100. $data_type = 'vimeo';
  101. } else {
  102. $data_type = 'video';
  103. }
  104. ?>
  105. <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']); ?>">
  106. <?php echo esc_attr($part['title']); ?>
  107. </span>
  108.  
  109. <?php $i++; ?>
  110. <?php endforeach; ?>
  111. </div>
  112. <?php endif; ?>
  113. </div>
  114. <?php $j++; ?>
  115. <?php endforeach; ?>
  116. </div>
  117. <?php endif; ?>
  118. <div class="amy-movie-list-info">
  119. <h3>
  120. <?php echo esc_html__('Movie Info', 'amy-movie'); ?>
  121. </h3>
  122. <?php get_template_part('movie/single/parts/info-list'); ?>
  123. </div>
  124.  
  125. </div>
  126. </div>
  127.  
  128. <div class="amy-movie-item-comments">
  129. <div class="container">
  130. <?php
  131. if (comments_open() || '0' != get_comments_number()) {
  132. comments_template('/comments.php', true);
  133. }
  134. ?>
  135. </div>
  136. </div>
  137. </div>
Add Comment
Please, Sign In to add comment