Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

embedded resources as mediaelement source?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 03-15-2006   #1 (permalink)
Winthrop Chan
Guest


 

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 SpecsSystem Spec
Old 03-15-2006   #2 (permalink)
Ashish Shetty [MSFT]
Guest


 

Re: embedded resources as mediaelement source?

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 SpecsSystem Spec
Old 03-15-2006   #3 (permalink)
Winthrop Chan
Guest


 

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 SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
MediaElement performance admin Avalon 1 07-24-2008 11:20 PM
DLLs and Embedded Resources Reuben .NET General 3 03-09-2008 09:11 PM
MediaElement using MediaClock smolyn@gmail.com Avalon 0 03-17-2006 11:03 AM
MediaElement - app crashes when MediaElement is used MueMeister Avalon 2 01-31-2006 06:59 AM
RE: MediaElement - app crashes when MediaElement is used Mark Lawrence Avalon 0 01-31-2006 06:59 AM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51