MediaCollection.isDeleted 方法
[與此頁面相關聯的功能Windows 媒體播放機 SDK是舊版功能。 MediaPlayer已取代它。 MediaPlayer已針對Windows 10和Windows 11進行優化。 Microsoft 強烈建議新程式碼盡可能使用MediaPlayer,而不是Windows 媒體播放機 SDK。 Microsoft 建議使用舊版 API 的現有程式碼盡可能重寫為使用新的 API。
isDeleted方法會擷取值,指出指定的媒體專案是否位於已刪除的專案資料夾中。
語法
bRetVal = MediaCollection.isDeleted(
item
)
參數
-
專案 [in]
-
可能會刪除的媒體物件。
傳回值
這個方法會傳回 布林值。
備註
若要使用此方法,需要程式庫的讀取權限。 如需詳細資訊,請參閱 程式庫存取。
Windows 媒體播放機 10 Mobile:此方法一律會傳回false。
範例
下列 JScript 範例使用 MediaCollection。isDeleted 用來測試儲存在名為 mediaObject 變數中的特定媒體專案是否位於已刪除的專案資料夾中。 如果媒體專案尚未刪除,則會移至已刪除的專案資料夾。 Player物件是以識別碼 = 「Player」 建立的。
// Test whether the media item is in the deleted items folder.
if (!Player.mediaCollection.isDeleted(mediaObject)){
// The media item is available to be deleted, move it to
// the deleted items folder.
Player.mediaCollection.setDeleted(mediaObject, true);
// Inform the user that the operation succeeded.
alert("Media item moved to deleted items folder.");}
else
// Tell the user the operation is unnecessary.
alert("Item is already deleted!");
}
規格需求
需求 | 值 |
---|---|
版本 |
Windows 媒體播放機 7.0 版、Windows 媒體播放機 7.1 版或 Windows XP Windows 媒體播放機版。 Windows 媒體播放機 9 系列或更新版本不支援此方法。 |
DLL |
|
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應