我是adobe air的新手,并试图将这个(http://flowplayer.electroteque.org/securedrm)插件集成到adobe air应用程序中。但是在AactionScript3中使用HTMLLoader似乎没有播放视频。但是,我可以使用相同的代码播放任何与drm相关的内容。
这就是我做过的事。
我的动作脚本包含此内容。
var request:URLRequest = new URLRequest("http://localhost:8888/index.html");
var bounds:Rectangle = new Rectangle(0, 0, 800, 600);
var options:NativeWindowInitOptions = new NativeWindowInitOptions();
options.systemChrome = NativeWindowSystemChrome.STANDARD;
options.type = NativeWindowType.NORMAL;
options.transparent = false;
options.resizable = true;
options.maximizable = false;
var htmlload:HTMLLoader = HTMLLoader.createRootWindow(true, options, true, bounds);
htmlload.stage.nativeWindow.notifyUser(NotificationType.INFORMATIONAL);
//htmlload.stage.nativeWindow.addEventListener(Event.CLOSING, onHTMLPageClose);
//htmlload.addEventListener(HTMLUncaughtScriptExceptionEvent.UNCAUGHT_SCRIPT_EXCEPTION, scriptError);
htmlload.stage.nativeWindow.x = stage.nativeWindow.x;
htmlload.stage.nativeWindow.y = stage.nativeWindow.y;
htmlload.stage.nativeWindow.activate();
try {
htmlload.load(request);
}
catch (e:Error) {
trace("navigate failed");
}
这就是我的index.html的样子;
<html>
<script src="http://static.electroteque.org/js/jwplayer.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<div id="drmIdentPlayer">
</div>
<script>
jwplayer("drmIdentPlayer").setup({
flashplayer: "http://static.electroteque.org/swf/jwplayer.flash.swf",
width: 660,
height: 350,
primary: "flash",
playlist: [
{
file: "mp4:BigBuckBunnyAuth.mp4",
provider: "http://static.electroteque.org/swf/drmrtmp-provider.swf",
streamer: "rtmp://rtmp.electroteque.org/cfx/st",
}
],
plugins: {
"http://static.electroteque.org/swf/securedrm-2.0.swf": {
displayNotifications: true,
checkVersion: true
}
}
});
</script>
</html>
也尝试过使用flowplayer,但结果相同,这是我的HTML;
<!doctype html>
<!--[if lt IE 7]>
<html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]>
<html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]>
<html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en"> <!--<![endif]-->
<head>
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
<script src="http://releases.flowplayer.org/js/flowplayer-3.2.12.min.js"></script>
<script src="http://flowplayer.electroteque.org/js/flowplayer.securedrm-3.6.js"></script>
</head>
<body>
<a id="drmplayer" style="display:block;width:660px;height:350px;"></a>
<script>
flowplayer("drmplayer",{src:"http://releases.flowplayer.org/swf/flowplayer-3.2.16.swf",version: [10, 2]}, {
plugins: {
drm: { url: "http://static.electroteque.org/swf/flowplayer.securedrm-3.2.7.swf" },
// the "tube" skin
controls: { url: "http://releases.flowplayer.org/swf/flowplayer.controls-tube-3.2.15.swf"}
},
clip: {
url: "BigBuckBunnyAuth.f4v",
accelerated: false,
autoPlay: false,
baseUrl: "http://videos.electroteque.org"
},
log: {
level: 'debug',
filter: 'org.flowplayer.rtmp.*, org.flowplayer.securedrm.*,org.flowplayer.controller.*'
}
});
</script>
</body>
</html>
基本上我可以在我的本地tomcat上玩(在FireFox / Chrome上)。但同样的问题并没有在Adobe AIR上播放,我相信AIR使用的是Safari Web浏览器使用的相同WebKit渲染引擎。此外,如果我使用非drm保护的内容,它将播放。