locked
IsMuted not working ? RRS feed

  • Question

  • Hello,

    I'm trying to implement a mute button on my UI. The documentation clearly states that the IsMuted property should be called on the MediaElement. But I'm receiving "Invalid procedure call or argument" error.

    Guess the doc or the CTP is incomplete!

    Cheers,
    Pascal

     

    NB: Would be great to have the doc in a more standard format with search capabilities !

    Tuesday, March 13, 2007 8:05 PM

Answers

  • It definately works. Check out the Channel9 Player example. The code that mutes it is:

    //--Mute Button
    function MuteMouseUp(sender,args)
    {
        if (muted == "unmuted") {
            mediaElement.SetValue("IsMuted", 1);
            muted = "muted";
            mutedIcon.SetValue("Opacity", 1);
            audio1Icon.SetValue("Opacity", 0);
            audio2Icon.SetValue("Opacity", 0);
        }
        else {
            mediaElement.SetValue("IsMuted", 0);
            muted = "unmuted";
            mutedIcon.SetValue("Opacity", 0);
            audio1Icon.SetValue("Opacity", 1);
            audio2Icon.SetValue("Opacity", 1);
        }
    }

     

    Tuesday, March 13, 2007 9:43 PM

All replies

  • It definately works. Check out the Channel9 Player example. The code that mutes it is:

    //--Mute Button
    function MuteMouseUp(sender,args)
    {
        if (muted == "unmuted") {
            mediaElement.SetValue("IsMuted", 1);
            muted = "muted";
            mutedIcon.SetValue("Opacity", 1);
            audio1Icon.SetValue("Opacity", 0);
            audio2Icon.SetValue("Opacity", 0);
        }
        else {
            mediaElement.SetValue("IsMuted", 0);
            muted = "unmuted";
            mutedIcon.SetValue("Opacity", 0);
            audio1Icon.SetValue("Opacity", 1);
            audio2Icon.SetValue("Opacity", 1);
        }
    }

     

    Tuesday, March 13, 2007 9:43 PM
  • Thanks for the quick answer, still learning. The documentation states: (for scripting)

    value = object.IsMuted;
    object.IsMuted = value;

    and not that you have to manage the muted state in another variable and that you have to use a method to get/set the value.

    BTW, it would also simply the programming of the client if an event would be raised whenever the mute state is changed on the MediaElement.

    Pascal

    Wednesday, March 14, 2007 5:39 AM