mediaelement

MediaElement/MediaPlayer/MediaUriElement hangs UI thread while loading a video

假如想象 提交于 2020-06-26 13:26:33
问题 hey, i've got a wpf application that have a doubleanimation used for scrolling text and images (scrollbar) from the left side of the screen, to the right, and a movie playing, in the same window. everytime a video ends, and a new video loads, the doubleanimation get stuck/hangs for a second, then it continues normally. i assume it's the control blocking the ui thread while loading the video. i've tried to create a seperate UI thread for the scrolling bar but i didn't solve the problem. i've

MediaElement/MediaPlayer/MediaUriElement hangs UI thread while loading a video

我的未来我决定 提交于 2020-06-26 13:26:01
问题 hey, i've got a wpf application that have a doubleanimation used for scrolling text and images (scrollbar) from the left side of the screen, to the right, and a movie playing, in the same window. everytime a video ends, and a new video loads, the doubleanimation get stuck/hangs for a second, then it continues normally. i assume it's the control blocking the ui thread while loading the video. i've tried to create a seperate UI thread for the scrolling bar but i didn't solve the problem. i've

how do I embed a youtube video into a WPF MediaElement and save the video?

流过昼夜 提交于 2020-04-18 06:14:50
问题 Is there a way to embed a youtube video into a MediaElement and save the video? I know that once you have an object inside your application you can have some sort of control over it(I think). If I'm correct, is it possible to save the youtube video once it is embedded inside the MediaElement? Thanks. 回答1: Youtube videos are not available as files, as they are streams. that makes it a bit hard to save them (Actually you can, JDownloader does that, but that's infringement of YT terms), but for

UWP youtube player in mediaelement

柔情痞子 提交于 2020-02-28 07:45:13
问题 I am currently developing an UWP youtube player and i am having some big trouble with playing the actual video. I am using this to play a youtube video in a media element: using MyToolkit.Multimedia; var url = await YouTube.GetVideoUriAsync(youtubeid, YouTubeQuality.Quality1080P); var YoutubePlayer = new MediaElement(); YoutubePlayer.Source = url.Uri; It used to work just fine for about a month, but now it just... doesn't. It gets the right video URI (the mp4), i also tried with the

How to reuse BackgroundAudioPlayer after Close method called

可紊 提交于 2020-01-21 09:50:20
问题 I’m using MediaElement for playing videos and BackgroundAudioPlayer for playing audio. Here is a case. I’m playing remote audio via BackgroundAudioPlayer. Then I want to play video and before MediaElement begins playing video I’m calling BackgroundAudioPlayer.Close as suggested in BackgroundAudioPlayer best practices. MediaElement and the BackgroundAudioPlayer Care must be taken when mixing BackgroundAudioPlayer and MediaElement for audio playback. 1. Close() must be called before switching

C# gif medialement how to change position

自闭症网瘾萝莉.ら 提交于 2020-01-17 07:14:05
问题 I just want to change the position of the gif in the MediaElement , so when i don't hover it with the mouse it should display a certain image of the GIF (the selected position) and when i move the cursor on the MediaElement the GIF should start playing from position zero. But i am not able to change the position of the GIF at all. It starts playing and i can pause it, but setting position and the stop() method have no influence at all. XAML Code: <MediaElement x:Name="mediaElement" Source="C:

WinRT C# Play a viddler video using MediaElement

梦想与她 提交于 2020-01-17 02:50:30
问题 I am trying to play a Viddler video in my application but i cant get it to work. Here is my simple code: XAML: < MediaElement VerticalAlignment="Center" Visibility="Visible" HorizontalAlignment="Center" Name="myMediaElement" Height="350" Width="640" /> And my c#: myMediaElement = new MediaElement(); Uri url = new Uri("http://www.viddler.com/embed/5b17d44f/"); myMediaElement.Source = url; myMediaElement.Play(); Any help would be great! When i arrive on the page, nothing happens, the

Why does MediaElement sometimes silently fail and how can I correct it?

故事扮演 提交于 2020-01-13 10:27:07
问题 In my WPF project I have created a view that includes several MediaElements playing videos. Sometimes, anywhere between one or all of the MediaElements will fail to play the video assigned to them, and will instead show a black rectangle, or not appear at all. The MediaFailed event does not occur when this happens. The MediaOpened event DOES get raised on all the MediaElements, even when they do not play the video. I have installed the latest drivers for my graphics card and that has had no

Why doesn't MediaElement work in Silverlight?

百般思念 提交于 2020-01-13 06:06:26
问题 When I run my Silverlight app, this code doesn't play a video at all: <MediaElement Source="winvideo-201DataGridPreview.wmv" AutoPlay="True" AudioStreamIndex="2" Margin="10" Height="200" Width="200"/> From all of the examples I can find of MediaElement, it seems to be the correct syntax, etc. Is there anything I'm forgetting? 回答1: Edward, based on your XAML check: 1) that the WMV file is in the appropriate encoding format, 2) that the WMV file is located alongside where your XAP file is (I'd

MediaElement not playing audio from stream WP7

有些话、适合烂在心里 提交于 2020-01-10 04:24:05
问题 string url = re["response"][0]["url"].ToString(); MediaElement mm = new MediaElement(); mm.Source = new Uri(url,UriKind.RelativeOrAbsolute); mm.AutoPlay = true; mm.Volume = 0.7; mm.Play(); But no changes, the adudio not starts.How I can resolve this? 回答1: You need to add your MediaElement to your VisualTree before playing it, since you're creating it in the codebehind. For example, assuming you have LayoutRoot and that your url is correct, this should work. string url = re["response"][0]["url