javascript - Play Local Video on PhoneGap/Cordova in Windows Apps -
i'm developing windows/windows phone 8.1 apps using phonegap(html, js, css, jqm) , native/windows runtime component. want play video in html page. video file located inside application folder. don't know what's wrong. please me.
in html, have added:
<div id="content"> <button onclick="domainobject.playvideo()" type="button" data-theme="b">play video</button> <video id="video" src='' type='video/mp4' width="400" autoplay="autoplay" controls></video> </div>
and in js:
var domainobject = { playvideo: function () { var vidpath = windows.storage.applicationdata.current.localfolder.path + "\\test.mp4"; var video = document.getelementbyid('video'); var source = document.createelement('source'); source.setattribute('src', vidpath); video.appendchild(source); video.load(); video.play(); }
Comments
Post a Comment