Search code examples
kaltura

Kaltura Flavor Switching


I am currently using Kaltura HTML5 Player ver. 2.26. The documentation suggests that you can switch between video flavors via the "doSwitch" notification, like so:

kdp.sendNotification("doSwitch", { flavorIndex: 3 });

The video I am using has 6 different flavors according to kdp.evaluate("{mediaProxy.kalturaMediaFlavorArray}"), but running this with various different indices has no discernible effect. I would expect to see the kdp fire a switchingChangeStarted event, as happens when using the Source Selector plugin UI, but there's just silence.

Searching through the github repo for doSwitch, I don't actually see it implemented anywhere. Is this some method a lost relic? If not, how do I get the doSwitch notification to work?


Solution

  • KDP is the Kaltura flash player which has this notification for switching bitrates. The notification is still being used internally when the chromeless flash player is loaded and the source selector button is clicked. But it doesn't look like a V2 player notification.

    You could extend the player by adding a new plugin that will expose such a notification that will switch the source similar to how the source selector is doing it (sourceSelector.js::208):

    _this.getPlayer().switchSrc( source )
    

    Note that the list of sources could have sources that are not playable on desktop, you should not use those for switching.