mediaelement

Alert sound in Windows Phone 8.1 App

守給你的承諾、 提交于 2019-12-08 14:48:50
问题 I am writing a Windows Phone 8.1 App (WINRT) . On click of a button, a beep must play . So i used MediaElement , but the problem is it pauses the MediaPlayer song . I even tried to change AudioCategory /Stream type but its not helping. Stream types Any solution? private void CreateMediaElements() { //WINRT: MediaElementObject = new MediaElement(); MediaElementObject.AudioCategory = AudioCategory.Alerts; MediaElementObject.IsLooping = false; MediaElementObject.Source = new Uri("ms-appx://

Show Video Play Progress using Media Element Windows 8.1 Universal app

与世无争的帅哥 提交于 2019-12-08 10:50:28
问题 i want to show Progress of Video while it is playing but i dont get any event on media element where i will get play progress of video like download progress and buffer progress. Is there any other way to achieve it? or some other tool or something? <MediaElement x:Name="player" AutoPlay="True" MediaEnded="player_MediaEnded" Stretch="Uniform" DownloadProgressChanged="player_DownloadProgressChanged" BufferingProgressChanged="player_BufferingProgressChanged" CurrentStateChanged="player

Using MediaTransportControls with BackgroundMediaPlay in Background Audio Task UWP

↘锁芯ラ 提交于 2019-12-08 10:09:01
问题 I am building a UWP App that plays Audio in the Background. I have successfully set it up and it's running with a simple play/pause Button. Now I need to play Audio using a MediaElement control that has MediaTransportControls enabled. I have read that it is impossible to play Background Audio using Media Element. Here in this article they suggest using BackgroundMediaPlayer: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/e6bb37ec-49f7-4e5a-91ef-44ae3725a761/uwpbackground-audio-on

Capture each WPF MediaElement frame

▼魔方 西西 提交于 2019-12-08 06:24:23
问题 Is there a way to capture each WPF MediaElement frame? Like an event that fires at each rendered frame and allows me to access it. If MediaElement does not provide such functionality, how could it be implemented or what other control could I use? On a side note, is there such a control or method that would allow for off-screen fast rendering of media clips with frame capture? (so I could process frames as fast as possible) 回答1: Try out my WPF MediaKit project. Allows you to do pretty much

Binding MedialElement from the view (xaml) to a ViewModel's property

丶灬走出姿态 提交于 2019-12-08 01:57:46
问题 I'm trying to make a binding of a medialElement from MainView.xaml to a ViewModel's proprety. in MainViewModel.cs we would find #region Media private MediaElement media; public MediaElement Media { get { return media; } set { if (value == media) return; media = value; OnPropertyChanged("Media"); } } #endregion I would like to know what to put in the MainView.xaml to do the binding. I know that if it were a TextBox I would write `<TextBox Text="{Binding BGToSet, UpdateSourceTrigger

Replaying a video continuously in a WPF media element

青春壹個敷衍的年華 提交于 2019-12-07 21:03:05
问题 I have a video file playing in a media element. I need to keep it playing, thus I tried: me.play(); me.MediaEnded += new RoutedEventHandler(me_MediaEnded); With this event method: //loop to keep video playing continuously void me_MediaEnded(object sender, EventArgs e) { //play video again me.Play(); } However the above does not replay the video file. Why? What did I do wrong? 回答1: According to a post on MSDN: Play() starts from the current position therefore you have to first go to the

MediaElement.js video player: Display time based on outside data?

不羁岁月 提交于 2019-12-07 10:17:10
问题 I've got a MediaElement.js player with a video loaded into it, and I have a (database-driven) function which, given a time offset within that video, gives me the actual real-world time at which that part of the video represents. I.e., if the video consists of 2 30-second clips, the first of which was recorded Tuesday morning, and the second of which was recorded Thursday evening, the function I've got will take an input of 25.2 and return a particular time on Tuesday morning, or it'll take an

MediaElement.NaturalDuration throws exception when querying TimeSpan.TotalSeconds

时光怂恿深爱的人放手 提交于 2019-12-07 08:06:07
问题 I have a winforms form in which I use a MediaElement. Everything is working (more or less) perfectly. The only thing is, after loading a media file (mp3) accessing NaturalDuration.TimeSpan.TotalSeconds throws an exception InvalidOperatoinException: A TimeSpan property can not be returned for a duration value of automatic. (Translated from german by myself) How can I access the timespan property? There is no special setting used in all the examples I have found (ok, they seem to be WPF native.

Windows phone 8 slider binding works only after a click

北城以北 提交于 2019-12-06 14:21:37
I am writing an audio app on Windows Phone 8. I've created a MediaElement and a seek-bar(slider): <MediaElement x:Name="player" CurrentStateChanged="GetTrackDuration" /> <Slider x:Name="playerSeekBar" Value="{Binding ElementName=player, Path=Position, Mode=TwoWay, Converter={StaticResource PositionConverter}}" SmallChange="1" LargeChange="1"/> And this is my converter code: public class PositionConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { double position = 0; TimeSpan timespan = TimeSpan.Parse

Replaying a video continuously in a WPF media element

霸气de小男生 提交于 2019-12-06 11:09:53
I have a video file playing in a media element. I need to keep it playing, thus I tried: me.play(); me.MediaEnded += new RoutedEventHandler(me_MediaEnded); With this event method: //loop to keep video playing continuously void me_MediaEnded(object sender, EventArgs e) { //play video again me.Play(); } However the above does not replay the video file. Why? What did I do wrong? According to a post on MSDN : Play() starts from the current position therefore you have to first go to the starting place and then play it again. So you have to reset the position before replaying: me.Position = TimeSpan