用于启动/停止媒体的iBooks小部件方法?

时间:2014-02-25 01:59:41

标签: html5 widget ibooks

我有一个用于iBooks的HTML5小部件,用于嵌入来自外部网站的视频。

<html>
    <head></head>
    <body>
      <iframe id="videoLoadsHere" src="http://www.embeddedvideo.blah">
      </iframe>
    </body>
</html>

我有两个问题:

1)iframe保持空白,没有互联网连接。有没有办法从窗口小部件中访问有关连接的本机设备信息(如Phonegap,但不必导入大量额外的代码?)

2)关闭小部件后视频继续播放需要手动停止(除非你移动2页)。我希望它能够停止播放和播放当窗口小部件被关闭时重置,但似乎没有任何方法可以拦截该用户操作。如何判断小部件何时打开/关闭?

我已尝试在HTML <head>代码

中导入AppleWidget.js
<script type="text/javascript" src="AppleClasses/AppleWidget.js"> </script>

然后在head标签内处理方法:

    widget.pauseAudioVisual = function() {

         //allegedly called when the widget is dismissed, 
but this is not the case as far as I can tell

    }

widget.didEnterWidgetMode = function(){

         //allegedly called not when first opening a widget, 
         but when re-opening it as a way to resume or reload.

} 

这些方法似乎都没有被调用,并且无法从iBooks中提醒/记录任何内容。

我完全复制了这个家伙的实验,但它没有用。 https://github.com/miguel/iBooks-Author-widget-events/blob/master/we.wdgt/main.html

我无法找到任何其他特定于iBooks或任何其他“小部件”方法的文档。 Apple的文档都涉及Dashcode&amp;桌面小部件,似乎并不适用。

任何人都有关于如何在HTML5小部件和iBook之间进行通信的任何参考?有API吗?一些window.widget对象有已知方法吗?

谢谢!

0 个答案:

没有答案
相关问题