locked
MediaElement Animation Like Photo

    Question

  • I want to an animation for video in MediaElement like the animation in photo.

    That is when a new video is loaded the video move from left to right and fill the entire region.

    How can I do it in XAML?

    Wednesday, July 31, 2013 3:19 PM

Answers

  • Hello Charlie,

    Video playback takes a lot of processing power. While animating video using the XAML pipeline a separate rendering method may be used. Because of this you will likely never get smooth playback during the animation of the MeidaElement in XAML.

    You have a couple of options.

    1) Start playback of the video. Pause the video. Animate the MediaElement. Continue playback.

    2) Use the Media Engine and D3D to control the playback and animation at the C++ Cx level (theoretically this should work).

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Thursday, August 01, 2013 8:10 PM
    Moderator

All replies

  • Which language are you using so we can move this to the appropriate forum?

    Please also explain in more detail what you are trying to do here. Are you trying to animate the MediaElement onto the page? Are you trying to animate a video within the MediaElement? Something else?

    --Rob

    Thursday, August 01, 2013 2:03 AM
    Owner
  • C++ and XAML are used. I want to animate one video inside the MediaElement. 

    For example, when a new video was loaded the video will be smoothly moved from bottom to top and finally in entire window.

    The effect is similar to live tile in Windows 8.

    I have tested ContentThemeTransition however the result is not satisfied. The animation is not smooth. 

    Thursday, August 01, 2013 1:17 PM
  • Hello Charlie,

    Video playback takes a lot of processing power. While animating video using the XAML pipeline a separate rendering method may be used. Because of this you will likely never get smooth playback during the animation of the MeidaElement in XAML.

    You have a couple of options.

    1) Start playback of the video. Pause the video. Animate the MediaElement. Continue playback.

    2) Use the Media Engine and D3D to control the playback and animation at the C++ Cx level (theoretically this should work).

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Thursday, August 01, 2013 8:10 PM
    Moderator
  • James,

    Your suggestion is cool. However it is hard to integrate C++ and XAML.

    I can add pause when MediaElement opens a file. Then XAML run transitions. But there is nowhere I can run the replay.

    Friday, August 02, 2013 4:31 AM
  • Hello,

    Unfortunately I don't understand what you mean by "nowhere I can run the replay". Can you please clarify?

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, August 07, 2013 9:26 PM
    Moderator
  • 1. I can add pause in MediaOpened C++ code.

    2. I can add transitions in XAML 

    3. I can add play in MediaEnded C++ code???

    my question is statement 3.  after the pause and XAML transition, I need to play the video again. But I think MediaEnded is called in the end of the media.

    Thursday, August 08, 2013 1:57 PM