locked
[W8.1] MediaElement's DoubleTapped and KeyUp/KeyDown events RRS feed

  • Question

  • Hello,

    1. I have added method to change property of MediaElement, it works when double tap is occurred when MediaElement is not in Full Window state, but when MediaElement is in Full Window state code doesn't work:

            private void Player_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
            {
                Player.IsFullWindow = !Player.IsFullWindow;
    
            }

    2. I try to change Volume property of MediaElement through KeyUp and KeyDown events, but in both cases Volume becomes lower and returns back to default value 0.5 (slider from default controls shows it).

            private void Player_KeyUp(object sender, KeyRoutedEventArgs e)
            {
                Player.Volume = Player.Volume + 0.1;
            }
    
            private void Player_KeyDown(object sender, KeyRoutedEventArgs e)
            {
                Player.Volume = Player.Volume - 0.1;
            }


    • Edited by Andev Monday, October 26, 2015 2:45 PM
    Monday, October 26, 2015 2:45 PM

Answers

  • Hello Andev,

    >> but in this question there is a reply with a solution to use TransportControls property of MediaElement, I tried to check it, but in my case MediaElement instance doesn't have such property.

    This property is available in windows 10 UWP framework. I am not sure what the reason on my side, I do not reproduce this scenario, and for this issue, according to your found information, you could just consider porting your project from 8.1 version to a UWP project.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Andev Wednesday, October 28, 2015 10:40 AM
    Wednesday, October 28, 2015 10:08 AM

All replies

  • Hello Andev,

    >>. I have added method to change property of MediaElement, it works when double tap is…

    With you provided code, I also made a windows 8.1 app and run it on both the windows 8.1 machine and the windows 10 machine, however, on both machines, the double tagged event could work as expected.

    So for your scenario, have a try to run your app on a different machine or share it with us, to check if this would be an environment issue.

    >>2. I try to change Volume property of MediaElement through KeyUp and KeyDown events, but…

    For your second question, according to the forum policy – one question per thread, I would recommend to ask it on a new thread.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 27, 2015 8:09 AM
  • Hello Fred,

    it seems not only I have this problem, found question here

    http://stackoverflow.com/questions/32165988/universal-mediaelement-double-tapped-event

    but in this question there is a reply with a solution to use TransportControls property of MediaElement, I tried to check it, but in my case MediaElement instance doesn't have such property.

    Tried it on machine with Windows 10, double tapped event doesn't work in Full Window state. Tried it on device with Windows RT, double tapped event works in both cases... But on Windows 10 I use mouse and make double click.

    Created new thread for second question.





    • Edited by Andev Tuesday, October 27, 2015 11:28 AM
    Tuesday, October 27, 2015 11:13 AM
  • Hello Andev,

    >> but in this question there is a reply with a solution to use TransportControls property of MediaElement, I tried to check it, but in my case MediaElement instance doesn't have such property.

    This property is available in windows 10 UWP framework. I am not sure what the reason on my side, I do not reproduce this scenario, and for this issue, according to your found information, you could just consider porting your project from 8.1 version to a UWP project.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Andev Wednesday, October 28, 2015 10:40 AM
    Wednesday, October 28, 2015 10:08 AM
  • Hello Andev,

    It seems that you think the KeyDown event intercept the Down Arrow keyboard button only. In fact, it handles the down state of any keyboard button. The KeyUp event handles the Up state of any button.

    In your case, when you press a keyboard button, the DOWN state is triggered, followed by an UP state trigger. So volume is decreased by 0.1 when you press the Down Arrow, but it is also increased when you release the button.

    Best regards


    Sébastien Putier
    Consultant - Formateur technologies Microsoft
    MCPD Développement Windows / Web / Azure
    MCSD Windows Store Apps


    Si un post vous parait utile, n'oubliez pas de le marquer comme utile. S'il répond à votre question, n'oubliez pas de le marquer comme réponse.

    Tuesday, December 1, 2015 10:03 PM