Skip to main content

Microsoft Silverlight

Answered Question I need a help on playing musicRSS Feed

(0)

banderastyle28
banderas...

Member

Member

9 points

56 Posts

I need a help on playing music

ok here is my problem I'm new to silverlight what I want is when I click a picture on my page it goes to media .wmv clip how do I do that thank you

mchlsync
mchlsync

Star

Star

14606 points

2,730 Posts

Silverlight MVP

Re: I need a help on playing music

Use MediaElement to play the song. Example http://blogs.silverlight.net/blogs/msnow/archive/2008/07/25/tip-of-the-day-22-how-to-add-sound-effects-music-and-video-to-your-silverlight-app.aspx

(If this has answered your question, please click on "Mark as Answer" on this post. Thank you!)

Regards,
Michael Sync
Silverlight MVP

Blog : http://michaelsync.net


Pravinkumar R. D.
Pravinku...

Contributor

Contributor

4300 points

708 Posts

Re: I need a help on playing music

On the MouseLeftButtonDown event of your image control, change the visibility property of you image. And then show the MediaElement control by setting it's visibility property to show the media element. Keep you Media file in ClientBin folder and set the source property of the mediaElement control by the name of your media file. for example - Source="niceday.wmv"

Check the below link for more information on MediaElement-

http://pkrd.blogspot.com/2009/05/working-with-mediaelement-control-in.html

Thanks,

Pravin

"Please mark as answered, if this answers your question"

banderastyle28
banderas...

Member

Member

9 points

56 Posts

Re: I need a help on playing music

Thank  you very much very helpful your llink now my problem I need to build like media player control you know

Pravinkumar R. D.
Pravinku...

Contributor

Contributor

4300 points

708 Posts

Answered Question

Re: I need a help on playing music

Hi,

You can create media Skins using XAML for your MediaElement. Check the below word document. It may help you out.

http://download.microsoft.com/download/0/6/b/06b97375-6594-402d-b627-ab561d0859b2/Creating%20silverlight%20player%20templates.docx

You can even use Expression Bend 3 to design MeidaElement skins. I did it in a very simple way. You use few nice images to design MediaElement. Check this out-

http://pkrd.blogspot.com/2009/05/working-with-mediaelement-control-in.html

Thanks,

Pravin

"Please mark as answered, if this answers your question"

banderastyle28
banderas...

Member

Member

9 points

56 Posts

Re: Re: I need a help on playing music

Hello I apreciate your help here is

the page http://theindieshow.vircas.com/ I want the whole the thing to be a silverlight application when you click on the picture it takes you to a video encoder that I encoded in expression encoder

Pravinkumar R. D.
Pravinku...

Contributor

Contributor

4300 points

708 Posts

Re: Re: I need a help on playing music

This is very simple. Use Expression Blend 3 to make a design like the link shows in your case. Use StackPanel to arrange the images horizontally and vertically. Use the LeftMouseButtonDown event of Image which will show the MediaElement control with the video based on the selection of the Image.

Check the link Below where you can use Silverlight Media Player including the Thumbnails which are encoded with Encoder.

http://silverlight3.codeplex.com/

Thanks,

Pravin

"Please mark as answered, if this answers your question"

 

banderastyle28
banderas...

Member

Member

9 points

56 Posts

Re: Re: I need a help on playing music

thank you for your help now can you tell me how I should put the function on LeftMouseButtondown. Let say I MediaPlayer.xap that I encoded with encoder 3 in my output folder and bear.wmv is my  clip thank youprivate void MediaElement(object sender, System.Windows.Input.MouseButtonEventArgs e)

{

// TODO: Add event handler implementation here.

}

Pravinkumar R. D.
Pravinku...

Contributor

Contributor

4300 points

708 Posts

Re: Re: I need a help on playing music

When you set the source propoerty of the image for example using VS 2008, you can find MouseLeftButtonDown event for every image on which you can write you code.

Thanks,

Pravin

"Please mark as answered, if this answers your question"

banderastyle28
banderas...

Member

Member

9 points

56 Posts

Re: Re: Re: I need a help on playing music

thank you I deeply apreciate your help it helped me a lot

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities