r87634 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87633‎ | r87634 | r87635 >
Date:14:48, 7 May 2011
Author:dale
Status:deferred
Tags:
Comment:
some code comment clean up
stubs for TimedTextPage
Modified paths:
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/EmbedPlayer.config.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/binPlayers/kaltura-player/README (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerJava.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerKplayer.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerNative.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerVlc.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/common (added) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/common/vid_default_thumb.jpg (added) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/TimedText/TimedText.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/TimedMediaHandler.hooks.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/TimedMediaHandler.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/TimedTextPage.php (added) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.php
@@ -115,6 +115,7 @@
116116
117117 // Text handler
118118 $wgAutoloadClasses['TextHandler'] = "$timedMediaDir/handlers/TextHandler/TextHandler.php";
 119+$wgAutoloadClasses['TimedTextPage'] = "$timedMediaDir/TimedTextPage.php";
119120
120121 // Transcode support
121122 $wgAutoloadClasses['WebVideoTranscodeJob'] = "$timedMediaDir/WebVideoTranscode/WebVideoTranscodeJob.php";
Index: trunk/extensions/TimedMediaHandler/TimedTextPage.php
@@ -0,0 +1,27 @@
 2+<?php
 3+/**
 4+ * TimedText page display the current video with subtitles to the right.
 5+ *
 6+ * Future features for this page"
 7+ * @todo add srt download links
 8+ * @todo parse and validate srt files
 9+ * @todo link-in or include the universal subtitles editor
 10+ */
 11+class TimedTextPage extends Article {
 12+ public function view() {
 13+ global $wgOut, $wgShowEXIF, $wgRequest, $wgUser;
 14+
 15+ $diff = $wgRequest->getVal( 'diff' );
 16+ $diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );
 17+
 18+ if ( $this->mTitle->getNamespace() != NS_TIMEDTEXT || ( isset( $diff ) && $diffOnly ) ) {
 19+ return parent::view();
 20+ }
 21+
 22+ // Set title
 23+ $wgOut->setPageTitle( wfMsg('mwe-timedtext-language-subtitles-for-clip', ) );
 24+
 25+ // Set two page devider
 26+
 27+ }
 28+}
\ No newline at end of file
Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.hooks.php
@@ -48,20 +48,17 @@
4949 )
5050 );
5151
52 - // We should probably move this to a parser function but not working correctly in
 52+ // We should probably move this script output to a parser function but not working correctly in
5353 // dynamic contexts ( for example in special upload, when there is an "existing file" warning. )
5454 $wgHooks['BeforePageDisplay'][] = 'TimedMediaHandlerHooks::pageOutputHook';
5555
56 - // Add a hook for article deletion so that we remove transcode settings.
 56+ // Add a hook for article deletion so that we remove transcode settings / files.
5757 $wgHooks['ArticleDeleteComplete'][] = 'TimedMediaHandlerHooks::checkArticleDeleteComplete';
5858
59 -
60 - // Add unit tests
61 - $wgHooks['UnitTestsList'][] = 'TimedMediaHandlerHooks::registerUnitTests';
62 -
6359 // Exclude transcoded assets from normal thumbnail purging
6460 // ( a maintenance script could handle transcode asset purging)
6561 $wgExcludeFromThumbnailPurge = array_merge( $wgExcludeFromThumbnailPurge, $tmhFileExtensions );
 62+
6663 // Also add the .log file ( used in two pass encoding )
6764 // ( probably should move in-progress encodes out of web accessible directory )
6865 $wgExcludeFromThumbnailPurge[] = 'log';
@@ -72,7 +69,10 @@
7370 );
7471
7572 $wgHooks['LoadExtensionSchemaUpdates'][] = 'TimedMediaHandlerHooks::loadExtensionSchemaUpdates';
76 -
 73+
 74+ // Add unit tests
 75+ $wgHooks['UnitTestsList'][] = 'TimedMediaHandlerHooks::registerUnitTests';
 76+
7777
7878 /**
7979 * Add support for the "TimedText" NameSpace
@@ -83,12 +83,22 @@
8484 $wgExtraNamespaces[NS_TIMEDTEXT] = "TimedText";
8585 $wgExtraNamespaces[NS_TIMEDTEXT_TALK] = "TimedText_talk";
8686
 87+ // if on a timed text page, display timed text page:
 88+ $wgHooks[ 'ArticleFromTitle' ][] = 'TimedMediaHandlerHooks::checkForTimedTextPage';
 89+
8790 return true;
8891 }
8992
 93+ public static function checkForTimedTextPage( &$title, &$article ){
 94+ if( $title->getNamespace() == NS_TIMEDTEXT ) {
 95+ $article = new TimedTextPage( $title );
 96+ }
 97+ return true;
 98+ }
 99+
90100 public static function checkArticleDeleteComplete( &$article, &$user, $reason, $id ){
91101 // Check if the article is a file and remove transcode jobs:
92 - if( $article->getTitle()->getNamespace() == NS_FILE ){
 102+ if( $article->getTitle()->getNamespace() == NS_FILE ) {
93103 // We can't get the file since the article is deleted :(
94104 // so we can't:
95105 // $file = wfFindFile( $article->getTitle() );
@@ -137,7 +147,6 @@
138148 }
139149
140150 static function pageOutputHook( &$out, &$sk ){
141 - // FIXME we should only need to add this via parser output hook
142151 $out->addModules( 'PopUpMediaTransform' );
143152 $out->addModuleStyles( 'PopUpMediaTransform' );
144153 return true;
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/TimedText/TimedText.php
@@ -6,7 +6,8 @@
77 'scripts' => "resources/mw.TimedText.js",
88 'styles' => "resources/mw.style.TimedText.css",
99 'dependencies' => array(
10 - 'mw.EmbedPlayer',
 10+ 'mw.EmbedPlayer',
 11+ 'mw.Api',
1112 'mw.Language.names',
1213 'jquery.ui.dialog',
1314 ),
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/EmbedPlayer.config.php
@@ -3,12 +3,14 @@
44 * Do not edit this file instead use LocalSettings.php and
55 * $wgMwEmbedModuleConfig[ {configuration name} ] = value; format
66 */
7 -
87 return array (
 8+ // The relative ( or absolute ) path to the EmbedPlayer folder
 9+ 'EmbedPlayer.WebPath' => "modules/EmbedPlayer/",
 10+
911 // If the player controls should be overlaid on top of the video ( if supported by playback method)
1012 // can be set to false per embed player via overlayControls attribute
1113 'EmbedPlayer.OverlayControls' => true,
12 -
 14+
1315 // The preferred media codec preference
1416 // Note user selected format order
1517 'EmbedPlayer.CodecPreference' => array( 'webm', 'h264', 'ogg' ),
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/binPlayers/kaltura-player/README
@@ -12,7 +12,6 @@
1313 http://www.kaltura.org/kdp-dynamic-player-and-playlist-widget
1414
1515
16 -
1716 File: expressInstall.swf
1817 is part of SWFObject v2.2 <http://code.google.com/p/swfobject/>
1918 and is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
@@ -1393,9 +1393,7 @@
13941394 $( '#new_img_thumb_' + _this.id ).attr( 'id', 'img_thumb_' + _this.id );
13951395 $( '#img_thumb_' + _this.id ).css( 'z-index', '1' );
13961396 _this.thumbnail_updating = false;
1397 - // mw.log("done fadding in "+
1398 - // $('#img_thumb_'+_this.id).attr("src"));
1399 -
 1397+
14001398 // if we have a thumb queued update to that
14011399 if ( _this.last_thumb_url ) {
14021400 var src_url = _this.last_thumb_url;
@@ -1406,14 +1404,15 @@
14071405 }
14081406 }
14091407 },
1410 - // update the video poster:
 1408+ /**
 1409+ * Update the poster source
 1410+ * @param {String} url to poster src
 1411+ */
14111412 updatePosterSrc: function( posterSrc ){
14121413 this.poster = posterSrc;
14131414 },
14141415 /**
1415 - * Returns the HTML code for the video when it is in thumbnail mode.
1416 - * playing, configuring the player, inline cmml display, HTML linkback,
1417 - * download, and embed code.
 1416+ * Update the player with thumbnail and play button.
14181417 */
14191418 updatePosterHTML: function () {
14201419 mw.log( 'EmbedPlayer:updatePosterHTML::' + this.id );
@@ -1428,14 +1427,14 @@
14291428
14301429 // Set by default thumb value if not found
14311430 var posterSrc = ( this.poster ) ? this.poster :
1432 - mw.getConfig( 'imagesPath' ) + 'vid_default_thumb.jpg';
 1431+ mw.getConfig( 'EmbedPlayer.WebPath' ) + 'resources/skins/common/vid_default_thumb.jpg';
14331432
14341433 // Update PersistentNativePlayer poster:
14351434 if( this.isPersistentNativePlayer() ){
14361435 $( '#' + this.pid ).attr('poster', posterSrc);
14371436 } else {
14381437 // Poster support is not very consistent in browsers
1439 - // use a jpg poster image:
 1438+ // use a jpeg poster image:
14401439 $( this ).html(
14411440 $( '<img />' )
14421441 .css({
@@ -1462,8 +1461,6 @@
14631462 /**
14641463 * Checks if native controls should be used
14651464 *
1466 - * @param [player]
1467 - * Object Optional player object to check controls attribute
14681465 * @returns boolean true if the mwEmbed player interface should be used
14691466 * false if the mwEmbed player interface should not be used
14701467 */
@@ -1555,6 +1552,9 @@
15561553 }
15571554 return ;
15581555 },
 1556+ /**
 1557+ * Adds a play button to the player
 1558+ */
15591559 addPlayBtnLarge:function(){
15601560 var _this = this;
15611561 var $pid = $( '#' + _this.pid );
@@ -1569,7 +1569,8 @@
15701570 );
15711571 },
15721572 /**
1573 - * Should be set via native embed support
 1573+ * Abstract method,
 1574+ * Get native player html ( should be set by mw.EmbedPlayerNative )
15741575 */
15751576 getNativePlayerHtml: function(){
15761577 return $('<div />' )
@@ -1598,12 +1599,12 @@
15991600 },
16001601
16011602 /**
1602 - * Get the share embed object code
 1603+ * Get the share iframe embed code
16031604 *
16041605 * NOTE this could probably share a bit more code with getShareEmbedVideoJs
16051606 */
16061607 getShareIframeObject: function(){
1607 - // allow modules to generate the iframe:
 1608+ // Allow modules to generate the iframe embed code:
16081609 var iframeEmbedCode ={};
16091610 var iframeUrl = false
16101611 $( this ).trigger( 'GetShareIframeSrc', function( localIframeSrc ){
@@ -1612,7 +1613,7 @@
16131614 }
16141615 iframeUrl = localIframeSrc;
16151616 });
1616 -
 1617+
16171618 if( !iframeUrl ){
16181619 iframeUrl = this.getIframeSourceUrl()
16191620 }
@@ -1631,7 +1632,9 @@
16321633 // Return the embed code
16331634 return embedCode;
16341635 },
1635 -
 1636+ /**
 1637+ * Get a url friendly set of sources for passing to the iframe embed
 1638+ */
16361639 getIframeSourceUrl: function(){
16371640 // Point to raw files:
16381641 var iframeUrl = mw.getMwEmbedPath() + 'mwEmbedFrame.php?';
@@ -1741,8 +1744,13 @@
17421745 /**
17431746 * The Play Action
17441747 *
1745 - * Handles play requests, updates relevant states: seeking =false paused =
1746 - * false Updates pause button Starts the "monitor"
 1748+ * Handles play requests, updates relevant states:
 1749+ * seeking =false
 1750+ * paused =false
 1751+ *
 1752+ * Triggers the play event
 1753+ *
 1754+ * Updates pause button Starts the "monitor"
17471755 */
17481756 play: function() {
17491757 var _this = this;
@@ -1798,9 +1806,6 @@
17991807 },
18001808 /**
18011809 * Base embed pause Updates the play/pause button state.
1802 - *
1803 - * There is no general way to pause the video must be overwritten by embed
1804 - * object to support this functionality.
18051810 */
18061811 pause: function( event ) {
18071812 var _this = this;
@@ -1845,15 +1850,19 @@
18461851 */
18471852 load: function() {
18481853 // should be done by child (no base way to pre-buffer video)
1849 - mw.log( 'baseEmbed:load call' );
 1854+ mw.log( 'BaseEmbed:load call' );
18501855 },
18511856
18521857
18531858 /**
18541859 * Base embed stop
18551860 *
1856 - * Updates the player to the stop state shows Thumbnail resets Buffer resets
1857 - * Playhead slider resets Status
 1861+ * Updates the player to the stop state.
 1862+ *
 1863+ * Shows Thumbnail
 1864+ * Resets Buffer
 1865+ * Resets Playhead slider
 1866+ * Resets Status
18581867 */
18591868 stop: function() {
18601869 var _this = this;
@@ -1902,7 +1911,7 @@
19031912 * Base Embed mute
19041913 *
19051914 * Handles interface updates for toggling mute. Plug-in / player interface
1906 - * must handle the actual media player update
 1915+ * must handle the actual media player action
19071916 */
19081917 toggleMute: function() {
19091918 mw.log( 'f:toggleMute:: (old state:) ' + this.muted );
@@ -1963,15 +1972,17 @@
19641973 },
19651974
19661975 /**
1967 - * Abstract Update volume Method must be override by plug-in / player
1968 - * interface
 1976+ * Abstract method Update volume Method must be override by plug-in / player interface
 1977+ *
 1978+ * @param {float}
 1979+ * percent Percentage volume to update
19691980 */
19701981 setPlayerElementVolume: function( percent ) {
19711982 mw.log('Error player does not support volume adjustment' );
19721983 },
19731984
19741985 /**
1975 - * Abstract get volume Method must be override by plug-in / player interface
 1986+ * Abstract method get volume Method must be override by plug-in / player interface
19761987 * (if player does not override we return the abstract player value )
19771988 */
19781989 getPlayerElementVolume: function(){
@@ -1980,7 +1991,7 @@
19811992 },
19821993
19831994 /**
1984 - * Abstract get volume muted property must be overwritten by plug-in /
 1995+ * Abstract method get volume muted property must be overwritten by plug-in /
19851996 * player interface (if player does not override we return the abstract
19861997 * player value )
19871998 */
@@ -2039,19 +2050,22 @@
20402051 return this.posterDisplayed;
20412052 },
20422053
2043 - // TODO temporary hack we need a better stop monitor system
 2054+ /**
 2055+ * Stop the play state monitor
 2056+ */
20442057 stopMonitor: function(){
20452058 clearInterval( this.monitorInterval );
20462059 this.monitorInterval = 0;
20472060 },
2048 - // TODO temporary hack we need a better stop monitor system
 2061+ /**
 2062+ * Start the play state monitor
 2063+ */
20492064 startMonitor: function(){
20502065 this.monitor();
20512066 },
20522067
20532068 /**
2054 - * Checks if the currentTime was updated outside of the getPlayerElementTime
2055 - * function
 2069+ * Checks if the currentTime was updated outside of the getPlayerElementTime function
20562070 */
20572071 checkForCurrentTimeSeek: function(){
20582072 var _this = this;
@@ -2070,8 +2084,8 @@
20712085 },
20722086
20732087 /**
2074 - * Monitor playback and update interface components. underling plugin
2075 - * objects are responsible for updating currentTime
 2088+ * Monitor playback and update interface components. underling player classes
 2089+ * are responsible for updating currentTime
20762090 */
20772091 monitor: function() {
20782092 var _this = this;
@@ -2122,7 +2136,7 @@
21232137 _this.muted = _this.getPlayerElementMuted();
21242138 }
21252139
2126 - //mw.log( 'Monitor:: ' + this.currentTime + ' duration: ' + ( parseInt(
 2140+ // mw.log( 'Monitor:: ' + this.currentTime + ' duration: ' + ( parseInt(
21272141 // this.getDuration() ) + 1 ) + ' is seeking: ' + this.seeking );
21282142
21292143 if ( this.currentTime >= 0 && this.duration ) {
@@ -2164,7 +2178,7 @@
21652179 // Update buffer information
21662180 this.updateBufferStatus();
21672181
2168 - // run the "native" progress event on the virtual html5 object if set
 2182+ // Trigger the "progress" event per HTML5 api support
21692183 if( this.progressEventData ) {
21702184 // mw.log("trigger:progress event on html5 proxy");
21712185 if( _this._propagateEvents ){
@@ -2172,8 +2186,8 @@
21732187 }
21742188 }
21752189
2176 - // Call monitor at 250ms interval. ( use setInterval to avoid stacking
2177 - // monitor requests )
 2190+ // Call monitor at this.monitorRate interval.
 2191+ // ( use setInterval to avoid stacking monitor requests )
21782192 if( ! this.isStopped() ) {
21792193 if( !this.monitorInterval ){
21802194 this.monitorInterval = setInterval( function(){
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/common/vid_default_thumb.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/common/vid_default_thumb.jpg
___________________________________________________________________
Added: svn:mime-type
21812195 + application/octet-stream
Added: svn:executable
21822196 + *
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerJava.js
@@ -1,22 +1,21 @@
2 -/**
3 -* List of domains and hosted location of cortado. Lets clients avoid the security warning for cross domain cortado
4 -*/
52 ( function( mw, $ ) {
6 -
 3+/**
 4+* List of domains and hosted location of cortado. Lets clients avoid the security warning
 5+* for cross domain java applet loading.
 6+*/
77 window.cortadoDomainLocations = {
88 'upload.wikimedia.org' : 'http://upload.wikimedia.org/jars/cortado.jar'
99 };
1010
11 -// Set the default location for CortadoApplet
12 -mw.setDefaultConfig( 'relativeCortadoAppletPath',
13 - mw.getMwEmbedPath() + 'modules/EmbedPlayer/binPlayers/cortado/cortado-ovtk-stripped-0.6.0.jar'
14 -);
15 -
1611 mw.EmbedPlayerJava = {
1712
1813 // Instance name:
1914 instanceOf: 'Java',
 15+
 16+ // Set the local applet location for CortadoApplet
 17+ localAppletLocation: mw.getConfig('EmbedPlayer.WebPath' ) + /binPlayers/cortado/cortado-ovtk-stripped-0.6.0.jar'
2018
 19+
2120 // Supported feature set of the cortado applet:
2221 supports: {
2322 'playHead' : true,
@@ -64,7 +63,7 @@
6564 $( this ).html( appletCode );
6665
6766 // Wrap it in an iframe to avoid hanging the event thread in FF 2/3 and similar
68 - // NOTE: This breaks reference to the applet so disabled for now:
 67+ // NOTE: This breaks javascript reference to the applet so disabled for now:
6968 /*if ( $.browser.mozilla ) {
7069 var iframe = document.createElement( 'iframe' );
7170 iframe.setAttribute( 'width', this.getWidth() );
@@ -113,7 +112,7 @@
114113 }
115114 } else {
116115 // Get the local relative cortado applet location:
117 - appletLoc = mw.getConfig( 'relativeCortadoAppletPath' );
 116+ appletLoc = this.localAppletLocation;
118117 }
119118 return appletLoc;
120119 },
@@ -128,14 +127,7 @@
129128 try {
130129 // java reads ogg media time.. so no need to add the start or seek offset:
131130 //mw.log(' ct: ' + this.playerElement.getPlayPosition() + ' ' + this.supportsURLTimeEncoding());
132 -
133131 currentTime = this.playerElement.currentTime;
134 - // ( java cortado has -1 time ~sometimes~ )
135 - /*if ( this.currentTime < 0 ) {
136 - mw.log( 'pp:' + this.currentTime );
137 - // Probably reached clip ( should fire ondone event instead )
138 - this.onClipDone();
139 - }*/
140132 } catch ( e ) {
141133 mw.log( 'could not get time from jPlayer: ' + e );
142134 }
@@ -147,7 +139,8 @@
148140
149141 /**
150142 * Seek in the ogg stream
151 - * ( Cortado seek does not seem to work very well )
 143+ * NOTE: Cortado seek does not seem to work very well.
 144+ *
152145 * @param {Float} percentage Percentage to seek into the stream
153146 */
154147 doSeek: function( percentage ) {
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerVlc.js
@@ -351,7 +351,7 @@
352352 try{
353353 this.playerElement.video.toggleFullscreen();
354354 } catch ( e ){
355 - mw.log("VlcEmbed toggle fullscreen : possible error: " + e);
 355+ mw.log("VlcEmbed:: toggle fullscreen : possible error: " + e);
356356 }
357357 }
358358 }
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerNative.js
@@ -259,7 +259,7 @@
260260
261261 /**
262262 * Do a native seek by updating the currentTime
263 - * @param {float} percentage
 263+ * @param {Float} percentage
264264 * Percent to seek to of full time
265265 */
266266 doNativeSeek: function( percentage ) {
@@ -502,7 +502,8 @@
503503 /**
504504 * Update Volume
505505 *
506 - * @param {Float} percentage Value between 0 and 1 to set audio volume
 506+ * @param {Float}
 507+ * percentage Value between 0 and 1 to set audio volume
507508 */
508509 setPlayerElementVolume : function( percentage ) {
509510 if ( this.getPlayerElement() ) {
@@ -526,7 +527,7 @@
527528 }
528529 },
529530 /**
530 - * get the native muted state
 531+ * Get the native muted state
531532 */
532533 getPlayerElementMuted: function(){
533534 if ( this.getPlayerElement() ) {
@@ -544,7 +545,7 @@
545546 },
546547
547548 /**
548 - * load the video stream with a callback fired once the video is "loaded"
 549+ * Load the video stream with a callback fired once the video is "loaded"
549550 *
550551 * @parma {Function} callbcak Function called once video is loaded
551552 */
@@ -565,7 +566,7 @@
566567 },
567568
568569 /**
569 - * Get /update the playerElement value
 570+ * Get / update the playerElement value
570571 */
571572 getPlayerElement: function () {
572573 this.playerElement = $( '#' + this.pid ).get( 0 );
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerKplayer.js
@@ -1,5 +1,7 @@
2 -/*
 2+/**
33 * The "kaltura player" embedPlayer interface for fallback h.264 and flv video format support
 4+ *
 5+ * Note once the flash supports webm we can also support that here.
46 */
57 // Called from the kdp.swf
68 ( function( mw, $ ) {
@@ -27,7 +29,7 @@
2830 // Stores the current time as set from flash
2931 flashCurrentTime : 0,
3032
31 - /*
 33+ /**
3234 * Write the Embed html to the target
3335 */
3436 doEmbedHTML : function() {
@@ -103,7 +105,7 @@
104106 },
105107
106108 /**
107 - * javascript run post player embedding
 109+ * JavaScript run post player embedding
108110 */
109111 postEmbedJS : function() {
110112 var _this = this;
@@ -138,7 +140,7 @@
139141 /**
140142 * Bind a Player Function,
141143 *
142 - * Does some tricker to bind to "this" player instance:
 144+ * Creates a unique global function to bind to "this" player instance:
143145 *
144146 * @param {String}
145147 * flash binding name
@@ -156,7 +158,7 @@
157159 embedPlayer[methodName](data);
158160 }
159161 };
160 - }(gKdpCallbackName, this);
 162+ }( gKdpCallbackName, this );
161163
162164 // Add the listener to the KDP flash player:
163165 this.playerElement.addJsListener(bindName, gKdpCallbackName);
@@ -177,15 +179,18 @@
178180 onPlay : function() {
179181 this.parent_play();
180182 },
181 -
 183+ /**
 184+ * handles duration change event
 185+ */
182186 onDurationChange : function(data, id) {
183 - mw.log(" onDurationChange: " + data.newValue);
 187+ mw.log("KPlayer::onDurationChange: " + data.newValue);
184188 // update the duration:
185189 this.duration = data.newValue;
186190 },
187191
188192 /**
189 - * play method calls parent_play to update the interface
 193+ * Play method sends the play request to the flash applet
 194+ * and calls parent_play to update the interface
190195 */
191196 play : function() {
192197 if (this.playerElement && this.playerElement.sendNotification) {
@@ -195,7 +200,8 @@
196201 },
197202
198203 /**
199 - * pause method calls parent_pause to update the interface
 204+ * Pause method sends the pause event to flash applet
 205+ * and calls parent_pause to update the interface
200206 */
201207 pause : function() {
202208 if (this.playerElement && this.playerElement.sendNotification) {
@@ -210,7 +216,7 @@
211217 * @param {Float}
212218 * percentage Percentage of total stream length to seek to
213219 */
214 - doSeek : function(percentage) {
 220+ doSeek: function( percentage ) {
215221 var _this = this;
216222 var seekTime = percentage * this.getDuration();
217223 mw.log( 'EmbedPlayerKalturaKplayer:: doSeek: ' + percentage + ' time:' + seekTime );
@@ -247,8 +253,8 @@
248254 * @param {Float}
249255 * percentage Percentage of the stream to seek to between 0 and 1
250256 */
251 - doPlayThenSeek : function(percentage) {
252 - mw.log('flash::doPlayThenSeek::');
 257+ doPlayThenSeek : function( percentage ) {
 258+ mw.log('KPlayer::doPlayThenSeek::');
253259 var _this = this;
254260 // issue the play request
255261 this.play();
@@ -309,7 +315,7 @@
310316 * function called by flash applet when download bytes changes
311317 */
312318 onBytesDownloadedChange : function(data, id) {
313 - mw.log('onBytesDownloadedChange');
 319+ mw.log('KPlayer::onBytesDownloadedChange');
314320 this.bytesLoaded = data.newValue;
315321 this.bufferedPercent = this.bytesLoaded / this.bytesTotal;
316322
@@ -343,7 +349,7 @@
344350 * NOTE: playerID is not always passed so we can't use this:
345351 */
346352 function onKdpReady(playerId) {
347 - mw.log("player is ready::" + playerId);
 353+ mw.log("KPlayer:: player is ready::" + playerId);
348354 }
349355
350356 /*

Status & tagging log