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
Related
We have a file server on which we place PDF documents and then embed links to them in a smart device app. Up until recently, using links to the PDF documents starting with http:// worked fine for Android and iPhone users. All could load the PDF file just fine. Then a few months back (approximately) Android phone users started reporting they would get an error when trying to load any PDF. Yet iPhone users had no issues loading the same PDF document. It was verified that these PDF documents (several) were not corrupted and opened fine when placed on another file server.
I have an iPhone so I can't give you the exact error msg received by Android users but to reproduce it, it was along the lines of... click the link to the PDF, a button appears showing View PDF, click that button and several apps appear to choose the app to open the PDF with, click one (like Adobe Reader, or Google Drive) and an error appears stating the file could not be opened and may be corrupted of the wrong syntax.
Tonight I found the solution.
The url to the PDF on all these documents on our server had been like http://...
but when I changed it to https://... it works fine.
I can't find ANYWHERE any mention of a change by Google that this is now a requirement.
My question...
Can someone explain and/or point me to a reference that explains why https must be used in embedded links to PDF documents? It seems like a pretty big deal to make this a requirement and not tell anyone. My searching the internet has so far not turned up anything.
I have an App in which I want to display PDF files in a webview. I have managed to get the code up and running, but the problem is when I try to run my App, it displays this "no preview available" to me.
I am thinking the problem is with my PDF URL from firebase. Because another PDF URL loads just fine.
Does anyone know what's wrong? And how can I fix this.
Ok I just tried it myself, the problem is that with firebase the PDF gets downloaded rather than display by webview. Try storeing the PDF in the drive an use its url for webview. Hope it works.
I'm using Xamarin Forms with Android, I need to open a PDF from an URL in my WebView. For some reason, sometime the the Webview is blank. I've searched a lot on Internet and I found some solution that give me the same result, sometime the PDF in the PDF is showed without problem, sometime is a blank page. I'm using "https://drive.google.com/viewerng/viewer?embedded=true&url=" with no results, I'm using this solution ( https://acaliaro.wordpress.com/2017/11/30/open-a-pdf-inside-a-webview-in-xamarin-forms-android/ ) that describe exactly my problem but WebView still show me a blank page sometime.
So, why is so hard to open a PDF Url on Android in a WebView? There is some solution to fix this problem? I don't know what can i else do.
Android WebView not support .pdf file from website, infact, if you try to copy an url with .pdf extension in chrome browser, this will download the file and open in an app. So there is no way to show a PDF in an App in a simple way. But there are two solution:
On Google there are a lot solutions that tells you to download the PDF and show in an webview, but in my case I can't download a PDF and show.
You can write an .html page in your Server that can "wrap" the PDF sended with an URL in GET mode and show it in an .html page without problem ( using jsPDF is an example ) or by using this prefix ( http://drive.google.com/viewerng/viewer?embedded=true&url= ) but sometime i give a blank page, so i write my own pdf viewer. In this link ( https://acaliaro.wordpress.com/2017/11/30/open-a-pdf-inside-a-webview-in-xamarin-forms-android/ ) you can find another solution, but for some reason, it still doesn't works. Maybe because I'm on Android 5.0 device.
I have an app with a webpage called Avebury.html, and this has some javascript created by a colleague which loads a second HTML file inside it called widget. This has an iframe containing an embedded google map. Both are in the assets folder.
The problem is when trying to load Avebury.html in a webview it times out, and points to not being able to find the widget, when the link is correct.
I have tested linking straight to the widget and opening it in the webview, and it loads as it should. Both pages also work correctly in our iOS app and internet explorer.
The widget does take time to load, and I was wondering if the android webview is timing out the widget too soon, and if so is there a way to make it more lenient?
Thanks in advance.
I have found that android webview does not seam to like loading another HTML file from within the app in an iFrame. Removing the unneeded javascript and putting the iframe straight into the page bypassed the problem.
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.