gpt4 book ai didi

javascript - 视频无法在 intel xdk 中播放

转载 作者:行者123 更新时间:2023-11-28 07:17:51 25 4
gpt4 key购买 nike

我正在通过使用 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>

你能帮我看看问题出在哪里吗?

最佳答案

playPodcast() 函数仅在旧容器中受支持,该容器即将消失。这些 API 的 Cordova 版本不包含该方法,因此实际上不再可用。

关于javascript - 视频无法在 intel xdk 中播放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30659175/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com