Silverlight 视频的缩略图

发布于 2024-07-24 16:54:00 字数 225 浏览 1 评论 0原文

对于流行的视频播放器,例如 sl2videoplayer,http://www.codeplex.com/sl2videoplayer,我的问题是在我们点击播放之前(非自动播放的情况下),Siverlight视频的缩略图是如何显示的。

提前致谢, 乔治

For the popular video player, like sl2videoplayer, http://www.codeplex.com/sl2videoplayer, my question is how is the thumbnail image of Siverlight video is displayed before we click play (in the scenario of non-autoplay).

thanks in advance,
George

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吹泡泡o 2024-07-31 16:54:00

视频播放器使用的 MediaElement 将显示当前位置帧的缩略图。 否则,Expression Encoder 等工具会创建用于视频缩略图和章节标记的缩略图(JPEG 或 PNG)。

这将显示 Bear.wmv 视频的第一帧,并且不会自动播放:

<Grid x:Name="LayoutRoot" Background="White">
    <MediaElement AutoPlay="False" Source="Bear.wmv"/>
</Grid>

如果您知道缩略图的来源时间,则可以拥有一个辅助 MediaElement,其当前位置具有该时间。 当播放开始时,您将折叠其可见性。

迈克尔

the MediaElement that the Video Player uses will show a thumbnail image of the frame at the current position. Otherwise, tools like Expression Encoder create thumbnail images (JPEGs or PNGs) that will be used for the video thumbnails and chapter markers.

This will show the first frame of the Bear.wmv video and won't play automatically:

<Grid x:Name="LayoutRoot" Background="White">
    <MediaElement AutoPlay="False" Source="Bear.wmv"/>
</Grid>

If you knew the time that the thumbnail comes from, you could have a secondary MediaElement with its Current Position having that time. When playback starts, you would collapse its visiblity.

Michael

可是我不能没有你 2024-07-31 16:54:00

我同意上述答案有效,但它可能并不适合每种情况。 另一种方法是使用一个覆盖 mediaElement 的特定图像控件,并将其可见性绑定到“IsPlaying”属性。 您需要创建“IsPlaying”属性。

像这样的事情:

<Grid x:Name="LayoutRoot" Background="White">
        <MediaElement AutoPlay="False" Source="Bear.wmv"/>
        <Image Source="Thumbnail" Visibility="{Binding Path=IsPlaying, Converter={StaticResource BooleanToVisibilityConverter}} />
</Grid>

只是一个替代解决方案。 它们看起来都有点像黑客,但这就是我们所做的有趣的部分!

I agree that the above answer works, but it might not be optimal for every scenario. An alternate to this would be to have a specific image control that overlays the mediaElement and have it's visibility bound to an "IsPlaying" property. You would need to create the "IsPlaying" property.

Something like this:

<Grid x:Name="LayoutRoot" Background="White">
        <MediaElement AutoPlay="False" Source="Bear.wmv"/>
        <Image Source="Thumbnail" Visibility="{Binding Path=IsPlaying, Converter={StaticResource BooleanToVisibilityConverter}} />
</Grid>

Just an alternative solution. They both seem like hacks a little, but that's the fun part of what we do!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文