Using MediaElement to play video from Stream










9















Is it possible to use the WPF MediaElement to play streaming video from a System.IO.Stream object? The Stream object is being retrieved from a WCF service that stores the media files.










share|improve this question


























    9















    Is it possible to use the WPF MediaElement to play streaming video from a System.IO.Stream object? The Stream object is being retrieved from a WCF service that stores the media files.










    share|improve this question
























      9












      9








      9


      10






      Is it possible to use the WPF MediaElement to play streaming video from a System.IO.Stream object? The Stream object is being retrieved from a WCF service that stores the media files.










      share|improve this question














      Is it possible to use the WPF MediaElement to play streaming video from a System.IO.Stream object? The Stream object is being retrieved from a WCF service that stores the media files.







      c# wpf wcf mediaelement






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 19 '11 at 6:07









      rafalerafale

      78452241




      78452241






















          5 Answers
          5






          active

          oldest

          votes


















          6














          IF you can make the WCF deliver the Media Object via a http-URL (GET) then you can just assign that URL to the MediaElement.Source property - see http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.source.aspx.



          For cases where such URL is not available/possible:



          Assigning a Stream is currently not possible - although there are some hacks to make that happen, for a DirectShow-based example see http://social.msdn.microsoft.com/forums/en-US/wpf/thread/6191ef1a-0010-4294-a5b4-451bbadca33a/ and http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/15/WPF-Hackery-Part-I.aspx .



          Another option would be to somehow host the Silverlight MediaElement and use the SetSource method which can take a stream and play it... see http://silverlightviewport.codeplex.com/SourceControl/list/changesets and http://msdn.microsoft.com/en-us/library/cc190669%28v=vs.95%29.aspx






          share|improve this answer






























            13














            It might be too late, hopefully this might help if you're still looking for an answer.



            Yes you can play video from Memory stream using WPF media element.



            I have used a third party component called boxed app, A million thanks to BoxedApp - http://www.boxedapp.com/boxedappsdk/



            I have to update the code a tiny bit to make it work for byte. Copy the below constructor to CustomFileStream class from BoxedApp



            public CustomFileStream(byte data)

            _Stream = new MemoryStream(data);
            _Length = _Stream.Length;
            _data = data;
            _Offset = 0;



            Create a wpf application and add a media element and a button and copy the below code



            public MainWindow()

            BoxedAppSDK.NativeMethods.BoxedAppSDK_Init();

            InitializeComponent();


            private void button2_Click(object sender, RoutedEventArgs e)

            var MyFileStream = new CustomFileStream(File.ReadAllBytes(@"wildlife.wmv"));

            IntPtr ptr = BoxedAppSDK.NativeMethods.BoxedAppSDK_CreateVirtualFileBasedOnIStream(
            @"1.wmv",
            BoxedAppSDK.NativeMethods.EFileAccess.GenericWrite,
            BoxedAppSDK.NativeMethods.EFileShare.Read,
            IntPtr.Zero,
            BoxedAppSDK.NativeMethods.ECreationDisposition.New,
            BoxedAppSDK.NativeMethods.EFileAttributes.Normal,
            IntPtr.Zero,
            MyFileStream);

            using (new SafeFileHandle(ptr, true))

            mediaElement1.Source = new Uri(Path.GetFullPath("1.wmv"));
            mediaElement1.LoadedBehavior = MediaState.Manual;
            mediaElement1.Play();




            - for boxed app please follow the samples and that's it.. you're in a happy world...



            It's the same thing for QT Player as well.



            Based on the response I'll add a complete example if the information provided isn't enough.



            Happy coding....






            share|improve this answer























            • Great answer, thanks a lot!

              – Mafii
              Jan 23 '18 at 8:27


















            12














            Before anyone wastes hours finding this out for themselves: it is impossible to host the Silverlight MediaElement in a WPF application. The reason for this is that it is one of a number of types that appear in PresentationFramework.dll (unavoidable for WPF) and System.Windows.dll (Silverlight versions) that have the same names and the same namespaces, but are different types.
            (Someone should explain why we have namespaces to microsoft!)






            share|improve this answer


















            • 1





              This is true. Unfortunately I had to find this out the hard way. :(

              – rafale
              Nov 11 '11 at 3:42






            • 4





              I know this is a year-old answer, but aren't "multiple distinct types with the same name in the same namespace" the reason that reference aliases exist?

              – Damien_The_Unbeliever
              Nov 5 '12 at 9:19






            • 1





              It is always possible to make Silverlight Website and use MediaElement there and in WPF applicatione add WebBrowser control with source to that Silverlight website and it is done.

              – Academy of Programmer
              Feb 6 '13 at 11:50











            • yes @Damien_The_Unbeliever my thought at first - but it depends on how it plays out and I've seen situations where similar tricks aren't possible. Though I'd say this still 'might' be possible, with some hacking. Haven't tried though, looks like trouble

              – NSGaga
              Apr 12 '14 at 19:54


















            4














            I know this isn't what you asked for but you can host a VLC ActiveX component inside a window in WPF and then use that VLC control to connect to the stream and display the stream. This is how I got streaming working through WPF.



            Edit: this page has an example of how to host an ActiveX control inside WPF






            share|improve this answer




















            • 2





              Can I see an example of a WPF application running VLC as an ActiveX component? I'd like to see what it looks like and what's involved in getting it running before I actually go for it.

              – rafale
              Aug 20 '11 at 6:02











            • Hi Stuart, could you post your example using VLC somewhere so that I can have a look. Thanks.

              – Toan Nguyen
              Jan 29 '15 at 6:06


















            0














            As WPF mediaelement internally uses windows media player. If you alter the buffer settings of media player from default buffer setting to custom. Open windows media player  Tools  Options  Performance.



            When you choose “Buffer” option and set “Seconds of content” to 2. The following registry values will be added under media player.
            HKEY_CURRENT_USERSoftwareMicrosoftMediaPlayerPreferences
            UseDefaultBufferTime=0
            CustomBufferTime=2000



            You can use dotnet registry class to make changes.
            Refer this link:
            https://social.msdn.microsoft.com/Forums/vstudio/en-US/1b4b8fb9-ff8f-4861-8e99-4a7a4fc75596/setting-windows-media-player-properties-in-wpf?forum=wpf#ac879a7f-37bc-4ccc-854d-ab6e047086e5






            share|improve this answer






















              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f7117589%2fusing-mediaelement-to-play-video-from-stream%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              5 Answers
              5






              active

              oldest

              votes








              5 Answers
              5






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              6














              IF you can make the WCF deliver the Media Object via a http-URL (GET) then you can just assign that URL to the MediaElement.Source property - see http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.source.aspx.



              For cases where such URL is not available/possible:



              Assigning a Stream is currently not possible - although there are some hacks to make that happen, for a DirectShow-based example see http://social.msdn.microsoft.com/forums/en-US/wpf/thread/6191ef1a-0010-4294-a5b4-451bbadca33a/ and http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/15/WPF-Hackery-Part-I.aspx .



              Another option would be to somehow host the Silverlight MediaElement and use the SetSource method which can take a stream and play it... see http://silverlightviewport.codeplex.com/SourceControl/list/changesets and http://msdn.microsoft.com/en-us/library/cc190669%28v=vs.95%29.aspx






              share|improve this answer



























                6














                IF you can make the WCF deliver the Media Object via a http-URL (GET) then you can just assign that URL to the MediaElement.Source property - see http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.source.aspx.



                For cases where such URL is not available/possible:



                Assigning a Stream is currently not possible - although there are some hacks to make that happen, for a DirectShow-based example see http://social.msdn.microsoft.com/forums/en-US/wpf/thread/6191ef1a-0010-4294-a5b4-451bbadca33a/ and http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/15/WPF-Hackery-Part-I.aspx .



                Another option would be to somehow host the Silverlight MediaElement and use the SetSource method which can take a stream and play it... see http://silverlightviewport.codeplex.com/SourceControl/list/changesets and http://msdn.microsoft.com/en-us/library/cc190669%28v=vs.95%29.aspx






                share|improve this answer

























                  6












                  6








                  6







                  IF you can make the WCF deliver the Media Object via a http-URL (GET) then you can just assign that URL to the MediaElement.Source property - see http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.source.aspx.



                  For cases where such URL is not available/possible:



                  Assigning a Stream is currently not possible - although there are some hacks to make that happen, for a DirectShow-based example see http://social.msdn.microsoft.com/forums/en-US/wpf/thread/6191ef1a-0010-4294-a5b4-451bbadca33a/ and http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/15/WPF-Hackery-Part-I.aspx .



                  Another option would be to somehow host the Silverlight MediaElement and use the SetSource method which can take a stream and play it... see http://silverlightviewport.codeplex.com/SourceControl/list/changesets and http://msdn.microsoft.com/en-us/library/cc190669%28v=vs.95%29.aspx






                  share|improve this answer













                  IF you can make the WCF deliver the Media Object via a http-URL (GET) then you can just assign that URL to the MediaElement.Source property - see http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.source.aspx.



                  For cases where such URL is not available/possible:



                  Assigning a Stream is currently not possible - although there are some hacks to make that happen, for a DirectShow-based example see http://social.msdn.microsoft.com/forums/en-US/wpf/thread/6191ef1a-0010-4294-a5b4-451bbadca33a/ and http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/15/WPF-Hackery-Part-I.aspx .



                  Another option would be to somehow host the Silverlight MediaElement and use the SetSource method which can take a stream and play it... see http://silverlightviewport.codeplex.com/SourceControl/list/changesets and http://msdn.microsoft.com/en-us/library/cc190669%28v=vs.95%29.aspx







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 19 '11 at 6:22









                  YahiaYahia

                  62.9k790121




                  62.9k790121























                      13














                      It might be too late, hopefully this might help if you're still looking for an answer.



                      Yes you can play video from Memory stream using WPF media element.



                      I have used a third party component called boxed app, A million thanks to BoxedApp - http://www.boxedapp.com/boxedappsdk/



                      I have to update the code a tiny bit to make it work for byte. Copy the below constructor to CustomFileStream class from BoxedApp



                      public CustomFileStream(byte data)

                      _Stream = new MemoryStream(data);
                      _Length = _Stream.Length;
                      _data = data;
                      _Offset = 0;



                      Create a wpf application and add a media element and a button and copy the below code



                      public MainWindow()

                      BoxedAppSDK.NativeMethods.BoxedAppSDK_Init();

                      InitializeComponent();


                      private void button2_Click(object sender, RoutedEventArgs e)

                      var MyFileStream = new CustomFileStream(File.ReadAllBytes(@"wildlife.wmv"));

                      IntPtr ptr = BoxedAppSDK.NativeMethods.BoxedAppSDK_CreateVirtualFileBasedOnIStream(
                      @"1.wmv",
                      BoxedAppSDK.NativeMethods.EFileAccess.GenericWrite,
                      BoxedAppSDK.NativeMethods.EFileShare.Read,
                      IntPtr.Zero,
                      BoxedAppSDK.NativeMethods.ECreationDisposition.New,
                      BoxedAppSDK.NativeMethods.EFileAttributes.Normal,
                      IntPtr.Zero,
                      MyFileStream);

                      using (new SafeFileHandle(ptr, true))

                      mediaElement1.Source = new Uri(Path.GetFullPath("1.wmv"));
                      mediaElement1.LoadedBehavior = MediaState.Manual;
                      mediaElement1.Play();




                      - for boxed app please follow the samples and that's it.. you're in a happy world...



                      It's the same thing for QT Player as well.



                      Based on the response I'll add a complete example if the information provided isn't enough.



                      Happy coding....






                      share|improve this answer























                      • Great answer, thanks a lot!

                        – Mafii
                        Jan 23 '18 at 8:27















                      13














                      It might be too late, hopefully this might help if you're still looking for an answer.



                      Yes you can play video from Memory stream using WPF media element.



                      I have used a third party component called boxed app, A million thanks to BoxedApp - http://www.boxedapp.com/boxedappsdk/



                      I have to update the code a tiny bit to make it work for byte. Copy the below constructor to CustomFileStream class from BoxedApp



                      public CustomFileStream(byte data)

                      _Stream = new MemoryStream(data);
                      _Length = _Stream.Length;
                      _data = data;
                      _Offset = 0;



                      Create a wpf application and add a media element and a button and copy the below code



                      public MainWindow()

                      BoxedAppSDK.NativeMethods.BoxedAppSDK_Init();

                      InitializeComponent();


                      private void button2_Click(object sender, RoutedEventArgs e)

                      var MyFileStream = new CustomFileStream(File.ReadAllBytes(@"wildlife.wmv"));

                      IntPtr ptr = BoxedAppSDK.NativeMethods.BoxedAppSDK_CreateVirtualFileBasedOnIStream(
                      @"1.wmv",
                      BoxedAppSDK.NativeMethods.EFileAccess.GenericWrite,
                      BoxedAppSDK.NativeMethods.EFileShare.Read,
                      IntPtr.Zero,
                      BoxedAppSDK.NativeMethods.ECreationDisposition.New,
                      BoxedAppSDK.NativeMethods.EFileAttributes.Normal,
                      IntPtr.Zero,
                      MyFileStream);

                      using (new SafeFileHandle(ptr, true))

                      mediaElement1.Source = new Uri(Path.GetFullPath("1.wmv"));
                      mediaElement1.LoadedBehavior = MediaState.Manual;
                      mediaElement1.Play();




                      - for boxed app please follow the samples and that's it.. you're in a happy world...



                      It's the same thing for QT Player as well.



                      Based on the response I'll add a complete example if the information provided isn't enough.



                      Happy coding....






                      share|improve this answer























                      • Great answer, thanks a lot!

                        – Mafii
                        Jan 23 '18 at 8:27













                      13












                      13








                      13







                      It might be too late, hopefully this might help if you're still looking for an answer.



                      Yes you can play video from Memory stream using WPF media element.



                      I have used a third party component called boxed app, A million thanks to BoxedApp - http://www.boxedapp.com/boxedappsdk/



                      I have to update the code a tiny bit to make it work for byte. Copy the below constructor to CustomFileStream class from BoxedApp



                      public CustomFileStream(byte data)

                      _Stream = new MemoryStream(data);
                      _Length = _Stream.Length;
                      _data = data;
                      _Offset = 0;



                      Create a wpf application and add a media element and a button and copy the below code



                      public MainWindow()

                      BoxedAppSDK.NativeMethods.BoxedAppSDK_Init();

                      InitializeComponent();


                      private void button2_Click(object sender, RoutedEventArgs e)

                      var MyFileStream = new CustomFileStream(File.ReadAllBytes(@"wildlife.wmv"));

                      IntPtr ptr = BoxedAppSDK.NativeMethods.BoxedAppSDK_CreateVirtualFileBasedOnIStream(
                      @"1.wmv",
                      BoxedAppSDK.NativeMethods.EFileAccess.GenericWrite,
                      BoxedAppSDK.NativeMethods.EFileShare.Read,
                      IntPtr.Zero,
                      BoxedAppSDK.NativeMethods.ECreationDisposition.New,
                      BoxedAppSDK.NativeMethods.EFileAttributes.Normal,
                      IntPtr.Zero,
                      MyFileStream);

                      using (new SafeFileHandle(ptr, true))

                      mediaElement1.Source = new Uri(Path.GetFullPath("1.wmv"));
                      mediaElement1.LoadedBehavior = MediaState.Manual;
                      mediaElement1.Play();




                      - for boxed app please follow the samples and that's it.. you're in a happy world...



                      It's the same thing for QT Player as well.



                      Based on the response I'll add a complete example if the information provided isn't enough.



                      Happy coding....






                      share|improve this answer













                      It might be too late, hopefully this might help if you're still looking for an answer.



                      Yes you can play video from Memory stream using WPF media element.



                      I have used a third party component called boxed app, A million thanks to BoxedApp - http://www.boxedapp.com/boxedappsdk/



                      I have to update the code a tiny bit to make it work for byte. Copy the below constructor to CustomFileStream class from BoxedApp



                      public CustomFileStream(byte data)

                      _Stream = new MemoryStream(data);
                      _Length = _Stream.Length;
                      _data = data;
                      _Offset = 0;



                      Create a wpf application and add a media element and a button and copy the below code



                      public MainWindow()

                      BoxedAppSDK.NativeMethods.BoxedAppSDK_Init();

                      InitializeComponent();


                      private void button2_Click(object sender, RoutedEventArgs e)

                      var MyFileStream = new CustomFileStream(File.ReadAllBytes(@"wildlife.wmv"));

                      IntPtr ptr = BoxedAppSDK.NativeMethods.BoxedAppSDK_CreateVirtualFileBasedOnIStream(
                      @"1.wmv",
                      BoxedAppSDK.NativeMethods.EFileAccess.GenericWrite,
                      BoxedAppSDK.NativeMethods.EFileShare.Read,
                      IntPtr.Zero,
                      BoxedAppSDK.NativeMethods.ECreationDisposition.New,
                      BoxedAppSDK.NativeMethods.EFileAttributes.Normal,
                      IntPtr.Zero,
                      MyFileStream);

                      using (new SafeFileHandle(ptr, true))

                      mediaElement1.Source = new Uri(Path.GetFullPath("1.wmv"));
                      mediaElement1.LoadedBehavior = MediaState.Manual;
                      mediaElement1.Play();




                      - for boxed app please follow the samples and that's it.. you're in a happy world...



                      It's the same thing for QT Player as well.



                      Based on the response I'll add a complete example if the information provided isn't enough.



                      Happy coding....







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Dec 21 '11 at 8:53









                      user1108125user1108125

                      13114




                      13114












                      • Great answer, thanks a lot!

                        – Mafii
                        Jan 23 '18 at 8:27

















                      • Great answer, thanks a lot!

                        – Mafii
                        Jan 23 '18 at 8:27
















                      Great answer, thanks a lot!

                      – Mafii
                      Jan 23 '18 at 8:27





                      Great answer, thanks a lot!

                      – Mafii
                      Jan 23 '18 at 8:27











                      12














                      Before anyone wastes hours finding this out for themselves: it is impossible to host the Silverlight MediaElement in a WPF application. The reason for this is that it is one of a number of types that appear in PresentationFramework.dll (unavoidable for WPF) and System.Windows.dll (Silverlight versions) that have the same names and the same namespaces, but are different types.
                      (Someone should explain why we have namespaces to microsoft!)






                      share|improve this answer


















                      • 1





                        This is true. Unfortunately I had to find this out the hard way. :(

                        – rafale
                        Nov 11 '11 at 3:42






                      • 4





                        I know this is a year-old answer, but aren't "multiple distinct types with the same name in the same namespace" the reason that reference aliases exist?

                        – Damien_The_Unbeliever
                        Nov 5 '12 at 9:19






                      • 1





                        It is always possible to make Silverlight Website and use MediaElement there and in WPF applicatione add WebBrowser control with source to that Silverlight website and it is done.

                        – Academy of Programmer
                        Feb 6 '13 at 11:50











                      • yes @Damien_The_Unbeliever my thought at first - but it depends on how it plays out and I've seen situations where similar tricks aren't possible. Though I'd say this still 'might' be possible, with some hacking. Haven't tried though, looks like trouble

                        – NSGaga
                        Apr 12 '14 at 19:54















                      12














                      Before anyone wastes hours finding this out for themselves: it is impossible to host the Silverlight MediaElement in a WPF application. The reason for this is that it is one of a number of types that appear in PresentationFramework.dll (unavoidable for WPF) and System.Windows.dll (Silverlight versions) that have the same names and the same namespaces, but are different types.
                      (Someone should explain why we have namespaces to microsoft!)






                      share|improve this answer


















                      • 1





                        This is true. Unfortunately I had to find this out the hard way. :(

                        – rafale
                        Nov 11 '11 at 3:42






                      • 4





                        I know this is a year-old answer, but aren't "multiple distinct types with the same name in the same namespace" the reason that reference aliases exist?

                        – Damien_The_Unbeliever
                        Nov 5 '12 at 9:19






                      • 1





                        It is always possible to make Silverlight Website and use MediaElement there and in WPF applicatione add WebBrowser control with source to that Silverlight website and it is done.

                        – Academy of Programmer
                        Feb 6 '13 at 11:50











                      • yes @Damien_The_Unbeliever my thought at first - but it depends on how it plays out and I've seen situations where similar tricks aren't possible. Though I'd say this still 'might' be possible, with some hacking. Haven't tried though, looks like trouble

                        – NSGaga
                        Apr 12 '14 at 19:54













                      12












                      12








                      12







                      Before anyone wastes hours finding this out for themselves: it is impossible to host the Silverlight MediaElement in a WPF application. The reason for this is that it is one of a number of types that appear in PresentationFramework.dll (unavoidable for WPF) and System.Windows.dll (Silverlight versions) that have the same names and the same namespaces, but are different types.
                      (Someone should explain why we have namespaces to microsoft!)






                      share|improve this answer













                      Before anyone wastes hours finding this out for themselves: it is impossible to host the Silverlight MediaElement in a WPF application. The reason for this is that it is one of a number of types that appear in PresentationFramework.dll (unavoidable for WPF) and System.Windows.dll (Silverlight versions) that have the same names and the same namespaces, but are different types.
                      (Someone should explain why we have namespaces to microsoft!)







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Nov 8 '11 at 10:37









                      RobertRobert

                      12113




                      12113







                      • 1





                        This is true. Unfortunately I had to find this out the hard way. :(

                        – rafale
                        Nov 11 '11 at 3:42






                      • 4





                        I know this is a year-old answer, but aren't "multiple distinct types with the same name in the same namespace" the reason that reference aliases exist?

                        – Damien_The_Unbeliever
                        Nov 5 '12 at 9:19






                      • 1





                        It is always possible to make Silverlight Website and use MediaElement there and in WPF applicatione add WebBrowser control with source to that Silverlight website and it is done.

                        – Academy of Programmer
                        Feb 6 '13 at 11:50











                      • yes @Damien_The_Unbeliever my thought at first - but it depends on how it plays out and I've seen situations where similar tricks aren't possible. Though I'd say this still 'might' be possible, with some hacking. Haven't tried though, looks like trouble

                        – NSGaga
                        Apr 12 '14 at 19:54












                      • 1





                        This is true. Unfortunately I had to find this out the hard way. :(

                        – rafale
                        Nov 11 '11 at 3:42






                      • 4





                        I know this is a year-old answer, but aren't "multiple distinct types with the same name in the same namespace" the reason that reference aliases exist?

                        – Damien_The_Unbeliever
                        Nov 5 '12 at 9:19






                      • 1





                        It is always possible to make Silverlight Website and use MediaElement there and in WPF applicatione add WebBrowser control with source to that Silverlight website and it is done.

                        – Academy of Programmer
                        Feb 6 '13 at 11:50











                      • yes @Damien_The_Unbeliever my thought at first - but it depends on how it plays out and I've seen situations where similar tricks aren't possible. Though I'd say this still 'might' be possible, with some hacking. Haven't tried though, looks like trouble

                        – NSGaga
                        Apr 12 '14 at 19:54







                      1




                      1





                      This is true. Unfortunately I had to find this out the hard way. :(

                      – rafale
                      Nov 11 '11 at 3:42





                      This is true. Unfortunately I had to find this out the hard way. :(

                      – rafale
                      Nov 11 '11 at 3:42




                      4




                      4





                      I know this is a year-old answer, but aren't "multiple distinct types with the same name in the same namespace" the reason that reference aliases exist?

                      – Damien_The_Unbeliever
                      Nov 5 '12 at 9:19





                      I know this is a year-old answer, but aren't "multiple distinct types with the same name in the same namespace" the reason that reference aliases exist?

                      – Damien_The_Unbeliever
                      Nov 5 '12 at 9:19




                      1




                      1





                      It is always possible to make Silverlight Website and use MediaElement there and in WPF applicatione add WebBrowser control with source to that Silverlight website and it is done.

                      – Academy of Programmer
                      Feb 6 '13 at 11:50





                      It is always possible to make Silverlight Website and use MediaElement there and in WPF applicatione add WebBrowser control with source to that Silverlight website and it is done.

                      – Academy of Programmer
                      Feb 6 '13 at 11:50













                      yes @Damien_The_Unbeliever my thought at first - but it depends on how it plays out and I've seen situations where similar tricks aren't possible. Though I'd say this still 'might' be possible, with some hacking. Haven't tried though, looks like trouble

                      – NSGaga
                      Apr 12 '14 at 19:54





                      yes @Damien_The_Unbeliever my thought at first - but it depends on how it plays out and I've seen situations where similar tricks aren't possible. Though I'd say this still 'might' be possible, with some hacking. Haven't tried though, looks like trouble

                      – NSGaga
                      Apr 12 '14 at 19:54











                      4














                      I know this isn't what you asked for but you can host a VLC ActiveX component inside a window in WPF and then use that VLC control to connect to the stream and display the stream. This is how I got streaming working through WPF.



                      Edit: this page has an example of how to host an ActiveX control inside WPF






                      share|improve this answer




















                      • 2





                        Can I see an example of a WPF application running VLC as an ActiveX component? I'd like to see what it looks like and what's involved in getting it running before I actually go for it.

                        – rafale
                        Aug 20 '11 at 6:02











                      • Hi Stuart, could you post your example using VLC somewhere so that I can have a look. Thanks.

                        – Toan Nguyen
                        Jan 29 '15 at 6:06















                      4














                      I know this isn't what you asked for but you can host a VLC ActiveX component inside a window in WPF and then use that VLC control to connect to the stream and display the stream. This is how I got streaming working through WPF.



                      Edit: this page has an example of how to host an ActiveX control inside WPF






                      share|improve this answer




















                      • 2





                        Can I see an example of a WPF application running VLC as an ActiveX component? I'd like to see what it looks like and what's involved in getting it running before I actually go for it.

                        – rafale
                        Aug 20 '11 at 6:02











                      • Hi Stuart, could you post your example using VLC somewhere so that I can have a look. Thanks.

                        – Toan Nguyen
                        Jan 29 '15 at 6:06













                      4












                      4








                      4







                      I know this isn't what you asked for but you can host a VLC ActiveX component inside a window in WPF and then use that VLC control to connect to the stream and display the stream. This is how I got streaming working through WPF.



                      Edit: this page has an example of how to host an ActiveX control inside WPF






                      share|improve this answer















                      I know this isn't what you asked for but you can host a VLC ActiveX component inside a window in WPF and then use that VLC control to connect to the stream and display the stream. This is how I got streaming working through WPF.



                      Edit: this page has an example of how to host an ActiveX control inside WPF







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Jun 24 '16 at 22:34









                      Travis

                      69111235




                      69111235










                      answered Aug 19 '11 at 6:32









                      stuartmclarkstuartmclark

                      9131119




                      9131119







                      • 2





                        Can I see an example of a WPF application running VLC as an ActiveX component? I'd like to see what it looks like and what's involved in getting it running before I actually go for it.

                        – rafale
                        Aug 20 '11 at 6:02











                      • Hi Stuart, could you post your example using VLC somewhere so that I can have a look. Thanks.

                        – Toan Nguyen
                        Jan 29 '15 at 6:06












                      • 2





                        Can I see an example of a WPF application running VLC as an ActiveX component? I'd like to see what it looks like and what's involved in getting it running before I actually go for it.

                        – rafale
                        Aug 20 '11 at 6:02











                      • Hi Stuart, could you post your example using VLC somewhere so that I can have a look. Thanks.

                        – Toan Nguyen
                        Jan 29 '15 at 6:06







                      2




                      2





                      Can I see an example of a WPF application running VLC as an ActiveX component? I'd like to see what it looks like and what's involved in getting it running before I actually go for it.

                      – rafale
                      Aug 20 '11 at 6:02





                      Can I see an example of a WPF application running VLC as an ActiveX component? I'd like to see what it looks like and what's involved in getting it running before I actually go for it.

                      – rafale
                      Aug 20 '11 at 6:02













                      Hi Stuart, could you post your example using VLC somewhere so that I can have a look. Thanks.

                      – Toan Nguyen
                      Jan 29 '15 at 6:06





                      Hi Stuart, could you post your example using VLC somewhere so that I can have a look. Thanks.

                      – Toan Nguyen
                      Jan 29 '15 at 6:06











                      0














                      As WPF mediaelement internally uses windows media player. If you alter the buffer settings of media player from default buffer setting to custom. Open windows media player  Tools  Options  Performance.



                      When you choose “Buffer” option and set “Seconds of content” to 2. The following registry values will be added under media player.
                      HKEY_CURRENT_USERSoftwareMicrosoftMediaPlayerPreferences
                      UseDefaultBufferTime=0
                      CustomBufferTime=2000



                      You can use dotnet registry class to make changes.
                      Refer this link:
                      https://social.msdn.microsoft.com/Forums/vstudio/en-US/1b4b8fb9-ff8f-4861-8e99-4a7a4fc75596/setting-windows-media-player-properties-in-wpf?forum=wpf#ac879a7f-37bc-4ccc-854d-ab6e047086e5






                      share|improve this answer



























                        0














                        As WPF mediaelement internally uses windows media player. If you alter the buffer settings of media player from default buffer setting to custom. Open windows media player  Tools  Options  Performance.



                        When you choose “Buffer” option and set “Seconds of content” to 2. The following registry values will be added under media player.
                        HKEY_CURRENT_USERSoftwareMicrosoftMediaPlayerPreferences
                        UseDefaultBufferTime=0
                        CustomBufferTime=2000



                        You can use dotnet registry class to make changes.
                        Refer this link:
                        https://social.msdn.microsoft.com/Forums/vstudio/en-US/1b4b8fb9-ff8f-4861-8e99-4a7a4fc75596/setting-windows-media-player-properties-in-wpf?forum=wpf#ac879a7f-37bc-4ccc-854d-ab6e047086e5






                        share|improve this answer

























                          0












                          0








                          0







                          As WPF mediaelement internally uses windows media player. If you alter the buffer settings of media player from default buffer setting to custom. Open windows media player  Tools  Options  Performance.



                          When you choose “Buffer” option and set “Seconds of content” to 2. The following registry values will be added under media player.
                          HKEY_CURRENT_USERSoftwareMicrosoftMediaPlayerPreferences
                          UseDefaultBufferTime=0
                          CustomBufferTime=2000



                          You can use dotnet registry class to make changes.
                          Refer this link:
                          https://social.msdn.microsoft.com/Forums/vstudio/en-US/1b4b8fb9-ff8f-4861-8e99-4a7a4fc75596/setting-windows-media-player-properties-in-wpf?forum=wpf#ac879a7f-37bc-4ccc-854d-ab6e047086e5






                          share|improve this answer













                          As WPF mediaelement internally uses windows media player. If you alter the buffer settings of media player from default buffer setting to custom. Open windows media player  Tools  Options  Performance.



                          When you choose “Buffer” option and set “Seconds of content” to 2. The following registry values will be added under media player.
                          HKEY_CURRENT_USERSoftwareMicrosoftMediaPlayerPreferences
                          UseDefaultBufferTime=0
                          CustomBufferTime=2000



                          You can use dotnet registry class to make changes.
                          Refer this link:
                          https://social.msdn.microsoft.com/Forums/vstudio/en-US/1b4b8fb9-ff8f-4861-8e99-4a7a4fc75596/setting-windows-media-player-properties-in-wpf?forum=wpf#ac879a7f-37bc-4ccc-854d-ab6e047086e5







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jul 10 '15 at 4:11









                          somusomu

                          62




                          62



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f7117589%2fusing-mediaelement-to-play-video-from-stream%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Top Tejano songwriter Luis Silva dead of heart attack at 64

                              政党

                              天津地下鉄3号線