Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
137 views
in Technique[技术] by (71.8m points)

javascript - HTML5 video doesnt play with android

I have got the following html code:

<span id="video-teaser">
    <span>Click here for a <strong>FREE</strong> hot video</span>
    <video src="http://example.com/videos/nakednews.mp4" controls="" poster="http://example.com//img/iphone-video-btn.png" id="videoTeaser" height="1"></video>
</span>

I tried to come up with two solutions.. use javascript addlistener..and trigger the video when it is pressed.

     <script type="text/javascript">
            var video = document.getElementById('videoTeaser');
            var elementToTrigger=document.getElementById('video-teaser');
                    elementToTrigger.addEventListener('click',function(){
                    video.play();
                    },false);
      </script>

Both of the solutions dont work.. the video itself works when I click on the video-teaser span, on the pc version of the site..

What could be the solution to this..

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

try the code given at svn link at http://code.google.com/p/html5webview/source/checkout it works fine


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...