Skip to content
Snippets Groups Projects
Commit dd13e8a9 authored by Hesh Wanigasooriya's avatar Hesh Wanigasooriya
Browse files

#977146 by mattman Support for iOS devices

parent 4248794c
No related branches found
No related tags found
No related merge requests found
......@@ -5,21 +5,24 @@
* Provide the HTML output of the videojs audio player.
*/
?>
<!-- Begin VideoJS -->
<div class="video-js-box" id="<?php print $player_id; ?>">
<!-- Using the Video for Everybody Embed Code http://camendesign.com/code/video_for_everybody -->
<video id="<?php print $player_id; ?>" class="video-js" width="<?php print(variable_get('videojs_width', 640))?>" height="<?php print(variable_get('videojs_height', 264))?>" controls="controls" preload="auto" poster="">
<?php foreach ($items as $item):?>
<?php $filepath = file_create_url($item['filepath']); ?>
<?php if($item['filemime'] == 'video/mp4') ?>
<source src="<?=$filepath?>" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
<?php if($item['filemime'] == 'application/octet-stream') ?>
<source src="<?=$filepath?>" type='video/webm; codecs="vp8, vorbis"' />
<?php if($item['filemime'] == 'application/ogg' || $item['filemime'] == 'video/ogg') ?>
<source src="<?=$filepath?>" type='video/ogg; codecs="theora, vorbis"' />
<?php endforeach; ?>
<!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. -->
<!-- @TODO: Add Flowplayer on SWFTools or Flowplayer API modules -->
</video>
</div>
<!-- End VideoJS -->
\ No newline at end of file
<!-- Begin VideoJS -->
<div class="video-js-box" id="<?php print $player_id; ?>">
<!-- Using the Video for Everybody Embed Code http://camendesign.com/code/video_for_everybody -->
<video id="<?php print $player_id; ?>" class="video-js" width="<?php print(variable_get('videojs_width', 640)) ?>" height="<?php print(variable_get('videojs_height', 264)) ?>" controls="controls" preload="auto" poster="">
<?php //dd($items); ?>
<?php static $videojs_sources; ?>
<?php $codecs = array('video/mp4' => 'avc1.42E01E, mp4a.40.2', 'video/webm' => 'vp8, vorbis', 'video/ogg' => 'theora, vorbis', 'video/quicktime' => 'avc1.42E01E, mp4a.40.2'); ?>
<?php foreach ($items as $item): ?>
<?php $filepath = file_create_url($item['filepath']); ?>
<?php $mimetype = $item['filemime']; ?>
<?php if (array_key_exists($mimetype, $codecs)): ?>
<?php $mimetype = ($mimetype == 'video/quicktime') ? 'video/mp4' : $mimetype; ?>
<?php $videojs_sources .= "<source src=\"$filepath\" type='$mimetype; codecs=\"" . $codecs[$mimetype] . "\"' />"; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php print $videojs_sources; ?>
<!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. -->
<!-- @TODO: Add Flowplayer on SWFTools or Flowplayer API modules -->
</video>
</div>
<!-- End VideoJS -->
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment