Javascript API example needed

No replies
Joined: 10/13/2010
Points: 44

I am looking to convert my current flash only static video player to a Kaltura based player.

I have my code for the video player below. Can anyone show me a simple example (or point me to one?) of changing the video in the current player via Javascript? For example, I'm showing a thumbnail below below the video player (of a different video). How might I add an on-click handler to change the video for the player to that of the new video in the thumbnail?

Your help is greatly appreciated.

<script type='text/javascript' src='http://html5.kaltura.org/js' ></script>
   
                <script type='text/javascript'>
                        mw.setConfig( 'Kaltura.ServiceUrl' , 'http://media.mysite.com' );
                        mw.setConfig( 'Kaltura.CdnUrl' , 'http://media.mysite.com' );
                        mw.setConfig('Kaltura.ServiceBase', '/api_v3/index.php?service=');
                        mw.setConfig('EmbedPlayer.EnableIframeApi', false );
                        mw.setConfig('EmbedPlayer.UseFlashOnAndroid', false );
                        mw.setConfig('Kaltura.LoadScriptForVideoTags', true );
                        mw.setConfig('Kaltura.AllowRemoteService', true );
                        mw.setConfig('Kaltura.UseAppleAdaptive', false );
                </script>
<object id="kaltura_player_1322069743" name="kaltura_player_1322069743" type="application/x-shockwave-flash" allowFullScreen="true" allowNetworking="all" allowScriptAccess="always" height="333" width="400" bgcolor="#000000" xmlns:dc="http://purl.org/dc/terms/" xmlns:media="http://search.yahoo.com/searchmonkey/media/" rel="media:video" resource="http://media.mysite.com/index.php/kwidget/cache_st/1322069743/wid/_100/uiconf_id/4421494/entry_id/0_o2ob2d53" data="http://media.mysite.com/index.php/kwidget/cache_st/1322069743/wid/_100/uiconf_id/4421494/entry_id/0_o2ob2d53"><param name="allowFullScreen" value="true" /><param name="allowNetworking" value="all" /><param name="allowScriptAccess" value="always" /><param name="bgcolor" value="#000000" /><param name="flashVars" value="&{FLAVOR}" /><param name="movie" value="http://media.mysite.com/index.php/kwidget/cache_st/1322069743/wid/_100/uiconf_id/4421494/entry_id/0_o2ob2d53" /><a href="http://corp.kaltura.com">video platform</a> <a href="http://corp.kaltura.com/video_platform/video_management">video management</a> <a href="http://corp.kaltura.com/solutions/video_solution">video solutions</a> <a href="http://corp.kaltura.com/video_platform/video_publishing">video player</a> <a rel="media:thumbnail" href="http://media.mysite.com/p/100/sp/10000/thumbnail/entry_id/0_o2ob2d53/width/120/height/90/bgcolor/000000/type/2"></a> <span property="dc:description" content=""></span><span property="media:title" content="TV Spot"></span> <span property="media:width" content="400"></span><span property="media:height" content="333"></span> <span property="media:type" content="application/x-shockwave-flash"></span> </object>

<br /><br />

<img src="http://media.mysite.com/p/0/thumbnail/entry_id/0_9gxw0htx/" />