Error.clearErrorQueue 方法
[與此頁面相關聯的功能Windows 媒體播放機 SDK是舊版功能。 它已被 MediaPlayer 取代。 MediaPlayer已針對Windows 10和Windows 11進行優化。 Microsoft 強烈建議新程式碼盡可能使用MediaPlayer,而不是Windows 媒體播放機 SDK。 Microsoft 建議盡可能重寫使用舊版 API 的現有程式碼,以使用新的 API。]
clearErrorQueue方法會清除錯誤佇列中的錯誤。
語法
Error.clearErrorQueue()
參數
這個方法沒有任何參數。
傳回值
這個方法不會傳回值。
備註
在處理一系列錯誤之後,這個方法有助於清除錯誤佇列。
您應該設定 [ 設定]。如果您選擇顯示自訂錯誤訊息,enableErrorDialogs 為 false。
範例
下列 JScript 範例使用 Error。在顯示所有錯誤描述之後,事件處理常式中的clearErrorQueue 會清空錯誤佇列。 Player物件是以 ID = 「Player」 建立。
<SCRIPT LANGUAGE = "JScript" FOR = Player EVENT = error()>
// Store the number of errors in the queue.
var max = Player.error.errorCount
// Loop through the list of errors.
for (var i = 0; i < max; i++){
// Get the error description for this item.
var errDesc = Player.error.item(i).errorDescription;
// Display the error message.
alert(errDesc);
}
// Clear the error queue to prepare for the next group of errors.
Player.error.clearErrorQueue();
</SCRIPT>
規格需求
需求 | 值 |
---|---|
版本 |
Windows 媒體播放機 7.0 版或更新版本。 |
DLL |
|
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應