I have a SerialElement and it contains two MediaElement first one for ad_video and second for normal_video. So I am first displaying ad then video using this. Now my problem is I want to disable controls like play, pause etc when ad ie first MediaElement is getting played and then also detect if it has finished to start displaying all the controls for the second normal video. Are the any events which I can use for this or any other approach.
Thanks and Regards,
First of all you should check the MASTPlugin. It tries to achieve exactly the same behavior that you describe. Check it's source code here: http://opensource.adobe.com/svn/opensource/osmf/trunk/plugins/samples/MASTPluginNew/
Normally, this behavior is achieved by updating traits - and OSMF players should react to trait changes. For example if you remove(or block) the SeekTrait, you should not be able to seek until the trait is added back. The same should be achieved for play/pause.
In practice, you'll see that some players do not react appropriately to trait changes (for ex. Strobe Media Playback currently won't disable the pause button, even if the video cannot be paused).
Does this help?
We have such an example here:
You would wrap the first VideoElement in this UnseekableProxyElement before adding it to the SerialElement.