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" />
Related
I have the following video HTML:
<video id="player_a" class="video-js" controls preload="auto" title="Home video" width="640" poster="~/Assets/img/video_poster_full.jpg" data-setup="{}">
<source src="https://#####.blob.core.windows.net/video/homepage-video.mp4" type="video/mp4">
<source src="https://#####.blob.core.windows.net/video/homepage-video.webm" type="video/webm">
<source src="https://#####.blob.core.windows.net/video/homepage-video.ogv" type="video/ogg" />
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a web browser that
supports HTML5 video
</p>
</video>
On Android, this video does not play from the webpage. But as soon as I change my video host from the Azure Blob to my own private server (http://myserver.net/images/homepage-video.mp4), it streams fine.
I notice that if I just go directly to the URL of the .mp4, it does not load from Blob (but does from my private server). I also notice that the .webm does load okay from Blob but for some reason, my video is not falling back to that format.
Are there any settings I need to change in Azure Blob to allow .mp4 to be streamed differently? Or what am I doing wrong that is not causing the video to fall back to .webm?
The permissions on your blob will need to be public to make sure that you can access the content without a key. You can check this in the properties of the container.
In the documentation you can find an excellent post on how to set these permissions up.
I am new to cordova phonegap, i want to browse the video from sdcard and play the video in android. I have tried by hard coding the file uri,
<video id="1" width="100%" >
<source src="file:///storage/0/emulated/videos/video3.mp4" type="video/mp4" />
</video>
it is not working.
Please help me.
Did you try to call
var myVideo = document.getElementById("1");
myVideo.load();
in your script?
How can I play videos from a raw folder in an .htm file on android?
Neither of these code snippets work for me:
<video id="video" controls>
<source src="android.resource://tutorials.bodybuilding/raw/smit.mp4" type="video/mp4">
</video>
or
<video id="video" controls>
<source src="url('android.resource://tutorials.bodybuilding/raw/smit.mp4')" type="video/mp4">
</video>
According to reading file in assets or raw folder in Android I guess your addresses are wrong. You should consider what
Uri.parse("android.resource://tutorials.bodybuilding/" + R.raw.csgsmit);
returns for every of your videos and place it into html OR at runtime load html into a String and replace every address using such method and then load modified html using Webview.loadData() or Webview.loadDataWithBaseUrl() passing a modified html (a resluting String).
I open a website URL in Android WebView inside an application. One of the web pages contains links to Images and Audio files on server. Server in response reads the file requested and writes the content to Response stream and sets appropriate Content-Type. The images is opening perfectly but audio is not playing, it just flashes a window with the URL and just goes away immediately. I am using Java Script window.open() for this purpose.
When I access the website directly in Android browser, its playing the sound by opening native music player application. I am wondering why the same is not working inside WebView.
Do anybody have idea about such kind of problem? If you have further query on the same, I will provide. Please share your experience.
Thanks!
This is a bug inside the webview. you can use video tag replaced to audio tag as an example:
<video width="320" height="240" controls>
<source src="audio.mp3" type="video/mp4">
</video>
I'm using PhoneGap / Cordova 1.5.0, this is my HTML page:
<html>
<head></head>
<body>
<iframe src="http://player.vimeo.com/video/38799240?title=0&byline=0&portrait=0" width="400" height="225" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</body>
</html>
Using a Motorola Droid 2 with Android OS 2.3.3 installed, if I pull this HTML page up in a normal browser I can play the video as expected.
But, if I make that HTML my index.html page in a PhoneGap project I can see the video thumbnail and the play button, but tapping on it only turns the play button to a spinner for a second, and the video doesn't play.
I found a few posts that make it sound like it's an access origin issue, some said you can use a wildcard like *, others said it's like a perl regex, so you use a regex wildstar, ie: .*, I tried many versions in my res/xml/cordova.xml file like:
<access origin="http://127.0.0.1*"/>
<access origin="http://player.vimeo.com*"/>
<access origin="http://*.vimeocdn.com*" />
<access origin="http://*.vimeo.com*" />
<access origin="http://vimeo.com*" />
Which doesn't seem to have an effect.
I haven't tested this in an iPhone PhoneGap environment yet.
Thanks!
you can't include external video (vimeo/youtube) in phonegap like that.
you need to be pointing to the actual video or simply open the video you already have in childbrowser (using an image with a videostill as trigger would be nice).
I am able to play Vimeo videos using iFrame tag in my iOS app which is also phonegap based. I am using Phonegap 3.2.0 here. Below is the code I am using
NSString* embedHTML = #"<html><head>\
<style type=\"text/css\">\body {\background-color: #000000;\
color: white;}</style></head><body style=\"margin:0\">\
<iframe width=\"512\" height=\"374\" src=\"http://player.vimeo.com/video/60331941\" frameborder=\"0\" allowfullscreen></iframe></body></html>";
NSString* html = [NSString stringWithFormat:embedHTML, urlVideo];
[customWebView loadHTMLString:html baseURL:nil];
I have whitelisted below urls in my config.xml file.
<access origin="*.vimeo.com" />
<access origin="*.vimeocdn.com" />
I have written this code inside a phonegap plugin class. So, I am able to write objective-C code here. But the same could be done in html file also.
Hope it helps in some way !!