Problems with MediaElement showing Video inside a Panorama
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/b59b6ef开发者_高级运维b-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?
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.
精彩评论