![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | embedded resources as mediaelement source? Hi, I've gotten the mediaelement to play back our WMV9 video file just fine and dandy and now I wanted to embed the video as a resource and have it load from there. However, all I get is a blank screen and no video plays. No errors either. Here's my code: MediaElement myvideo = new MediaElement(); myvideo = new System.Uri("MyAssembly;resource\\video.wmv", System.UriKind.RelativeOrAbsolute); I've validated the Uri object created is valid and even loaded it using System.Windows.Application.GetResourcePart() to verify I could retrieve the video correctly. MediaElement just won't play it. Any ideas? -Winthrop |
My System Specs![]() |
| | #2 (permalink) |
| | Re: embedded resources as mediaelement source? Thanks for the quick reply. Can you please add this as a feature request. We have short pieces of media that we use for progress animation and it'd be much cleaner if it's a resource. Also, we noticed that there's lag when you try to use the mediaElement. It seems that the media is not loaded till you call the play() method. This really causes a 2-3 second lag on a cold startup scenario. Is there any way to pre-cache the media so when you call Play() it will run immediately? Thanks! Winthrop "Ashish Shetty [MSFT]" <ashsh@online.microsoft.com> wrote in message news:%23s00ZnJSGHA.5500@TK2MSFTNGP12.phx.gbl... >I don't think there is support for running media files embedded in the >assembly. Using a simple relative Uri, you can access loose media files >declared as Content in the project file. > > Also, the "MyAssembly;resource\\video.wmv" Uri is invalid. Given the above > restriction, lets consider an image foo.jpg embedded within > MyAssembly.dll. You need to specify <Image > Source="/MyAssembly;component/foo.jpg" /> > > -- > Ashish Shetty [MSFT] > Program Manager, Windows Presentation Foundation (Avalon) > Blog: http://nerddawg.blogspot.com > --- > This posting is provided "AS IS" with no warranties, and confers no > rights. > > > > "Winthrop Chan" <Winthrop Chan@discussions.microsoft.com> wrote in message > news:A2641570-B38F-4E58-869B-E4D3BE584330@microsoft.com... >> Hi, >> >> I've gotten the mediaelement to play back our WMV9 video file just fine >> and >> dandy and now I wanted to embed the video as a resource and have it load >> from >> there. However, all I get is a blank screen and no video plays. No errors >> either. >> >> Here's my code: >> >> MediaElement myvideo = new MediaElement(); >> myvideo = new System.Uri("MyAssembly;resource\\video.wmv", >> System.UriKind.RelativeOrAbsolute); >> >> I've validated the Uri object created is valid and even loaded it using >> System.Windows.Application.GetResourcePart() to verify I could retrieve >> the >> video correctly. MediaElement just won't play it. >> >> Any ideas? >> >> -Winthrop > > |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| DLLs and Embedded Resources | .NET General | |||