HTML5视频标签没有起到.MP4在PhoneGap的Andr​​oid影片与科尔多瓦2.9.0和jquery1.9.0?科尔、影片、多瓦、标签

2023-09-06 09:53:40 作者:孤城旧巷

我试图发挥我的项目路径已经添加的本地视频文件:资产/ WWW /视频/ xyz.mp4 现在使用的标签,但得到警报:

i am trying to play local video files already added in my project path : ASSETS/WWW/VIDEOS/xyz.mp4 now using tag but getting alert:

我已经添加了code中的 HTML

i have added code in HTML:

<!DOCTYPE html>
   <html>
    <head>
    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <body>
    <div data-role="page" data-theme="a" class="my-page" id="video">
                <video id="video_player" src="#" controls="controls"></video>
           </div>
    </body>
</html>
**in js:**


 $(document).on('pagebeforeshow',"#video", function () {
            xyz = document.getElementById('video_player');
            alert("values xyz:" + xyz);
            xyz.src = data[curYear].video.url;
           alert("xyz after src:" +  xyz.src);
            xyz.play();
            });

推荐答案

试试这个..

<video class="video" poster="/assets/video/posters/example.jpg" controls width="768" height="432" preload="none">
    <source src="/assets/video/example.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
    <source src="/assets/video/example.ogv" type='video/ogg; codecs="theora, vorbis"' />
</video>
 
精彩推荐