我使用Smf.CodePlex.com框架。如何从渐进式下载流(Windows Phone)获取实际视频大小
我试过了:
var item = TvPlayer.CurrentPlaylistItem;
var videoHeight = item.VideoHeight;
var videoWidth = item.VideoWidth;
以及
var videoHeight = TvPlayer.VideoHeight;
var videoWidth = TvPlayer.VideoWidth;
两者都归还NaN。任何线索?
答案 0 :(得分:1)
我找到了。您必须获得渐进式下载插件的引用(通过事件处理程序)
void TvPlayer_MediaPluginRegistered(object sender, CustomEventArgs<Microsoft.SilverlightMediaFramework.Plugins.IMediaPlugin> e)
{
IMediaPlugin a = e.Value;
if (a.GetType() == typeof(ProgressiveMediaPlugin))
_progressivePlugin = e.Value;
}
在插件上找到了NaturalVideoSize .....
var videoHeight = _progressivePlugin.NaturalVideoSize.Height;
var videoWidth = _progressivePlugin.NaturalVideoSize.Width;
答案 1 :(得分:0)