MediaElement 在全景图中显示视频的问题

发布于 2024-10-13 07:13:49 字数 1092 浏览 7 评论 0原文

此脚本设置一个包含 5 个项目的全景控件,然后在第二个全景项目的 MediaElement 内加载视频。

如果我将其减少到 2 个项目,则不会显示视频(媒体元素“不可见”),但您仍然可以听到音频 - 即:

panorama = Panorama.new
panorama.title = "Video panorama"
Host.content_holder.children.add panorama

for i in 1..2 # if this is >2, then the video shows
  panorama_item = PanoramaItem.new
  panorama_item.header = "Child " << i.to_s
  panorama.items.add panorama_item

  if i == 2
    panorama_item.orientation = Orientation.horizontal
    media_element = MediaElement.new
    media_element.source = Uri.new("http://files.ch9.ms/ch9/f2c3/b59b6efb-3c70-4bc2-b3ff-9e650007f2c3/wp7ces_ch9.wmv") 
    panorama_item.content = media_element
  else
    text_block = TextBlock.new
    text_block.text = "Hello world"
    panorama_item.content = text_block
  end
end

我猜想这与最初的全景展示的动画和时间安排 - 但我无法解决这个问题。

该问题在 C#/XAML 中似乎是相同的,因此这不是脚本问题。

有人知道去哪里看吗?

This script sets up a Panorama Control with 5 items, then loads up a video inside a MediaElement in the second Panorama item.

If I reduce this down to 2 items then no video shows (the media element is "invisible"), but you can still hear the audio - i.e. something like:

panorama = Panorama.new
panorama.title = "Video panorama"
Host.content_holder.children.add panorama

for i in 1..2 # if this is >2, then the video shows
  panorama_item = PanoramaItem.new
  panorama_item.header = "Child " << i.to_s
  panorama.items.add panorama_item

  if i == 2
    panorama_item.orientation = Orientation.horizontal
    media_element = MediaElement.new
    media_element.source = Uri.new("http://files.ch9.ms/ch9/f2c3/b59b6efb-3c70-4bc2-b3ff-9e650007f2c3/wp7ces_ch9.wmv") 
    panorama_item.content = media_element
  else
    text_block = TextBlock.new
    text_block.text = "Hello world"
    panorama_item.content = text_block
  end
end

I guess this is something to do with the animation and timing of the initial Panorama show - but I've not been able to get any grip on the problem.

The problem does appear to be the same in C#/XAML so it's not a scripting issue.

Has anyone got any ideas of where to look?

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

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

发布评论

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

评论(1

ま昔日黯然 2024-10-20 07:13:49

全景图中的项目不得少于 3 个 - 我从 MSFT 的同行那里听说过它作为用户体验指南。当出现与只有 1 或 2 个项目的全景图相关的技术问题时,这些人指出全景图不适合与如此少的项目一起使用,因此您可能会遇到奇怪的行为。

还要小心在 PanoramaItem 中显示视频 - 因为这不是标准应用程序中使用 Panorama 控件的方式 - 因此它可能不符合准则。

Don't have less than 3 items in your Panorama - I've heard it from MSFT peeps as a UX guideline. When technical issues have come up relating to a panorama with only 1 or 2 items those same people have pointed out that the Panorama is not intended to be used with so few items and so you may get weird behaviours.

Also be careful showing video in a PanoramaItem - as this is not the way the Panorama control is used in the standard applications - so it may fall outside the guidelines.

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