ErrorItem.errorDescription

[與此頁面相關聯的功能Windows 媒體播放機 SDK是舊版功能。 它已被 MediaPlayer 取代MediaPlayer已針對Windows 10和Windows 11進行優化。 Microsoft 強烈建議新程式碼盡可能使用MediaPlayer,而不是Windows 媒體播放機 SDK。 Microsoft 建議盡可能重寫使用舊版 API 的現有程式碼,以使用新的 API。]

errorDescription屬性會擷取錯誤的描述。

player.error.item(
        index
        ).errorDescription

可能的值

此屬性是唯讀 的 String

備註

您應該設定 [ 設定]。如果您選擇顯示自訂錯誤訊息,enableErrorDialogs 為 false。

範例

下列 JScript 範例使用 ErrorItem事件處理常式中的 errorDescription ,向使用者顯示錯誤訊息。 Player物件是以 ID = 「Player」 建立。

<SCRIPT LANGUAGE = "JScript"  FOR = Player  EVENT = error()>

// Get the error description for the first error item.
errDesc = Player.error.item(0).errorDescription;

// Display the error code.
var message = "Error: " + errDesc";
message += "<BR>";
message += "Use your BACK button to return ";
message += "to the previous page.";
document.write(message);

</SCRIPT>

規格需求

需求
版本
Windows 媒體播放機 7.0 版或更新版本
DLL
Wmp.dll

另請參閱

ErrorItem 物件