video.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php $this->layout( 'layout', [
  2. 'body_class' => 'video-page',
  3. 'info' => $info,
  4. 'config' => $config,
  5. ] ) ?>
  6. <?php if ( ! $error ) : ?>
  7. <?php
  8. if ( count( $info['formats'] ) ) :
  9. $player_format = $info['formats'][0];
  10. if ( ! $player_format['is_audio_only'] ) : // Video player
  11. ?>
  12. <div class="player-container">
  13. <video width="<?=$player_format['width']?>" height="<?=$player_format['height']?>" controls="controls">
  14. <source src="<?=$player_format['url']?>" type="<?=$player_format['mimetype_type']?>">
  15. Your browser does not support the video tag. Please use a modern browser.
  16. </video>
  17. </div>
  18. <?php
  19. endif;
  20. endif;
  21. ?>
  22. <div id="test" class="video-key-info section">
  23. <h2><?=$this->e( $info['title'] )?></h2>
  24. <div class="view-count"><?=$this->e( $info['views'] )?> Views</div>
  25. <div class="channel-profile"><a class="channel-name" href="<?=$this->e( $info['channel_url'] )?>"><?=$this->e( $info['author'] )?></a></div>
  26. <div class="post-time"><?=$this->e( $info['publish_date_friendly'] )?></div>
  27. </div>
  28. <p class="short-description section"><?=nl2br( $info['short_description'] )?></p>
  29. <details class="video-details section">
  30. <summary>Video Details</summary>
  31. <p>Views: <?=$this->e( $info['views'] )?></p>
  32. <p>Keywords: <?php echo $this->e( implode( $info['keywords'], ', ' ) ); ?></p>
  33. <p>Channel ID: <?php echo $this->e( $info['channelId'] ); ?></p>
  34. <p>Average Rating: <?=$this->e( $info['averageRating'] )?></p>
  35. <p>Unlisted? <?php echo ( $info['isUnlisted'] ) ? 'Yes' : 'No'; ?></p>
  36. <p>Category: <?=$this->e( $info['category'] )?></p>
  37. <p>Published: <?=$this->e( $info['publish_date_friendly'] )?> (<?=$this->e( $info['publish_date'] )?>)</p>
  38. <p>Formats available: <?php echo $this->e( count( $info['formats'] ) ); ?></p>
  39. </details>
  40. <?php else : ?>
  41. <div class="error msg">Error: <?=$this->e($error)?></div>
  42. <?php endif; ?>