Skip to main content

Microsoft Silverlight

Answered Question Media element to play backwards.RSS Feed

(0)

tjcombo
tjcombo

Member

Member

4 points

27 Posts

Media element to play backwards.

Hallo, I have a media element, i can make it play forwards, but i want to learn how to make it play backwards. anybody know ?

Different day, same thing.

ekleeman
ekleeman

Member

Member

59 points

42 Posts

Re: Media element to play backwards.

Well, you could take the Position property and wind it backwards programatically in a loop but you would not have audio.

This code will reverse the video by 5 seconds....

TimeSpan current = new TimeSpan();

current = MediaElement.Position;

TimeSpan SubtractTime = new TimeSpan(0, 0, 5);

// Do not go below zero position

MediaElement.Position = current.Subtract(SubtractTime);

tjcombo
tjcombo

Member

Member

4 points

27 Posts

Re: Re: Media element to play backwards.

how do i place your code in my code? this is my code:

 namespace vijeevi

{

public partial class MainPage : UserControl

{

public MainPage()

{

// Required to initialize variables

InitializeComponent();

}private void bt_click(object sender, System.Windows.RoutedEventArgs e)

{

// TODO: Add event handler implementation here.

jeevi_viji_wmv.Play();

}

private void click_reverse(object sender, System.Windows.RoutedEventArgs e)

{

// TODO: Add event handler implementation here.

// Want it to play backwards when clicked here.

 

 

}

 

}

}

Different day, same thing.

ekleeman
ekleeman

Member

Member

59 points

42 Posts

Re: Re: Media element to play backwards.

Just place the reverse code in click_reverse

tjcombo
tjcombo

Member

Member

4 points

27 Posts

Re: Re: Re: Media element to play backwards.

namespace vijeevi

{

public partial class MainPage : UserControl

{

public MainPage()

{

// Required to initialize variables

InitializeComponent();

}

private void bt_click(object sender, System.Windows.RoutedEventArgs e)

{

// TODO: Add event handler implementation here.

jeevi_viji_wmv.Play();

}

private void click_reverse(object sender, System.Windows.RoutedEventArgs e)

{

// TODO: Add event handler implementation here.

 

TimeSpan current =
new TimeSpan();

 

current = jeevi_viji_wmv.Position;

 

TimeSpan SubtractTime =
new TimeSpan(0, 0, 5);

 

// Do not go below zero position

 

jeevi_viji_wmv.Position = current.Subtract(SubtractTime);

}

}

}

------- This doesnt work.

Different day, same thing.

Min-Hong Tang - MSFT
Min-Hong...

Contributor

Contributor

3619 points

412 Posts

Answered Question

Re: Media element to play backwards.

Hi,

   I am afraid media element does not support such a function directly. Based on my knowledge, there is only one workaround that is to control the MediaElement's position property. And it will not achieve an effect like you are using your dvd player.

   Always it's more like a slide show along with sound snippets.

Best Regards

  

Min-Hong Tang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities