Silverlight 播放器的视频事件 - Google Chrome 扩展 (JavaScript)
有没有办法在 google chrome 扩展中跟踪 silverlight 在线播放器的停止、播放、暂停等事件?我可以使用 document.getElementById("silverlightObject")
获取 vidoe 元素,但我对此对象的事件一无所知。我设法通过 YouTube 做到了这一点 - 它有 player.getPlayerState()
方法。也许silverlight播放器有类似的方法?有人可以帮忙吗?
(示例)这是我感兴趣的网站: http://www.tvp.pl/vod
这是来自该网站的免费视频示例: http://www.tvp.pl/vod/seriale/obyczajowe/czas-honoru/sezon-4-odcinki-40-/iv-seria-odc46-znak-rosenfarba/5423075
Is there a way to track events like stop, play, pause of silverlight online player in google chrome extension? I can get the vidoe element with document.getElementById("silverlightObject")
but i don't know anything about events of this object. I managed to do it with YouTube- it has player.getPlayerState()
method. Maybe there is similar way for silverlight player? Anyone can help?
(example) this is website of my interet:
http://www.tvp.pl/vod
this is free video example from this website:
http://www.tvp.pl/vod/seriale/obyczajowe/czas-honoru/sezon-4-odcinki-40-/iv-seria-odc46-znak-rosenfarba/5423075
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
除非 Silverlight 应用程序的作者显式公开属性或方法,否则我不知道如何探测其中任何
MediaElement
的状态。有一种方法可以以这种方式公开属性,但听起来您正在使用其他人的应用程序而无法访问其源代码。如果您确实有权访问 Silverlight 播放器的源代码,则可以使用
ScriptableMember
属性和HtmlPage.RegisterScriptableObject()
公开属性,例如:请参阅 演练:调用托管代码来自 JavaScript 了解更多详细信息。
Unless the author of the Silverlight app explicitly exposes a property or method, I don't know of a way to probe the state of any
MediaElement
inside it. There is a way to expose a property in that way, but it sounds like you are using someone else's app without access to their source.If you do have access to the source of the Silverlight player, you can expose a property using the
ScriptableMember
attribute andHtmlPage.RegisterScriptableObject()
, e.g.:See Walkthrough: Calling Managed Code from JavaScript for more details.