问题描述
- android webWiew加载一个远程网页播放视频,请问如何播放手机SD卡里的视频?
-
webWiew 加载一个网页,怎么让这个网页上面的video控件播放我SD卡上的视频<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="viewport" content=""/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>FamilyAlbum</title> <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script> <style> * { margin:0px; padding:0px; } </style> </head> <body > <div style="height:100%;width:100%"> <div style="background:#0000FF";width="100%";height="5%"> <marquee><font color="#FFFFFF">马云今日也通过 微博回应了这一事件。</font></marquee> </div> <div style="height:100%;width:100%"> <video id="videoTag" src = "background1" height="90%" width="100%"> <source src="/mnt/extsd/back1.mp4" type="video/mp4" /> </video> </div> <div style="background:red"; width="100%"; height="5%"" > <font color="#FFFFFF"><marquee background="#ff0000">[财经快讯]中国央行发布了> </div> </div> <script language="javascript" type="text/javascript"> $("document").ready(function(){ var videos = document.getElementById('videoTag'); //alert("刚进来第一步,调用代码的方法"); timer() }); function timer(){ var videos = document.getElementById('videoTag'); videos.play(); setInterval("isend()",5000); } function isend() { //document.getElementById("demo").innerHTML="My First JavaScript Function"; var videos = document.getElementById('videoTag'); //alert(videos.ended); if(videos.ended){ //videos.autoplay='autoplay'; //videos.play(); // 播放完了就寻找下一个视频 getUrl(); } } function myFunction() { //document.getElementById("demo").innerHTML="My First JavaScript Function"; var videos = document.getElementById('videoTag'); videos.loop = true; videos.autoplay='autoplay'; videos.play(); } function videoPause() { //document.getElementById("demo").innerHTML="My First JavaScript Function"; var videos = document.getElementById('videoTag'); videos.loop = 'loop'; videos.pause(); } function updateSrc(str) { alert("第三步:"+str); //document.getElementById("demo").innerHTML="My First JavaScript Function"; var videos = document.getElementById('videoTag'); //videos.src = "back"; videos.autoplay='autoplay'; videos.play(); timer(); } function getUrl(){ alert("第二步:getUrl"); window.demo.clickOnAndroid(); } function getUrl1(str){ alert("第三步:"+str); var videos = document.getElementById('videoTag'); videos.src = "/mnt/extsd/back1.mp4" videos.autoplay='autoplay'; videos.play(); timer(); } </script> </body> </html>
解决方案
解决方案二:
有时候发现写代码都是互通的
时间: 2024-10-06 23:00:27