Network.recoveredPackets

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

recoveredPackets 属性检索恢复的数据包数。

语法

玩家networkrecoveredPackets

可能的值

此属性是只读 数字 () 。

备注

每次停止并重启播放时,此属性都设置为零。 如果播放暂停,则不会重置。

此属性仅在运行时且仅当 Player 时才返回有效信息。还设置了 URL 属性。 使用无损的 HTTP 协议时,它将等于零。

示例

以下 JScript 示例使用 网络recoveredPackets 用于显示恢复的数据包数。 该信息显示在创建的 HTML DIV 中,其 ID 为“PR”。 该示例使用间隔为 1 秒的计时器来更新显示。 创建 ID 为“Player”的 Player 对象。

<!-- Create an event handler for play state change. -->
<SCRIPT FOR = Player EVENT = PlayStateChange(NewState)>
   var idI; // Variable for the interval id.

   // Test whether content is playing.
   if (3 == NewState){
      // Start the timer. Call the function to update the display every second.
      idI = window.setInterval("UpdatePR()", 1000);
   }
   else{
      // Not playing; stop the timer.
      window.clearInterval(idI);
   }   
</SCRIPT>

<!-- Put the function to update the display in a separate code block. -->
<SCRIPT>
function UpdatePR(){
   PR.innerHTML = "";
   PR.innerHTML = "Packets recovered: " + Player.network.recoveredPackets;
}
</SCRIPT>

要求

要求
版本
Windows 媒体播放器版本 7.0 或更高版本。
DLL
Wmp.dll

另请参阅

Network 对象

Player.URL