mediaelement events not firing when going from docked to floating

6 posts, 0 answers
  1. Pat
    Pat avatar
    5 posts
    Member since:
    Jun 2010

    Posted 21 Jul 2010 Link to this post

    I posted this on the MS Silverlight site but thought I'd give it a shot here as well. 

    We have a silverlight 3 app with Telerik RadContextMenu controls that has an audio media play in a dockable/floatable pane.  If the media player remains in its initital position, ether docked or floating ,we get a perfect running player over and over, no problems at all and all events fire as expected.

    But.... change the pane from docked to float, or vica versa if floating is the initial state, and all hell breaks lose:(  Events stop firing, media stops playing...bla bla bla. 

    Actually, one other factoid to throw in just to complicate the issue.  If I let the player proceed to completion in the initial pane state the code will reset itself to the beginning and be ready for me to hit the play button again.  If at that point while nothing is happening I change the state from docked to floating as an example and hit play I get on good complete play of the audio with all the events still firing as expected, ie I can pause/stop ... without issue.  The player is requesting the streaming data as our app requires.  But I only get that one play, after that all bets are off adn events do not fire as expected. 

    Any ideas for totally confused PatRinAZ?

  2. George
    Admin
    George avatar
    1332 posts

    Posted 23 Jul 2010 Link to this post

    Hi Pat,

    Thank you for contacting us.

    Can you give us more detailed information about this scenario. What media player control you use? Is it RadMediaPlayer? If you send us a running sample that illustrates the issue it would helps us in investigating the problem.

    I will be glad to assist you further.

    Best wishes,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Richard
    Richard avatar
    2 posts
    Member since:
    May 2010

    Posted 03 Aug 2010 Link to this post

    I get similar behavior.  Going from docked to floating breaks video playback.

    I am using ssme directly.
  5. Pat
    Pat avatar
    5 posts
    Member since:
    Jun 2010

    Posted 03 Aug 2010 Link to this post

    I believe Telerik has already identified this as a Silverlight error.  We have been talking with the MS's Silvelight teas and they know about the issue.  Sadly, nothing to report as far as fix date.

    PatR
  6. Richard
    Richard avatar
    2 posts
    Member since:
    May 2010

    Posted 03 Aug 2010 Link to this post

    Would you happen to have the reasons behind this bug?  workaround?
  7. Pat
    Pat avatar
    5 posts
    Member since:
    Jun 2010

    Posted 03 Aug 2010 Link to this post

    Short answer, we had to implement our own docking logic, it sucks!

    And this was our reply to MS:

    Hi Mahatab,

     

    Thanks for your attention in the matter.

     

    Keep in mind that the MediaElementUserControl is representing a much more complex UI component in our production project.  This is the reason we are reusing the same object in which several resources are utilized to populate it’s content (images and mp3 streams) and that recreating the component would cause noticeable delay and interruption in the user’s experience as the ultimate source for this data is over the web.

     

    Were you able to determine the errant path of code in SetSource()?  I am curious as why the treatment of the Mp3MediaStreamSource is so different upon the second playback post-transfer.

     

    Thanks again,

     

    Jared


    Below was the response from MS:

    Hi Jared,

     

    I have reviewed your code.

     

    I am seeing that you are reusing the same MyStreamingMediaElement object after transferring control to the new spot. Is there any specific reason for that? I believe this is what actually causing MediaElement .SetSource() to lose its previous state. I didn’t able to reproduce the issue by creating a new MyStreamingMediaElement object for each transfer.

     

    Please check the code below:

     

            void LeftTransferButton_Click(object sender, RoutedEventArgs e)

            {

                if (getMediaElementParentTabItem().Name != LeftTabItem.Name)

                {               

                  RightTabItem.Content = null;

                  MyStreamingMediaElement = null;

                  MyStreamingMediaElement = new MediaElementUserControl();

                  LeftTabItem.Content = MyStreamingMediaElement;

                }

            }

     

            void RightTransferButton_Click(object sender, RoutedEventArgs e)

            {

                if (getMediaElementParentTabItem().Name != RightTabItem.Name)

                {

                  LeftTabItem.Content = null;

                  MyStreamingMediaElement = null;

                  MyStreamingMediaElement = new MediaElementUserControl();

                  RightTabItem.Content = MyStreamingMediaElement;

                }

            }

     

    Please let me know if you have any questions regarding this.

Back to Top
DevCraft banner