[UWP] [XBOX]防止MediaPlayerElement传输控件中的安全区域? [英] [UWP][XBOX] Prevent safe area in MediaPlayerElement's transport controls?
问题描述
Xbox定义了一个"安全区域"。但添加了48,27像素的边距。您可以通过调用
Xbox defines a "safe area" but adding a margin with 48,27 pixels. You can easily remove this artifical frame by calling
Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().SetDesiredBoundsMode(Windows.UI.ViewManagement.ApplicationViewBoundsMode.UseCoreWindow);
到目前为止一切顺利,但我的应用程序使用了具有自定义传输控件的MediaPlayerElement。不幸的是,播放器顶部的传输控件(无论是嵌入页面还是全屏运行)都有完全相同的边界,
而视频本身没有框架。
So far so good, but my app makes use of a MediaPlayerElement that has custom transport controls. Unfortonately there is exactly the same boundary for the transport controls on top of the player (both, embedded in the page as well as running full screen), while the video itself is not framed.
似乎Xbox为媒体播放器的底层窗口添加了相同的边界。但是如何设置边界模式呢?
Seems Xbox adds the same boundary for the mediaplayer's underlying window to the mediaplayer. But how can I set the bounds mode there!?
以上
Windows.UI.ViewManagement.ApplicationView.GetForCurrentView()
似乎返回了所有者的视图(即我已经删除边界的Window)而不是媒体播放器如果我在OnApplyTheme中调用它。
seems to return the owner's view (that is the Window I have removed the boundary already) and not the media player if I call this in OnApplyTheme.
任何提示或建议?
提前致谢,
Roland
Roland
推荐答案
嗨Don Rolando,
Hi Don Rolando,
首先,禁用安全区域不是最佳做法,我们不建议这样做。至于你的问题,传输控件位于MediaPlayerElement的顶部,并且当使用
MediaTransportControls ,但我们可以在不使用 MediaTransportControls ,只需将一个区域放在MediaPlayerElement
中,并带有一些按钮和其他控件来实现功能。
First of all, disabling the safe area is not the best practice, we don't recommend it. As for your issue, the transport controls is on the top of MediaPlayerElement and it does not streach as wide as the player when without the safe area using the MediaTransportControls, but we can create our customer controls without using the MediaTransportControls, just put an area in the MediaPlayerElement with some buttons and other control to implement the function.
祝你好运,
Breeze
这篇关于[UWP] [XBOX]防止MediaPlayerElement传输控件中的安全区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!