Click here to Skip to main content
15,913,944 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
I have a task in which i have to play different videos on different button clicks.

i have two XAML pages page1 and page2. I have two buttons in page1 and a media element in page2. I have two videos in my local folder. when i click button1 video1 should play and when i click button2 video2 should play.

can anyone suggest me solving this


thanks in advance
Posted
Comments
ridoy 12-Dec-12 4:53am    
you can use mediaelement on button click event..when it is button 1 play vedio 1 in mediaelement and then repeat it for button 2
thursunamy 12-Dec-12 5:12am    
When creating second page instance you can send video full path from the second page constructor as a parameter. And then you can start that video from your media element
Raghavanand 12-Dec-12 6:15am    
can you give me a small idea for that !! i am new to wp development
Raghavanand 12-Dec-12 5:57am    
Thanks for the answers !! can you give me a small example ridoy

1 solution

Get the position of the button by passing values from first page to other using query string on click.

HTML
navigationservice.navigate(new Uri("/xyz.xaml?pos="+char,UriKind.Relative));


get the value to other page using onnavigatedto .

HTML
char = int.Parse(NavigationContext.QueryString["char"]);


Then place the video in a array and call the media element

HTML
string[] videos= new string[]{1.mp4,2.mp4};


then add the source of media element
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900