When I code the src with an .aac I cannot get the audio player to work
'<audio controls ><source type="audio/aac" src="'.$mTheMediaLocation.'" ></audio>'
If I Build the data from a data string then It's fine..
<audio controls id="myAudio"><source src="data:audio/aac;base64,'.base64_encode($mTheMediaData).'"></audio>'
I want the src to be a file, I'm aware of browser support etc. BUT if the one works surely there is a way to get the other to work aswell ?
Related
I am using audio.js audio player in angularjs. but it is not working properly.
I have different audio Urls which are being passed through $scope to ng-src.when i click on any audio. it plays the audio. when i stop it and play the another audio. it still plays the previous audio. it seems that modal value is not getting cleared. everytime it will only play that audio which i have played first.
<audio ng-src="{{audioUrl}}" preload="false" id="callaudio" />
here audioUrl remians the very first url and doesn't get changed while clicking on other links.it still plays the same audio.
i chacked the value of audioUrl in console. it changed every time when i click on any link.
but in ng-src={{audioUrl}} it remains same.
kindly help me.I am breaking my head for last two days.
thanks
Try this
< audio>
<source src = "{{audio.Url}}"type = "{{audio.AudioType}}" >
< /audio>
I have something like this on page load:
echo "<td class='audio'><audio controls><source src></audio></td>";
I then make an ajax call based on click to pull relative audio URL's from an API I'm working with to be used as the src.
Upon visiting one of those audio URL's in a separate tab, the audio does in fact play. My thinking is that it's not playing where I need it to because it doesn't get a source until it needs it (used ajax to cut down on load time due to rather large API calls).
Any thoughts?
Your source tag is missing the filetype information. Even is src is replaced by src="your_path/your_file.mp3", it also needs for example type="audio/mpeg" for an mp3-file. The full generated HTML code would have to be something like
<audio controls>
<source src="your_path/your_file.mp3" type="audio/mpeg">
</audio>
This is work me,or may be you can remove the <source src=""> tag and add src="" inside of the <audio> tag
https://shty.ml?j2n7MxkhKm
When you enter this link then click the Preview button
full screen button in video tag missing when page containing video is loaded externally on another pages div
I have a page external.php . In this page when i use the following code
echo
'<video width="400" controls>
<source src="movie.mp4" type="video/mp4">
</video>';
i get a video with full screen button in it on chrome.But when i try to load this external.php on another page (home.php) div the video is coming but the full screen button is missing.But in IE there is no such problem.
You can either solve this via CSS OR Fullscreen API.
1. CSS
I think you can accomplish this by changing the css for the #document fragments, these are DOM1 specs and supported by all browsers, but about the styling, I'm not sure. The following solution is webkit specific.
You need just to write this code in your css:
video::-webkit-media-controls-fullscreen-button {}
2. Full screen API
If you want to accomplish it by Fullscreen API check below demo first:
Demo Full screen video
As you can see a very simple demo showing HTML5 video in full screen, make sure you're using Chrome dev, webkit or firefox nightly.
For more detail you can check it here.
Browsers may provide a user interface, but shouldn't provide a programmable one.
I am attempting to embed a sound file of Bohemian Rhapsody into my website and have found this code snippet:
echo "<embed src=\"SONGURL.mp3\" autostart=\"true\" loop=\"true\" hidden=\"true\"> </embed>\n" ."<noembed><bgsound src=\"SONGURL.mp3\" loop=\"infinite\"></noembed>";
My question is how to make this apply to the song I want? Also, what part of this would I modify?
Well it seems that the HTML snippet being produced by the PHP snippet in question relies on some sort of plug-in (my guess would be Flash, but I'm not familiar with Flash at all) so it would be much more complicated than a simple edit of the HTML string. If you're willing to break backwards compatibility with old browsers, you could use the HTML5 audio tag (see for example https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_HTML5_audio_and_video).
In your case, given some filename $song_url, you could accomplish what it seems you want via string-building as
$html_snippet = "<audio src=\"$song_url\" autoplay loop></audio>";
echo $html_snippet;
To support multiple different formats (for example .ogg files for Firefox users) you can simply write
$html_snippet = <<<EOD
<audio autoplay loop>
Upgrade to a newer browser!
<source src="$song_url_mp3" type="audio/mpeg">
<source src="$song_url_ogg" type="audio/ogg">
</audio>
EOD;
This HTML tag will ensure that your audio plays automatically and loops forever. To give users standard music controls, simply add a controls attribute.
I am trying to do the following; dynamically pick a server with the image on it, and then show said image in img src="". Yeah I know, I am horrible at explaining stuff like this but this should clear it up:
dl-main.php (on server0.domain.com)
$url = 'http://server2.domain.com/offerimage.php?f='.$_GET["f"];
header( 'Location: '.$url ) ;
offerimage.php (on server2.domain.com)
//Lots of link-protection stuff here
$f = "/".$_GET["f"];
$url = 'http://server2.domain.com'.$uri_prefix.$m.'/'.$t_hex.$f;
echo' <img src="'.$url.'"></img> ';
dl.php (on many other servers)
img src="http://server0.domain.com/dl-main.php?f=lalala.gif"
So it pretty much goes like this: Random person adds img src directing to dl-main.php?f=filename on server0. server0 then decides which server will provide the image. In the above example I am using only one server; server2
Now I simply want dl.php to show the photo hosted on server2.domain.com .
As it stands when I directly visit dl-main.php it succesfully redirects me to dl.php, which then succesfully shows me the image I requested. But when I use dl-main.php in a img src it doesn't show the image. I didn't expect it to work but it was worth a shot, but now I don't know what to do anymore :o
I hope this failed attempt is a good example of what I'm trying to accomplish here.
Thanks!
Here's the problem. You call image from server0 using:
<img src="http://server0.whatever/dl-main.php?f=thatimage.something" />
Where the dl-main.php code redirects to server2. Here, you do:
echo' <img src="'.$url.'"></img> ';
So basically the original img tag would get another img tag instead of the image data. That's why the browser can't render the image. You should echo the content of the image instead of an img tag.
Try using your browser's developer tools and check the request to server2 to verify my guess.
It can't work, your second script (offerimage) is producing text/plain, you should produce image/...in order to use img