在 MVC 中播放 Windows Media Video (.wmv) 檔案,核心做法是將 Media Player ActiveX 元件嵌入 Controller 的 ContentResult Action 回傳 HTML 字串。
<object> 標籤字串,設定 classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" (WMPlayer)Content(htmlString, "text/html")@Html.Raw(ViewBag.PlayerHtml) 或 iframe 嵌入參數可硬寫、從資料庫讀取或前端傳遞。前提:客戶端需安裝 Windows Media Player 或相容播放器。