Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: HLSPlayer
- Plugin URI:
- Description: An HLS based Web Player.
- Version: 1.0
- Author: arumford
- */
- function hlsplayer($atts){
- wp_enqueue_script('hls', 'hls.js');
- wp_enqueue_script('hlsplayer', 'hlsplayer.js');
- // Attributes
- $atts = shortcode_atts(
- array(
- 'title' => '',
- 'primary' => '',
- 'backup' => '',
- ),
- $atts,
- 'hlsplayer'
- );
- echo '<script type="text/javascript">
- VideoPlayer(\'video1\', ' . $atts['primary'] . ',
- '. $atts['backup'] .');
- </script>';
- echo '<p>
- <label>'. $atts['title'] .'</label>
- <video style="margin-top: 5px;" id="video1" controls class="videoCentered" poster="LearfieldIMGCollege_RGB.png"></video>
- </p>';
- }
- add_action('wp_enqueue_scripts', 'hlsplayer');
- add_action('wp_enqueue_scripts', 'hls');
- add_shortcode( 'hlsplayer', 'hlsplayer' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement