Dynamic embed

Dynamic embed has many benefits over object tag or flash library rewrite:
Basic usage of kWidget embed looks like this:
  1. <div id="myEmbedTarget" style="width:400px;height:330px;"></div>
  2. <!-- Substitute {partnerId} for your Kaltura partner id, {uiConfId} for an actual player id, also known as the uiconf id and {entryId} for an actual entry id. -->
  3. <script src="http://cdnapi.kaltura.com/p/{partnerId}/sp/{partnerId}00/embedIframeJs/uiconf_id/{uiConfId}/partner_id/{partnerId}"></script>
  4. <script>
  5. kWidget.embed({
  6. 'targetId': 'myEmbedTarget',
  7. 'wid': '_{partnerId}',
  8. 'uiconf_id' : '{uiConfId}',
  9. 'entry_id' : '{entryId}',
  10. 'flashvars':{ // flashvars allows you to set runtime uiVar configuration overrides.
  11. 'autoPlay': false
  12. },
  13. 'params':{ // params allows you to set flash embed params such as wmode, allowFullScreen etc
  14. 'wmode': 'transparent'
  15. }
  16. });
  17. </script>
kWidget.destroy enables you to cleanly remove a kWidget.embed:
  1. <div id="myEmbedTarget" style="width:400px;height:330px;"></div>
  2. <script src="http://cdnapi.kaltura.com/p/{partnerId}/sp/{partnerId}00/embedIframeJs/uiconf_id/{uiConfId}/partner_id/{partnerId}"></script>
  3. <script>
  4. kWidget.destroy( 'myEmbedTarget' );
  5. </script>
An integrated example which includes SEO and video metadata, plugin configuration flashvars and an inline ready callback
  1. <div id="myVideoContainer" itemprop="video" itemscope itemtype="http://schema.org/VideoObject" >
  2. <div id="myVideoTarget" style="width:400px;height:330px;">
  3. <!-- SEO and video metadata go here -->
  4. <span itemprop="description" content="test folgers coffe"></span>
  5. <span itemprop="name" content="FolgersCoffe.mpeg"></span>
  6. <span itemprop="width" content="400"></span>
  7. <span itemprop="height" content="300"></span>
  8. </div>
  9. </div>
  10. <script>
  11. kWidget.embed({
  12. 'targetId': 'myVideoTarget',
  13. 'wid': '_243342',
  14. 'uiconf_id' : '12905712',
  15. 'entry_id' : '0_uka1msg4',
  16.  
  17. // Plugin configuration / flashvars go here
  18. 'flashvars':{
  19. 'myPlugin':{
  20. 'fooAttribute': 'bar',
  21. 'barAttribute': 'foo'
  22. },
  23. 'autoPlay' : true
  24. },
  25. // Ready callback is issued for this player:
  26. 'readyCallback': function( playerId ){
  27. console.log( "kWidget player ready: " + playerId );
  28. var kdp = $( '#' + playerId ).get(0);
  29. kdp.kBind( 'doPlay', function(){
  30. console.log( "doPlay called on " + playerId );
  31. });
  32. }
  33. });
  34. </script>

html5 qunit | flash qunit