I have a html file on my Samsung android tablet that has a link like this:


<a href="./video/0001_a1.mp4" target="_blank">Click to play local 
0001_a1.mp4</a>


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


<a href="video/0001_a1.mp4" target="_blank">Click to play local 0001_a1.mp4</a>


With the same results. Both work fine when on a Windows PC.

How can I load local videos using an html link on Android?


A guy on Stack Overflow 
<http://stackoverflow.com/questions/39399172/loading-an-mp4-video-from-an-html-link-on-android>
 
suggested...


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>

But that only results in refreshing the same page to the top of the page... not 
showing the video in a new window.  Surely this is not a new thing that I am 
trying to do.  Any suggestions??

My first thought was to bypass the built in HTMLViewer and install the Chrome 
browser to open the file.  But I could not find a way to change settings so 
html files get opened by Chrome instead of HTMLViewer.

Thanks!

Bob

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/a6e6d134-4142-4b8b-afa9-dfc9fead5e2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to