Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.php |
— | — | @@ -115,6 +115,7 @@ |
116 | 116 | |
117 | 117 | // Text handler |
118 | 118 | $wgAutoloadClasses['TextHandler'] = "$timedMediaDir/handlers/TextHandler/TextHandler.php"; |
| 119 | +$wgAutoloadClasses['TimedTextPage'] = "$timedMediaDir/TimedTextPage.php"; |
119 | 120 | |
120 | 121 | // Transcode support |
121 | 122 | $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 @@ |
49 | 49 | ) |
50 | 50 | ); |
51 | 51 | |
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 |
53 | 53 | // dynamic contexts ( for example in special upload, when there is an "existing file" warning. ) |
54 | 54 | $wgHooks['BeforePageDisplay'][] = 'TimedMediaHandlerHooks::pageOutputHook'; |
55 | 55 | |
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. |
57 | 57 | $wgHooks['ArticleDeleteComplete'][] = 'TimedMediaHandlerHooks::checkArticleDeleteComplete'; |
58 | 58 | |
59 | | - |
60 | | - // Add unit tests |
61 | | - $wgHooks['UnitTestsList'][] = 'TimedMediaHandlerHooks::registerUnitTests'; |
62 | | - |
63 | 59 | // Exclude transcoded assets from normal thumbnail purging |
64 | 60 | // ( a maintenance script could handle transcode asset purging) |
65 | 61 | $wgExcludeFromThumbnailPurge = array_merge( $wgExcludeFromThumbnailPurge, $tmhFileExtensions ); |
| 62 | + |
66 | 63 | // Also add the .log file ( used in two pass encoding ) |
67 | 64 | // ( probably should move in-progress encodes out of web accessible directory ) |
68 | 65 | $wgExcludeFromThumbnailPurge[] = 'log'; |
— | — | @@ -72,7 +69,10 @@ |
73 | 70 | ); |
74 | 71 | |
75 | 72 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'TimedMediaHandlerHooks::loadExtensionSchemaUpdates'; |
76 | | - |
| 73 | + |
| 74 | + // Add unit tests |
| 75 | + $wgHooks['UnitTestsList'][] = 'TimedMediaHandlerHooks::registerUnitTests'; |
| 76 | + |
77 | 77 | |
78 | 78 | /** |
79 | 79 | * Add support for the "TimedText" NameSpace |
— | — | @@ -83,12 +83,22 @@ |
84 | 84 | $wgExtraNamespaces[NS_TIMEDTEXT] = "TimedText"; |
85 | 85 | $wgExtraNamespaces[NS_TIMEDTEXT_TALK] = "TimedText_talk"; |
86 | 86 | |
| 87 | + // if on a timed text page, display timed text page: |
| 88 | + $wgHooks[ 'ArticleFromTitle' ][] = 'TimedMediaHandlerHooks::checkForTimedTextPage'; |
| 89 | + |
87 | 90 | return true; |
88 | 91 | } |
89 | 92 | |
| 93 | + public static function checkForTimedTextPage( &$title, &$article ){ |
| 94 | + if( $title->getNamespace() == NS_TIMEDTEXT ) { |
| 95 | + $article = new TimedTextPage( $title ); |
| 96 | + } |
| 97 | + return true; |
| 98 | + } |
| 99 | + |
90 | 100 | public static function checkArticleDeleteComplete( &$article, &$user, $reason, $id ){ |
91 | 101 | // 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 ) { |
93 | 103 | // We can't get the file since the article is deleted :( |
94 | 104 | // so we can't: |
95 | 105 | // $file = wfFindFile( $article->getTitle() ); |
— | — | @@ -137,7 +147,6 @@ |
138 | 148 | } |
139 | 149 | |
140 | 150 | static function pageOutputHook( &$out, &$sk ){ |
141 | | - // FIXME we should only need to add this via parser output hook |
142 | 151 | $out->addModules( 'PopUpMediaTransform' ); |
143 | 152 | $out->addModuleStyles( 'PopUpMediaTransform' ); |
144 | 153 | return true; |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/TimedText/TimedText.php |
— | — | @@ -6,7 +6,8 @@ |
7 | 7 | 'scripts' => "resources/mw.TimedText.js", |
8 | 8 | 'styles' => "resources/mw.style.TimedText.css", |
9 | 9 | 'dependencies' => array( |
10 | | - 'mw.EmbedPlayer', |
| 10 | + 'mw.EmbedPlayer', |
| 11 | + 'mw.Api', |
11 | 12 | 'mw.Language.names', |
12 | 13 | 'jquery.ui.dialog', |
13 | 14 | ), |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/EmbedPlayer.config.php |
— | — | @@ -3,12 +3,14 @@ |
4 | 4 | * Do not edit this file instead use LocalSettings.php and |
5 | 5 | * $wgMwEmbedModuleConfig[ {configuration name} ] = value; format |
6 | 6 | */ |
7 | | - |
8 | 7 | return array ( |
| 8 | + // The relative ( or absolute ) path to the EmbedPlayer folder |
| 9 | + 'EmbedPlayer.WebPath' => "modules/EmbedPlayer/", |
| 10 | + |
9 | 11 | // If the player controls should be overlaid on top of the video ( if supported by playback method) |
10 | 12 | // can be set to false per embed player via overlayControls attribute |
11 | 13 | 'EmbedPlayer.OverlayControls' => true, |
12 | | - |
| 14 | + |
13 | 15 | // The preferred media codec preference |
14 | 16 | // Note user selected format order |
15 | 17 | 'EmbedPlayer.CodecPreference' => array( 'webm', 'h264', 'ogg' ), |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/binPlayers/kaltura-player/README |
— | — | @@ -12,7 +12,6 @@ |
13 | 13 | http://www.kaltura.org/kdp-dynamic-player-and-playlist-widget |
14 | 14 | |
15 | 15 | |
16 | | - |
17 | 16 | File: expressInstall.swf |
18 | 17 | is part of SWFObject v2.2 <http://code.google.com/p/swfobject/> |
19 | 18 | 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 @@ |
1394 | 1394 | $( '#new_img_thumb_' + _this.id ).attr( 'id', 'img_thumb_' + _this.id ); |
1395 | 1395 | $( '#img_thumb_' + _this.id ).css( 'z-index', '1' ); |
1396 | 1396 | _this.thumbnail_updating = false; |
1397 | | - // mw.log("done fadding in "+ |
1398 | | - // $('#img_thumb_'+_this.id).attr("src")); |
1399 | | - |
| 1397 | + |
1400 | 1398 | // if we have a thumb queued update to that |
1401 | 1399 | if ( _this.last_thumb_url ) { |
1402 | 1400 | var src_url = _this.last_thumb_url; |
— | — | @@ -1406,14 +1404,15 @@ |
1407 | 1405 | } |
1408 | 1406 | } |
1409 | 1407 | }, |
1410 | | - // update the video poster: |
| 1408 | + /** |
| 1409 | + * Update the poster source |
| 1410 | + * @param {String} url to poster src |
| 1411 | + */ |
1411 | 1412 | updatePosterSrc: function( posterSrc ){ |
1412 | 1413 | this.poster = posterSrc; |
1413 | 1414 | }, |
1414 | 1415 | /** |
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. |
1418 | 1417 | */ |
1419 | 1418 | updatePosterHTML: function () { |
1420 | 1419 | mw.log( 'EmbedPlayer:updatePosterHTML::' + this.id ); |
— | — | @@ -1428,14 +1427,14 @@ |
1429 | 1428 | |
1430 | 1429 | // Set by default thumb value if not found |
1431 | 1430 | 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'; |
1433 | 1432 | |
1434 | 1433 | // Update PersistentNativePlayer poster: |
1435 | 1434 | if( this.isPersistentNativePlayer() ){ |
1436 | 1435 | $( '#' + this.pid ).attr('poster', posterSrc); |
1437 | 1436 | } else { |
1438 | 1437 | // Poster support is not very consistent in browsers |
1439 | | - // use a jpg poster image: |
| 1438 | + // use a jpeg poster image: |
1440 | 1439 | $( this ).html( |
1441 | 1440 | $( '<img />' ) |
1442 | 1441 | .css({ |
— | — | @@ -1462,8 +1461,6 @@ |
1463 | 1462 | /** |
1464 | 1463 | * Checks if native controls should be used |
1465 | 1464 | * |
1466 | | - * @param [player] |
1467 | | - * Object Optional player object to check controls attribute |
1468 | 1465 | * @returns boolean true if the mwEmbed player interface should be used |
1469 | 1466 | * false if the mwEmbed player interface should not be used |
1470 | 1467 | */ |
— | — | @@ -1555,6 +1552,9 @@ |
1556 | 1553 | } |
1557 | 1554 | return ; |
1558 | 1555 | }, |
| 1556 | + /** |
| 1557 | + * Adds a play button to the player |
| 1558 | + */ |
1559 | 1559 | addPlayBtnLarge:function(){ |
1560 | 1560 | var _this = this; |
1561 | 1561 | var $pid = $( '#' + _this.pid ); |
— | — | @@ -1569,7 +1569,8 @@ |
1570 | 1570 | ); |
1571 | 1571 | }, |
1572 | 1572 | /** |
1573 | | - * Should be set via native embed support |
| 1573 | + * Abstract method, |
| 1574 | + * Get native player html ( should be set by mw.EmbedPlayerNative ) |
1574 | 1575 | */ |
1575 | 1576 | getNativePlayerHtml: function(){ |
1576 | 1577 | return $('<div />' ) |
— | — | @@ -1598,12 +1599,12 @@ |
1599 | 1600 | }, |
1600 | 1601 | |
1601 | 1602 | /** |
1602 | | - * Get the share embed object code |
| 1603 | + * Get the share iframe embed code |
1603 | 1604 | * |
1604 | 1605 | * NOTE this could probably share a bit more code with getShareEmbedVideoJs |
1605 | 1606 | */ |
1606 | 1607 | getShareIframeObject: function(){ |
1607 | | - // allow modules to generate the iframe: |
| 1608 | + // Allow modules to generate the iframe embed code: |
1608 | 1609 | var iframeEmbedCode ={}; |
1609 | 1610 | var iframeUrl = false |
1610 | 1611 | $( this ).trigger( 'GetShareIframeSrc', function( localIframeSrc ){ |
— | — | @@ -1612,7 +1613,7 @@ |
1613 | 1614 | } |
1614 | 1615 | iframeUrl = localIframeSrc; |
1615 | 1616 | }); |
1616 | | - |
| 1617 | + |
1617 | 1618 | if( !iframeUrl ){ |
1618 | 1619 | iframeUrl = this.getIframeSourceUrl() |
1619 | 1620 | } |
— | — | @@ -1631,7 +1632,9 @@ |
1632 | 1633 | // Return the embed code |
1633 | 1634 | return embedCode; |
1634 | 1635 | }, |
1635 | | - |
| 1636 | + /** |
| 1637 | + * Get a url friendly set of sources for passing to the iframe embed |
| 1638 | + */ |
1636 | 1639 | getIframeSourceUrl: function(){ |
1637 | 1640 | // Point to raw files: |
1638 | 1641 | var iframeUrl = mw.getMwEmbedPath() + 'mwEmbedFrame.php?'; |
— | — | @@ -1741,8 +1744,13 @@ |
1742 | 1745 | /** |
1743 | 1746 | * The Play Action |
1744 | 1747 | * |
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" |
1747 | 1755 | */ |
1748 | 1756 | play: function() { |
1749 | 1757 | var _this = this; |
— | — | @@ -1798,9 +1806,6 @@ |
1799 | 1807 | }, |
1800 | 1808 | /** |
1801 | 1809 | * 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. |
1805 | 1810 | */ |
1806 | 1811 | pause: function( event ) { |
1807 | 1812 | var _this = this; |
— | — | @@ -1845,15 +1850,19 @@ |
1846 | 1851 | */ |
1847 | 1852 | load: function() { |
1848 | 1853 | // should be done by child (no base way to pre-buffer video) |
1849 | | - mw.log( 'baseEmbed:load call' ); |
| 1854 | + mw.log( 'BaseEmbed:load call' ); |
1850 | 1855 | }, |
1851 | 1856 | |
1852 | 1857 | |
1853 | 1858 | /** |
1854 | 1859 | * Base embed stop |
1855 | 1860 | * |
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 |
1858 | 1867 | */ |
1859 | 1868 | stop: function() { |
1860 | 1869 | var _this = this; |
— | — | @@ -1902,7 +1911,7 @@ |
1903 | 1912 | * Base Embed mute |
1904 | 1913 | * |
1905 | 1914 | * 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 |
1907 | 1916 | */ |
1908 | 1917 | toggleMute: function() { |
1909 | 1918 | mw.log( 'f:toggleMute:: (old state:) ' + this.muted ); |
— | — | @@ -1963,15 +1972,17 @@ |
1964 | 1973 | }, |
1965 | 1974 | |
1966 | 1975 | /** |
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 |
1969 | 1980 | */ |
1970 | 1981 | setPlayerElementVolume: function( percent ) { |
1971 | 1982 | mw.log('Error player does not support volume adjustment' ); |
1972 | 1983 | }, |
1973 | 1984 | |
1974 | 1985 | /** |
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 |
1976 | 1987 | * (if player does not override we return the abstract player value ) |
1977 | 1988 | */ |
1978 | 1989 | getPlayerElementVolume: function(){ |
— | — | @@ -1980,7 +1991,7 @@ |
1981 | 1992 | }, |
1982 | 1993 | |
1983 | 1994 | /** |
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 / |
1985 | 1996 | * player interface (if player does not override we return the abstract |
1986 | 1997 | * player value ) |
1987 | 1998 | */ |
— | — | @@ -2039,19 +2050,22 @@ |
2040 | 2051 | return this.posterDisplayed; |
2041 | 2052 | }, |
2042 | 2053 | |
2043 | | - // TODO temporary hack we need a better stop monitor system |
| 2054 | + /** |
| 2055 | + * Stop the play state monitor |
| 2056 | + */ |
2044 | 2057 | stopMonitor: function(){ |
2045 | 2058 | clearInterval( this.monitorInterval ); |
2046 | 2059 | this.monitorInterval = 0; |
2047 | 2060 | }, |
2048 | | - // TODO temporary hack we need a better stop monitor system |
| 2061 | + /** |
| 2062 | + * Start the play state monitor |
| 2063 | + */ |
2049 | 2064 | startMonitor: function(){ |
2050 | 2065 | this.monitor(); |
2051 | 2066 | }, |
2052 | 2067 | |
2053 | 2068 | /** |
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 |
2056 | 2070 | */ |
2057 | 2071 | checkForCurrentTimeSeek: function(){ |
2058 | 2072 | var _this = this; |
— | — | @@ -2070,8 +2084,8 @@ |
2071 | 2085 | }, |
2072 | 2086 | |
2073 | 2087 | /** |
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 |
2076 | 2090 | */ |
2077 | 2091 | monitor: function() { |
2078 | 2092 | var _this = this; |
— | — | @@ -2122,7 +2136,7 @@ |
2123 | 2137 | _this.muted = _this.getPlayerElementMuted(); |
2124 | 2138 | } |
2125 | 2139 | |
2126 | | - //mw.log( 'Monitor:: ' + this.currentTime + ' duration: ' + ( parseInt( |
| 2140 | + // mw.log( 'Monitor:: ' + this.currentTime + ' duration: ' + ( parseInt( |
2127 | 2141 | // this.getDuration() ) + 1 ) + ' is seeking: ' + this.seeking ); |
2128 | 2142 | |
2129 | 2143 | if ( this.currentTime >= 0 && this.duration ) { |
— | — | @@ -2164,7 +2178,7 @@ |
2165 | 2179 | // Update buffer information |
2166 | 2180 | this.updateBufferStatus(); |
2167 | 2181 | |
2168 | | - // run the "native" progress event on the virtual html5 object if set |
| 2182 | + // Trigger the "progress" event per HTML5 api support |
2169 | 2183 | if( this.progressEventData ) { |
2170 | 2184 | // mw.log("trigger:progress event on html5 proxy"); |
2171 | 2185 | if( _this._propagateEvents ){ |
— | — | @@ -2172,8 +2186,8 @@ |
2173 | 2187 | } |
2174 | 2188 | } |
2175 | 2189 | |
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 ) |
2178 | 2192 | if( ! this.isStopped() ) { |
2179 | 2193 | if( !this.monitorInterval ){ |
2180 | 2194 | 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 |
2181 | 2195 | + application/octet-stream |
Added: svn:executable |
2182 | 2196 | + * |
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 | | -*/ |
5 | 2 | ( 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 | +*/ |
7 | 7 | window.cortadoDomainLocations = { |
8 | 8 | 'upload.wikimedia.org' : 'http://upload.wikimedia.org/jars/cortado.jar' |
9 | 9 | }; |
10 | 10 | |
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 | | - |
16 | 11 | mw.EmbedPlayerJava = { |
17 | 12 | |
18 | 13 | // Instance name: |
19 | 14 | 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' |
20 | 18 | |
| 19 | + |
21 | 20 | // Supported feature set of the cortado applet: |
22 | 21 | supports: { |
23 | 22 | 'playHead' : true, |
— | — | @@ -64,7 +63,7 @@ |
65 | 64 | $( this ).html( appletCode ); |
66 | 65 | |
67 | 66 | // 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: |
69 | 68 | /*if ( $.browser.mozilla ) { |
70 | 69 | var iframe = document.createElement( 'iframe' ); |
71 | 70 | iframe.setAttribute( 'width', this.getWidth() ); |
— | — | @@ -113,7 +112,7 @@ |
114 | 113 | } |
115 | 114 | } else { |
116 | 115 | // Get the local relative cortado applet location: |
117 | | - appletLoc = mw.getConfig( 'relativeCortadoAppletPath' ); |
| 116 | + appletLoc = this.localAppletLocation; |
118 | 117 | } |
119 | 118 | return appletLoc; |
120 | 119 | }, |
— | — | @@ -128,14 +127,7 @@ |
129 | 128 | try { |
130 | 129 | // java reads ogg media time.. so no need to add the start or seek offset: |
131 | 130 | //mw.log(' ct: ' + this.playerElement.getPlayPosition() + ' ' + this.supportsURLTimeEncoding()); |
132 | | - |
133 | 131 | 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 | | - }*/ |
140 | 132 | } catch ( e ) { |
141 | 133 | mw.log( 'could not get time from jPlayer: ' + e ); |
142 | 134 | } |
— | — | @@ -147,7 +139,8 @@ |
148 | 140 | |
149 | 141 | /** |
150 | 142 | * 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 | + * |
152 | 145 | * @param {Float} percentage Percentage to seek into the stream |
153 | 146 | */ |
154 | 147 | doSeek: function( percentage ) { |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerVlc.js |
— | — | @@ -351,7 +351,7 @@ |
352 | 352 | try{ |
353 | 353 | this.playerElement.video.toggleFullscreen(); |
354 | 354 | } catch ( e ){ |
355 | | - mw.log("VlcEmbed toggle fullscreen : possible error: " + e); |
| 355 | + mw.log("VlcEmbed:: toggle fullscreen : possible error: " + e); |
356 | 356 | } |
357 | 357 | } |
358 | 358 | } |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerNative.js |
— | — | @@ -259,7 +259,7 @@ |
260 | 260 | |
261 | 261 | /** |
262 | 262 | * Do a native seek by updating the currentTime |
263 | | - * @param {float} percentage |
| 263 | + * @param {Float} percentage |
264 | 264 | * Percent to seek to of full time |
265 | 265 | */ |
266 | 266 | doNativeSeek: function( percentage ) { |
— | — | @@ -502,7 +502,8 @@ |
503 | 503 | /** |
504 | 504 | * Update Volume |
505 | 505 | * |
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 |
507 | 508 | */ |
508 | 509 | setPlayerElementVolume : function( percentage ) { |
509 | 510 | if ( this.getPlayerElement() ) { |
— | — | @@ -526,7 +527,7 @@ |
527 | 528 | } |
528 | 529 | }, |
529 | 530 | /** |
530 | | - * get the native muted state |
| 531 | + * Get the native muted state |
531 | 532 | */ |
532 | 533 | getPlayerElementMuted: function(){ |
533 | 534 | if ( this.getPlayerElement() ) { |
— | — | @@ -544,7 +545,7 @@ |
545 | 546 | }, |
546 | 547 | |
547 | 548 | /** |
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" |
549 | 550 | * |
550 | 551 | * @parma {Function} callbcak Function called once video is loaded |
551 | 552 | */ |
— | — | @@ -565,7 +566,7 @@ |
566 | 567 | }, |
567 | 568 | |
568 | 569 | /** |
569 | | - * Get /update the playerElement value |
| 570 | + * Get / update the playerElement value |
570 | 571 | */ |
571 | 572 | getPlayerElement: function () { |
572 | 573 | this.playerElement = $( '#' + this.pid ).get( 0 ); |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerKplayer.js |
— | — | @@ -1,5 +1,7 @@ |
2 | | -/* |
| 2 | +/** |
3 | 3 | * 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. |
4 | 6 | */ |
5 | 7 | // Called from the kdp.swf |
6 | 8 | ( function( mw, $ ) { |
— | — | @@ -27,7 +29,7 @@ |
28 | 30 | // Stores the current time as set from flash |
29 | 31 | flashCurrentTime : 0, |
30 | 32 | |
31 | | - /* |
| 33 | + /** |
32 | 34 | * Write the Embed html to the target |
33 | 35 | */ |
34 | 36 | doEmbedHTML : function() { |
— | — | @@ -103,7 +105,7 @@ |
104 | 106 | }, |
105 | 107 | |
106 | 108 | /** |
107 | | - * javascript run post player embedding |
| 109 | + * JavaScript run post player embedding |
108 | 110 | */ |
109 | 111 | postEmbedJS : function() { |
110 | 112 | var _this = this; |
— | — | @@ -138,7 +140,7 @@ |
139 | 141 | /** |
140 | 142 | * Bind a Player Function, |
141 | 143 | * |
142 | | - * Does some tricker to bind to "this" player instance: |
| 144 | + * Creates a unique global function to bind to "this" player instance: |
143 | 145 | * |
144 | 146 | * @param {String} |
145 | 147 | * flash binding name |
— | — | @@ -156,7 +158,7 @@ |
157 | 159 | embedPlayer[methodName](data); |
158 | 160 | } |
159 | 161 | }; |
160 | | - }(gKdpCallbackName, this); |
| 162 | + }( gKdpCallbackName, this ); |
161 | 163 | |
162 | 164 | // Add the listener to the KDP flash player: |
163 | 165 | this.playerElement.addJsListener(bindName, gKdpCallbackName); |
— | — | @@ -177,15 +179,18 @@ |
178 | 180 | onPlay : function() { |
179 | 181 | this.parent_play(); |
180 | 182 | }, |
181 | | - |
| 183 | + /** |
| 184 | + * handles duration change event |
| 185 | + */ |
182 | 186 | onDurationChange : function(data, id) { |
183 | | - mw.log(" onDurationChange: " + data.newValue); |
| 187 | + mw.log("KPlayer::onDurationChange: " + data.newValue); |
184 | 188 | // update the duration: |
185 | 189 | this.duration = data.newValue; |
186 | 190 | }, |
187 | 191 | |
188 | 192 | /** |
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 |
190 | 195 | */ |
191 | 196 | play : function() { |
192 | 197 | if (this.playerElement && this.playerElement.sendNotification) { |
— | — | @@ -195,7 +200,8 @@ |
196 | 201 | }, |
197 | 202 | |
198 | 203 | /** |
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 |
200 | 206 | */ |
201 | 207 | pause : function() { |
202 | 208 | if (this.playerElement && this.playerElement.sendNotification) { |
— | — | @@ -210,7 +216,7 @@ |
211 | 217 | * @param {Float} |
212 | 218 | * percentage Percentage of total stream length to seek to |
213 | 219 | */ |
214 | | - doSeek : function(percentage) { |
| 220 | + doSeek: function( percentage ) { |
215 | 221 | var _this = this; |
216 | 222 | var seekTime = percentage * this.getDuration(); |
217 | 223 | mw.log( 'EmbedPlayerKalturaKplayer:: doSeek: ' + percentage + ' time:' + seekTime ); |
— | — | @@ -247,8 +253,8 @@ |
248 | 254 | * @param {Float} |
249 | 255 | * percentage Percentage of the stream to seek to between 0 and 1 |
250 | 256 | */ |
251 | | - doPlayThenSeek : function(percentage) { |
252 | | - mw.log('flash::doPlayThenSeek::'); |
| 257 | + doPlayThenSeek : function( percentage ) { |
| 258 | + mw.log('KPlayer::doPlayThenSeek::'); |
253 | 259 | var _this = this; |
254 | 260 | // issue the play request |
255 | 261 | this.play(); |
— | — | @@ -309,7 +315,7 @@ |
310 | 316 | * function called by flash applet when download bytes changes |
311 | 317 | */ |
312 | 318 | onBytesDownloadedChange : function(data, id) { |
313 | | - mw.log('onBytesDownloadedChange'); |
| 319 | + mw.log('KPlayer::onBytesDownloadedChange'); |
314 | 320 | this.bytesLoaded = data.newValue; |
315 | 321 | this.bufferedPercent = this.bytesLoaded / this.bytesTotal; |
316 | 322 | |
— | — | @@ -343,7 +349,7 @@ |
344 | 350 | * NOTE: playerID is not always passed so we can't use this: |
345 | 351 | */ |
346 | 352 | function onKdpReady(playerId) { |
347 | | - mw.log("player is ready::" + playerId); |
| 353 | + mw.log("KPlayer:: player is ready::" + playerId); |
348 | 354 | } |
349 | 355 | |
350 | 356 | /* |