So I have a video player with the following source code.
<video width="320" height="240" controls>
<source src=<?php echo $tryOne; ?> type="video/mp4">
</video>
It will echo something something similar to below and insert it as the source video.
'176.227.210.66/Kuroko%20no%20Basket%202%20Episode%205.mp4?st=zEws3h1Xg-to07f3as6KqA&e=1385059955'
However, the player will not load the the video. If I open page source and copy the generate url into the address bar and hit enter, it will go to the direct url and load the video just fine. I think that the player won't load the url because it has GET variables in it, and I need to know how to fix this. Please tell me how I can load a video in a player from the above url with GET variables.
Note: the player will load a video just fine if it is named without the get variables.
As per the HTML specification for <video>, you need a valid URL:
src = non-empty URL potentially surrounded by spaces.
The URL for the video.
In this case, it is missing the protocol information (http://) and it is not being recognized as a video src. Change the value of $tryOne to include the protocol information or manually prepend it to the variable when outputting to the page. It might also be a good idea to URL-encode the string.
For example:
<video width="320" height="240" controls>
<source src=<?php echo 'http://'.urlencode($tryOne); ?> type="video/mp4">
</video>
Live demo.
Related
I have been reworking a web site to optimize for SEO. One thing I did is to optimize Images using Googles Webp Format. But Webp is not supported on any version of Safari.
My question is: What can I do to load one image (Webp) if supported or load another like JPG if not supported.
It could be great if it is something like the Audio or Video TAG
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio tag.
</audio>
Add your code like as below and it should most probably work.
<picture>
<source srcset="image.webp" type="image/webp">
<source srcset="image.jpg" type="image/jpeg">
<img src="image.jpg">
</picture>
More details are mentioned here in this link.
I assume you are using only 1 image in src (in img tag) if that fails to load then you are trying to loan any other image. So, You can use
<img src="invalid_link" onerror="this.onerror=null;this.src='other_image_url';">
Hope this helps.
<div class="grid-5-12">
<iframe width="200" height="120" src="http://www.saweb.info/videos/nightclub.mp4" frameborder="0"></iframe>
</div>
I copied above direct from an "admin page" from Firefox developer page source and it works as standalone, but on the admin page itself it doesn't appear (it always did)
It also doesn't show even without the div. (It's in a parsley form and the iframe show the "current selected video")
Tested in Chrome and it also doesn't display while I can't find any similar error on the internet.
Anyone perhaps has an idea why the iframe don't appear / disappeared please?
is not used for play videos but to display another page. Some browsers might support this way of importing a video. But correct way to use tag like this for your video link.
<video width="200" height="120" controls>
<source src="http://www.saweb.info/videos/nightclub.mp4" type="video/mp4">
</video>
in video tag src we are trying to give src as a ftp resource its not picking it up. Can somebody give some direction on that.
<video src='ftp://server/pqr.mp4' />
I suspect that's because to allow efficient usage, the browser makes HTTP range requests, which are part of HTTP, not FTP. FTP is a pretty old protocol, and isn't really appropriate here for lots of reasons (no range requests, basic/no caching info, etc).
something like this
<video width="320" height="240" controls="controls">
<source src="http://movie.mp4" type="video/mp4" />
<source src="http://movie.ogg" type="video/ogg" />
Your browser does not support the video tag.
</video>
The issue here is :
Loading an FTP sub-resource through an HTTP / S page is not allowed
This is for security issues, see https://bugzilla.mozilla.org/show_bug.cgi?id=1361848
Use this code:
<video width="320" height="240" controls="controls">
<source src="http://movie.mp4" type="video/mp4" />
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
So I have a HTML5 video player that works fine with a direct url as the source. However when I set the source as a url that links to a direct url, it won't work. Is there anyway to make it work? I am using PHP if that helps.
<video src="<?php echo $link; ?>" width="640" height="360" poster="testy/vplayer/media/poster.jpg" tabindex="0" controls="controls"></video>
The link is
http://redirector.googlevideo.com/videoplayback?id=ff1c9d4cf38db476&itag=18&source=picasa&cmo=sensitive_content=yes&ip=0.0.0.0&ipbits=0&expire=1387666335&sparams=id,itag,source,ip,ipbits,expire&signature=517DDFA9BB4265FC0E36CD19B7AEF96030DEF3BF.BDC3F29A59A031DC805381CDA22357227A7B4624&key=lh1