在 Firefox 显示的网页中使用脚本

[与此页面关联的功能(Windows 媒体播放器 SDK)是旧版功能。 它已被 MediaPlayer 取代。 MediaPlayer 已针对Windows 10和Windows 11进行了优化。 如果可能,Microsoft 强烈建议新代码使用 MediaPlayer 而不是 Windows 媒体播放器 SDK。 如果可能,Microsoft 建议重写使用旧 API 的现有代码以使用新 API。]

当用户与页面交互时,网页上的脚本可以使用 Player 对象模型来控制 Player。 例如,以下 INPUT 元素具有设置 Player 音量的脚本。

<INPUT type="button" value="Vol" OnClick="ChangeVolume()"/>
 
<SCRIPT>
  function ChangeVolume()
  {
    Player.settings.volume = 90;
  }
</SCRIPT>

internet Explorer 和 Firefox 插件支持Windows 媒体播放器对象模型中的许多对象。 但是,Firefox 插件不支持某些对象。 下表列出了 Player 对象模型中的所有对象,并显示了 Firefox 插件支持哪些对象。

对象 Firefox 支持
Cdrom
CdromCollection
ClosedCaption
控件
Dvd
错误
ErrorItem
介质
MediaCollection
MetadataPicture
MetadataText
Network
播放器
PlayerApplication
播放列表
PlaylistArray
PlaylistCollection
查询
设置
StringCollection

 

Firefox 插件支持 Player 对象,但 Player 对象的某些属性在 Firefox 浏览器中返回 NULL 。 例如,Player 对象的 cdromCollection 属性返回 NULL,因为 Firefox 插件不支持 Cdrom 对象。 同样,Player 对象的 dvdmediaCollectionplayerApplicationplaylistCollection 属性在 Firefox 浏览器中返回 NULL

Firefox 插件支持 Player.pluginVersionInfo 属性,但 Internet Explorer 不支持。 此属性返回 Firefox 插件的版本。

Firefox 插件支持 Media 对象,包括 getItemInfoByType 属性。 但是,在 Firefox 浏览器中, getItemInfoByType 属性不支持 MetadataTextMetadataPicture 返回类型。

Firefox 插件支持 Settings 对象, setMode 方法和 requestMediaAccessRights 属性除外。 在 Firefox 浏览器中, requestMediaAccessRight 属性始终返回 false。

将 Windows 媒体播放器 控件与 Firefox 配合使用