Share Plugin API


Add the share interface to the player.

Share plugin API

The Share plugin provides JavaScript API for triggering the shared link generation and retrieval as well as invoking the share operation itself:

"doShare" Notification: is used to trigger the shared link generation. You can specify the required time offset by sending a configuration object, for example: { "timeOffset" : "30" }
"shareEvent" Event: is triggered by the plugin once the shared link is generated. It provides access to the generated shared link by accessing the event's "sharedLink" property.
"shareByPlatform" Notification: is used to invoke the share operation without displaying the Share UI on top of the player. The required network is send as a parameter.


Sample code for Share API:
  1. kWidget.addReadyCallback(function( playerId ){
  2. var kdp = $('#' + playerId)[0];
  3. kdp.kBind( 'shareEvent', function(event){
  4. // retrieve the share link
  5. var shareLink = event.shareLink;
  6. });
  7. // trigger share event
  8. kdp.sendNotification( 'doShare' );
  9. // trigger share event with time offset
  10. kdp.sendNotification( 'doShare', { "timeOffset" : "30" } );
  11. // trigger shareByPlatform event
  12. kdp.sendNotification( 'shareByPlatform', 'facebook' );
  13. });
Trigger Share event:
Trigger Share event with time offset of 30 seconds:
Generated Shared Link:

Trigger Share for Platform:  



html5 qunit | flash qunit