MediaTimeline 启动后无法更改其 RepeatBehavior 吗?
我正在使用 MediaTimeline 和 MediaClock 运行 MediaElement。但是,当我在启动后更改 RepeatBehavior 时,它没有任何效果,即当设置为 RepeatBehavior.Forever 和 Begin() 时,更改为 RepeatBehavior(1) 没有任何效果 - 时间线永远继续。同样,如果时间线设置为 RepeatBehavior(1),则在时钟启动后将其更改为 RepeatBehavior.Forever 也没有任何效果,时间线将停止在其原始 Duration 处。
就像持续时间没有随着这些更改而更新一样。但我也无法更改持续时间。
有什么办法可以改变时钟启动后的重复行为吗?
I'm running a MediaElement using MediaTimeline and MediaClock. However, when I change the RepeatBehavior after it's started it has no effect, I.e. When set to RepeatBehavior.Forever and Begin(), changing to RepeatBehavior(1) has no effect - the timeline continues forever. Likewise if the timeline is set to RepeatBehavior(1) changing it to RepeatBehavior.Forever afetr the clock has started also has no effect and the timeline stops at it's original Duration.
It's like the Duration doesn't get updated with these changes. Yet I cannot change Duration either.
Is there any way to change repeatbehavior after the clock has started?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试停止动画,更改 RepeatBehaviour 并从停止的同一点启动动画,这样用户就不会注意到它停止了。
You can try stopping animation, changing RepeatBehaviour and the launching animation from the same point where it stopped, so the user doesn't notice that it stopped.