How to insert an audio / mp3 using Cakephp?

1

I'm trying to view this:

 <?php echo $this->Html->media('musica.mp3'); ?>

but nothing appears

    
asked by anonymous 20.02.2015 / 02:57

1 answer

1

Following the documentation of that helper output would look like this:

<?php echo $this->Html->media('audio.mp3'); ?>

 // saida
 <audio src="/files/audio.mp3"></audio>

 <?php echo $this->Html->media('video.mp4', array(
     'fullBase' => true,
     'text' => 'Fallback text'
 )); ?>

 // saida
 <video src="http://www.somehost.com/files/video.mp4">Fallbacktext</video><?phpecho$this->Html->media(array('video.mp4',array('src'=>'video.ogg','type'=>"video/ogg; codecs='theora, vorbis'"
         )
     ),
     array('autoplay')
 ); ?>

 // saida
 <video autoplay="autoplay">
     <source src="/files/video.mp4" type="video/mp4"/>
     <source src="/files/video.ogg" type="video/ogg; codecs='theora, vorbis'"/>
 </video>

There is a possibility that your browser is not rendering, look inside the html to see if it is printing any tags.

    
20.02.2015 / 05:13