jw_player.tpl.php in JW Player 7
Same filename and directory in other branches
Display the JW Player.
Variables available:
- $html_id: Unique id generated for each video.
- $width: Width of the video player.
- $height: Height of the video player.
- $sources: An array of files to be played.
- $jw_player_inline_js_code: JSON data with configuration settings for the video player.
- $image: URL to an image to be used for the poster (ie. preview image) for this video.
See also
1 theme call to jw_player.tpl.php
- jw_player_field_formatter_view in ./
jw_player.module - Implements hook_field_formatter_view().
File
theme/jw_player.tpl.phpView source
<?php
/**
* @file
* Display the JW Player.
*
* Variables available:
* - $html_id: Unique id generated for each video.
* - $width: Width of the video player.
* - $height: Height of the video player.
* - $sources: An array of files to be played.
* - $jw_player_inline_js_code: JSON data with configuration settings for the video player.
* - $image: URL to an image to be used for the poster (ie. preview image) for this video.
*
* @see template_preprocess_jw_player()
*/
?>
<div class="jwplayer-video">
<video id="<?php
print $html_id;
?>" width="<?php
print $width;
?>" height="<?php
print $height;
?>" controls="controls" preload="none"<?php
if (isset($image)) {
?> poster="<?php
print $image;
?>"<?php
}
?>>
<?php
foreach ($sources as $source) {
?>
<source src="<?php
print $source['file_path'];
?>"<?php
if (isset($source['file_mime'])) {
?> type="<?php
print $source['file_mime'];
?>"<?php
}
?> />
<?php
}
?>
</video>
</div>
<?php
if (isset($jw_player_inline_js_code)) {
?>
<script type="text/javascript">
jwplayer('<?php
print $html_id;
?>').setup(<?php
print $jw_player_inline_js_code;
?>);
</script>
<?php
}