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 ? ..
Related
I am running a video on my website like this :
<iframe src="http://moshahda.net/embed-vf03v9oybt4s-640x348.html"></iframe>
I want to run same video on an Android app that does not depend on browser. I just want to run it in same Android app by using a video player.
The video player inside the app used the same links can run in iframe.
I can't do it because the links to the server do not specify the file format like mp4.
How can I fix it?
You can use the below code
String html = "<iframe width=\"400\" height=\"210\" style=\"border: 1px solid #cccccc;\" src=\"video link" ></iframe>";
after to this call the below method
webview.loadData(html, "text/html", null);
Refered from
http://developer.android.com/reference/android/webkit/WebView.html
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 am using
<object>
to embed a pdf file on my website. e.g.
<object data="abc.pdf" type="application/pdf">
<embed src="abc.pdf" type="application/pdf" />
</object>
It works on all desktop browser, but on my android device, it does not show anything. Besides using the google pdf viewer (since it down-grade dramatically the pdf quality), are there any way to support all ios / android device browser? Or, what is the best way to handle this situation? Since there are lots of browser , How can I redirect them to the browser's pdf plugin download page , or should I just tell them to get one ? (Less user friendly). Thanks
The best way is just too just add a link to the abc.pdf it will open on a new tab.
This would work best for mobile browser rather than embeding or implementing plugins.
ABC PDF file
One cross-platform solution I've found is ViewerJS.
Android-compatible embedding can be accomplished using an iFrame by providing both the URL to the ViewerJS project folder and the URL to the PDF to be embedded (relative to ViewerJS), separated by a hash:
<iframe src='../ViewerJS/#../../pdfs/pdf.pdf'></iframe>
Better to use Google's Gview. I was having the same problem in my project: PDF was opening separately in mobile browsers, whereas it was opening perfectly in web, so I changed it to use Google Doc Gview. Example is given below:
<iframe src="http://docs.google.com/gview?
url=d11xs62myk100c.cloudfront.net/Conference/262/Misc/marcos-ascensin-spanish-national-research-council-csic-spain.ppt&embedded=true'}"
frameborder="0" width="100%" height="1000">
</iframe>
you can check the compability of your mobile then download and save as .dox
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.