【发布时间】:2016-05-06 16:36:52
【问题描述】:
我正在通过使用 intel xdk 和 jquery mobile 为 UI 开发混合应用程序,我试图在我的 intel xdk 项目中播放视频但它没有播放,我指的是这个示例 http://qnimate.com/playing-videos-in-intel-xdk-app/ 如果我点击播放按钮什么都不会即使我在我的项目中添加了播放器插件也会发生
我正在使用此代码
<!DOCTYPE html>
<html>
<head>
<title>Video Player</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<style>
@-ms-viewport { width: 100vw ; zoom: 100% ; }
@viewport { width: 100vw ; zoom: 100% ; }
@-ms-viewport { user-zoom: fixed ; }
@viewport { user-zoom: fixed ; }
</style>
<script src="lib/ft/fastclick.js"></script>
<link rel="stylesheet" href="css/app.css">
</head>
<body>
<button onclick="playVideo();">Play Video</button>
<script src="intelxdk.js"></script>
<script src="cordova.js"></script>
<script src="xhr.js"></script>
<script src="js/app.js"></script>
<script src="js/init-app.js"></script>
<script src="js/init-dev.js"></script>
<script>
function playVideo()
{
//this function launches default video player and plays the video.mp4 file.
intel.xdk.player.playPodcast("http://labs.qnimate.com/video.mp4");
}
document.addEventListener("intel.xdk.player.podcast.start", function(){
//started playing video
alert("start");
}, false);
document.addEventListener("intel.xdk.player.podcast.stop", function(){
//video finished or player closed
alert("stop");
}, false);
document.addEventListener("intel.xdk.player.podcast.error", function(){
//error occured therefore video cannot be played
alert("error");
}, false);
document.addEventListener("intel.xdk.player.podcast.busy", function(){
//another video is already being played
alert("busy");
}, false);
</script>
</body>
</html>
你能帮我解决什么问题吗?
【问题讨论】:
-
您是否在项目中包含必要的插件?
-
@xmnboy 我在我的项目中添加了播放器插件,我们还需要包含什么?
-
我做了一个调试跟踪,它似乎正在进入插件并调用正确的东西,但我无法快速调试本机代码。我的猜测是插件可能有问题。我请负责的工程师看看。
标签: javascript intel-xdk