IWMPControls::fastForward 方法
[与此页面关联的功能(Windows 媒体播放器 SDK)是旧版功能。 它已被 MediaPlayer 取代。 MediaPlayer 已针对Windows 10和Windows 11进行了优化。 如果可能,Microsoft 强烈建议新代码使用 MediaPlayer 而不是 Windows 媒体播放器 SDK。 如果可能,Microsoft 建议重写使用旧 API 的现有代码以使用新 API。]
fastForward 方法开始向前方向快速播放媒体项。
语法
public void fastForward();
Public Sub fastForward()
Implements IWMPControls.fastForward
parameters
此方法没有任何参数。
返回值
此方法不返回值。
备注
fastForward 方法以正常速度的五倍播放剪辑。 调用 fastForward 等效于通过设置 IWMPSettings.rate 属性为速率指定 5.0。 如果随后更改了速率,或者调用了 IWMPControls.play 或 IWMPControls.stop,Windows 媒体播放器将停止快速转发。
fastForward 方法不适用于实时广播和某些媒体类型。 若要确定是否可以在剪辑中快进,请将 System.String 值“FastForward”传递给 C# ) 中的 IWMPControls.get_isAvailable 方法 (IWMPControls.isAvailable 属性。
示例
以下示例使用 fastForward 快速转发当前媒体项,以响应按钮的 Click 事件。 AxWMPLib.AxWindowsMediaPlayer 对象由名为 player 的变量表示。
private void fastForwardButton_Click(object o, System.EventArgs args)
{
// To get all of the available functionality of the player controls, cast the
// value returned by player.Ctlcontrols to a WMPLib.IWMPControls3 interface.
WMPLib.IWMPControls3 controls = (WMPLib.IWMPControls3)player.Ctlcontrols;
// Check first to be sure the operation is valid.
if (controls.get_isAvailable("fastForward"))
{
controls.fastForward();
}
}
Public Sub fastForwardButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles fastForwardButton.Click
' To get all of the available functionality of the player controls, Dim the
' value returned by player.Ctlcontrols as a WMPLib.IWMPControls3 interface.
Dim controls As WMPLib.IWMPControls3 = player.Ctlcontrols
' Check first to be sure the operation is valid.
If (controls.isAvailable("fastForward")) Then
controls.fastForward()
End If
End Sub
要求
要求 | 值 |
---|---|
版本 |
Windows 媒体播放器 9 系列或更高版本 |
命名空间 |
WMPLib |
程序集 |
|
另请参阅
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈