Click here to Skip to main content
12,445,470 members (62,567 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# Mobile XAML Silverlight , +
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 11-Dec-12 22:16pm
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

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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

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

get the value to other page using onnavigatedto .

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

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

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

then add the source of media element
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 21 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100