简体   繁体   English

媒体停止播放后的axWindowsMediaPlayer事件

[英]axWindowsMediaPlayer event after media stopped playing

I imported a axWindowsMediaPlayer control to my form to play a sequence of pictures and/or small videos. 我将axWindowsMediaPlayer控件导入到窗体中,以播放一系列图片和/或小视频。

Now I want the user to adjust the slide show to his own needs, so he should be able to select the "showtime" of each picture and just play the video's length. 现在,我希望用户可以根据自己的需要调整幻灯片放映,因此他应该能够选择每张图片的“放映时间”并只播放视频的长度。

I tried to apply a timer to the form, and change the axWindowsMediaPlayer URL every "x" amount of seconds. 我尝试将计时器应用于表单,并每隔“ x”秒更改axWindowsMediaPlayer URL。 This works perfectly for pictures, but videos now have an extra blank screen or footage cut off (depends on the time of the video compared to the "x" amount of seconds). 这非常适合图片,但是视频现在有一个额外的空白屏幕或素材被切断(取决于视频的时间与“ x”秒的时间相比)。

I want to to use an event, which will trigger when the media has stopped playing(so it wont cut off video's), but when I searched trough the axWindowsMediaPlayer event's list, I only found onMediaChanged . 我想使用一个事件,该事件将在媒体停止播放时触发(因此它不会切断视频),但是当我通过axWindowsMediaPlayer事件的列表进行搜索时,我只找到onMediaChanged This event is kinda strange, it triggers a few times on the beginning of a video and at the end... 这个事件有点奇怪,它在视频的开头和结尾触发了几次。

Is there anyway I can solve this? 反正有什么我可以解决的? Maby using something different than the axWindowsMediaPlayer ? Maby使用与axWindowsMediaPlayer不同的axWindowsMediaPlayer吗?

I found the solution after google'ing for hours. 几个小时后,我找到了解决方案。 If anyone wants to know how to acces the axWindowsMediaPlayer 's duration: 如果有人想知道如何增加axWindowsMediaPlayer的持续时间:

axWindowsMediaPlayer1.currentMedia.duration

It's a property (get and set) so this is all I needed. 这是一个属性(获取并设置),所以这就是我所需要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM