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.
Related
I am working on a mobile app, using Ionic framework and I want to play video in a mobile app. I have a list of video's and I am using video tag for playing the video.
ng-src with full path works fine.
But following block of code doesn't work. I have a list of video's and i can't use hardcoded data, I am allowing user to select the video.
<video controls>
<source ng-src="{{src}}">
How can I resolve above problem or any alternate method for the same.
I solved the issue. URL loading was blocked.
I fixed it using $sce service
ng-src="{{trustSrc(videos.link)}}"
I have a phonegap app and I'm trying to play mp3's which are stores in the app's folder like this:
--App Root
-- audio
-- mp3s
--Mp3's are all here
Now, the problem is only with Android because it works fine in IOS. On android I'm getting the audio player but no sound is coming out.
Here is the code:
//JS
var
audiofile = 'audio/mp3s/'+result.text+'en.mp3';
//HTML
<audio class="audioPlayer" controls>
<source src="'+audiofile+'" type="audio/mpeg">
</audio>
How can I fix this?
On android you may need to prefix the path to the file with "/android_asset"
So use "/android_asset/audio/mp3s/" as the base directory.
Try to debug the app with chrome Inspect Devices (DevTools little menu), and see if there are any errors.
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>
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" />