I already know the issue about videos not playing on webview. I found the video.js plugin from Simon Mac Donald.
I did all the process of installation, but now i don´t know where tu put the code.
window.plugins.videoPlayer.play("http://path.to.my/file.mp4");
In my page there is a button linked to a video.html where the video will be launched on full screen, play, stop and give a option to replay or to come back to the button´s page. For instance:
<li id="XY"><span>goods</span></li>
Thank you.
This code is written in javascript inside the script tag like below:
$("#video").live('click', function(){
alert('video sample');
window.plugins.videoPlayer.play("file:///sdcard/famous.3gp");
});
where #video is the id of the html element.
But in this also i am facing error alert which says "sorry, this video can not be played"
Not sure why.
Related
I have a html file on my Samsung android tablet that has a link like this:
Click to play local 0001_a1.mp4
When I click it I wanted it to open the video file that is in the sub directory /video beneath but only the link background changes like the link is being pressed but no video plays. If I remove the video file and press the link I get an error that it can't find the file. So I know that something is trying to happen. I have also tried
Click to play local 0001_a1.mp4
With the same results. Both work fine when on a Windows PC.
How can I load local videos using an html link on Android?
In mobile browsers you must call window.open inside onClick instead of set href attribute:
<a href="#" onclick="window.open('./video/0001_a1.mp4','_blank')">
Click to play local 0001_a1.mp4
</a>
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 the following piece of code :
<iframe width="420" height="345" src="http://www.youtube.com/embed/OZOX5sad2FE" frameborder="0" allowfullscreen></iframe>
It works good on desktop, but when opened on a android device, the following message appears:
Do you want to download the following file OZOX5sad2FE ?
YES/BLOCK
Clicking YES or BLOCK and the iframe is empty, there`s nothing there ..
What is going on ?
Desktop gonna work always (if its update).. But maybe your device is not compatible on browser with YTB.. Did u try to load youtube video on another website where is embedd code (iframe) from YTB ? ..
My app loads site into WebView and so far everything is working perfectly except for video.
When I try to load video directly into the URL nothing happens, and on LogCat it just says that the DNS query was forwarded, but doesn't return an error.
I don't see that there's a permission that I need for Media to add in the manifest so I don't know where to go next with this problem.. the videos load fine directly on the site, but not in app mode.
Please help with the next step to troubleshoot this issue
I realize there are a lot of YouTube in WebView questions but they don't seem to address my problem exactly.
I am loading a website with an embedded YouTube clip in a WebView, the problem is the YouTube preview image does not appear, I just get a black box with YouTube at the bottom.
This same website loads the preview image in the Android browser. The phone does not have Flash.
I understand it cant play the video without flash, I don't want it to play in the WebView, I just need the preview to load like it does in the regular browser.
I cant edit the website itself but it seems to be using this for the YouTube video.
<iframe allowfullscreen="" frameborder="0" height="271" src="http://www.youtube.com/embed/28L-hOJHwUw?rel=0&hd=1" width="475"></iframe></div>
I am enabling both Javascript and Plugins in my WebView.
webView = (WebView) findViewById(R.id.webviewplan);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setPluginsEnabled(true);
webView.getSettings().setBuiltInZoomControls(true);
Any help would be appreciated.
Thanks.
Edit:
Found out that it is throwing a js error so is anyone out there able to display a YouTube embed preview in a WebView without flash, Or is this simply not possible?
Error:
TypeError: Result of expression 'a' [undefined] is not an object. --
From line 342 of http://s.ytimg.com/yt/jsbin/www-embed_core_module-vflcoqCCO.js
The YouTube JS is probably either shutting things down because it does not detect Flash or having a an error. If it is having an error you can find out of these by setting a custom WebChromeClient and override its onConsoleMessage method. Pump this to your LogCat (do a JS alert) and you will know about errors at least.