展开全部
Private Sub WindowsMediaPlayer1_PlayStateChange(ByVal NewState As Long)
Select Case NewState
Case wmppsBuffering
Debug.Print "wmppsBuffering"
Case wmppsLast
Debug.Print "wmppsLast"
Case wmppsMediaEnded
Debug.Print "wmppsMediaEnded(这里是播放停止)"
Case wmppsPaused
Debug.Print "wmppsPaused"
Case wmppsPlaying
Debug.Print "wmppsPlaying"
Case wmppsReady
Debug.Print "wmppsReady"
Case wmppsReconnecting
Debug.Print "wmppsReconnecting"
Case wmppsScanForward
Debug.Print "wmppsScanForward"
Case wmppsScanReverse
Debug.Print "wmppsScanReverse"
Case wmppsStopped
Debug.Print "wmppsStopped(这里是人为停止:按下停止的按钮)"
Case wmppsTransitioning
Debug.Print "wmppsTransitioning"
Case wmppsUndefined
Debug.Print "wmppsUndefined"
Case wmppsWaiting
Debug.Print "wmppsWaiting"
End Select
End Sub
添加一个Timer 控件
在Timer事件里面添加代码:if wmp.fullscreen=true then wmp.fullscreen=false
Select Case NewState
Case wmppsBuffering
Debug.Print "wmppsBuffering"
Case wmppsLast
Debug.Print "wmppsLast"
Case wmppsMediaEnded
Debug.Print "wmppsMediaEnded(这里是播放停止)"
Case wmppsPaused
Debug.Print "wmppsPaused"
Case wmppsPlaying
Debug.Print "wmppsPlaying"
Case wmppsReady
Debug.Print "wmppsReady"
Case wmppsReconnecting
Debug.Print "wmppsReconnecting"
Case wmppsScanForward
Debug.Print "wmppsScanForward"
Case wmppsScanReverse
Debug.Print "wmppsScanReverse"
Case wmppsStopped
Debug.Print "wmppsStopped(这里是人为停止:按下停止的按钮)"
Case wmppsTransitioning
Debug.Print "wmppsTransitioning"
Case wmppsUndefined
Debug.Print "wmppsUndefined"
Case wmppsWaiting
Debug.Print "wmppsWaiting"
End Select
End Sub
添加一个Timer 控件
在Timer事件里面添加代码:if wmp.fullscreen=true then wmp.fullscreen=false
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询