mediaelement

How do I determine if MediaElement is playing?

a 夏天 提交于 2019-12-18 13:54:19
问题 Seems simple enough, but I cannot figure out any way to determine what the state of a MediaElement is. There are various properties for some states (such as IsBuffering) but I can't find any for states such as Play, Pause, etc. Silverlight seems to have a CurrentState property that shows all these. Currently the way I'm determining whether a video is supposed to be playing is watching for various events and a timer that checks to see if any progress is being made. I'm new to MediaElement and

Binding a progressbar to a mediaelement in wpf

别等时光非礼了梦想. 提交于 2019-12-18 11:57:53
问题 In c#/wpf I added a progressbar and mediaelement to my window. The idea was that progressbar is displaying how much is been played in the mediaelement. I tried it with the following xaml: <Window x:Class="TestApp.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="627" Width="889"> <Grid> <MediaElement Margin="152,8,140,41" Name="mediaElement1" MediaEnded="mediaElement1_MediaEnded"

How to set WPF window position in secondary display

故事扮演 提交于 2019-12-18 03:06:08
问题 I have two displays. I want to make a media player and I want to play video full screen on my secondary display. So I’m trying to make a media player using WPF Here is the code so far I wrote Screen[] _screens = Screen.AllScreens; System.Drawing.Rectangle ractagle = _screens[1].Bounds; //player is my window player.WindowState = WindowState.Maximized; player.WindowStyle = WindowStyle.None; player.Left = ractagle.X; player.Top = ractagle.Y; // MediaControl is an media elements MediaControl

Make MediaElement support more video codecs

妖精的绣舞 提交于 2019-12-17 18:57:37
问题 Is there a way to make MediaElement support more video codecs like mkv , flv , mov etc.? If not, is there any other control that supports more video codecs? 回答1: Have you seen the Player Framework? It's an open source component supporting Windows 8, part of the Microsoft Media Platform, and developed by Microsoft. It's an alternative to the standard MediaElement control, and provides a plug-in mechanism. I'm not sure whether you can support extra codecs through this mechanism though. Other

mediaelement error

ぐ巨炮叔叔 提交于 2019-12-14 03:13:05
问题 When I try to load my video, it won't play. The error I'm getting for the mediafailed event is: 3016 AG_E_INVALIDMEDIATYPE. It's a wmv file which is supported and I can play it with windows media player without a problem. What could be the problem? Thanks 回答1: Not all media types are supported, not even all wmvs: http://msdn.microsoft.com/en-us/library/cc189080(v=vs.95).aspx You could perhaps try to convert it to an appropriate media type. Also, make sure it's a resource file. To do this,

Silverlight. Play video from byte array

若如初见. 提交于 2019-12-13 17:15:12
问题 I have Silverlight application that recieves special structure of media: images and videos. Data is recieved as byte[] for each image or video To show images, I use: MemoryStream stream = new MemoryStream(Node.ResourceBin); BitmapImage bmp = new BitmapImage(); bmp.SetSource(stream); ImageContainer.Source = bmp; And it works. To show video I have tried: MemoryStream stream = new MemoryStream(); stream.Write(Node.ResourceBin, 0, Node.ResourceBin.Length); stream.Position = 0; VideoContainer

MediaElement is playing audio only in debug mode, its not playing audio without debug mode

时光毁灭记忆、已成空白 提交于 2019-12-13 05:47:23
问题 I am working on windows phone 8 trying to implement the audio playing feature in my app by creating the user control and media element. Surprisingly audio is playing during debugging but as i run the app without debug mode audio does not play, i tried the await and async methodology but thats also not working. MainPage.xaml.cs private async void AudioControl(string audioId, string audio_url) { customControlAudioPlayer.media_Id = audioId; customAudioPlayer.media_Url = audio_url; //Following

SpeedRatio & MediaTimeline

烂漫一生 提交于 2019-12-13 03:48:08
问题 I'm trying to be able to affect SpeedRatio on a MediaElement whilst having the media play in a continous loop. This is possible through code behind; I can reset the position of the media once it has ended, but that creates a seam in the playback. For seamless playback, I use a MediaTimeline, but when I use I media timeline, I can't change the SpeedRatio. Has anyone got a different approach to looping playback in a mediaElement, or handling SpeedRatio? UPDATE: If I stop the timeline, change

MediaElement won't play an mp3

天大地大妈咪最大 提交于 2019-12-13 01:26:58
问题 In the xaml I have: <Page.Background> <ImageBrush ImageSource="/TheseusAndTheMinotaur;component/Images/marbleBackground.jpg"/> </Page.Background> <Grid x:Name="mainGrid" Margin="0" IsHitTestVisible="True"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition Width="500" x:Name="gameArea"/> <ColumnDefinition/> </Grid.ColumnDefinitions> <MediaElement x:Name="footStep" Source="minotaurFoot.mp3" Volume="1" LoadedBehavior="Manual"/> <Button x:Name="btnExit" Content="Exit"

Workaround to play HTTPS video URL in WPF MediaElement

有些话、适合烂在心里 提交于 2019-12-12 20:34:12
问题 I have a C#/WPF application and I need to play a video stream over HTTPS (I'm talking about a YouTube videos, direct URLs extracted by using YoutubeExplode). It's well known that WPF MediaElement is a control with a lot of BUGs, but I'm looking for a method to make it work. Like in this stackoverflow question, I'd like to make a localhost redirect by coding a small HttpListener that transmits the HTTPS response in real time using an HTTP URL, but I have no idea how to do it. Maybe someone can