Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * The player template file
- *
- */
- $source = streamtube_core()->get()->post->get_source();
- if( wp_attachment_is( 'video', $source ) ){
- $source = wp_get_attachment_url( $source );
- $mime_type = get_post_mime_type( $source );
- // If source is HLS, you have to set the mime_type to 'application/x-mpegurl' manually.
- ?>
- <div class="video-js vjs-16-9 theoplayer-container theoplayer-skin" style="max-width: unset;"></div>
- <script>
- var element = document.querySelector('.theoplayer-container');
- var player = new THEOplayer.Player(element, {
- libraryLocation : '/path/to/libraryLocation/'
- });
- player.source = {
- sources : [{
- src : '<?php echo $source; ?>',
- type : '<?php echo $mime_type; ?>'
- }]
- };
- </script>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement