This is a migrated thread and some comments may be shown as answers.

mediaelement events not firing when going from docked to floating

5 Answers 41 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Pat
Top achievements
Rank 1
Pat asked on 21 Jul 2010, 08:19 PM

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?

5 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 23 Jul 2010, 03:56 PM
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
0
Richard
Top achievements
Rank 1
answered on 03 Aug 2010, 01:27 PM
I get similar behavior.  Going from docked to floating breaks video playback.

I am using ssme directly.
0
Pat
Top achievements
Rank 1
answered on 03 Aug 2010, 02:42 PM
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
0
Richard
Top achievements
Rank 1
answered on 03 Aug 2010, 03:02 PM
Would you happen to have the reasons behind this bug?  workaround?
0
Pat
Top achievements
Rank 1
answered on 03 Aug 2010, 09:49 PM

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.

Tags
Docking
Asked by
Pat
Top achievements
Rank 1
Answers by
George
Telerik team
Richard
Top achievements
Rank 1
Pat
Top achievements
Rank 1
Share this question
or