Index: trunk/extensions/MetavidWiki/includes/MV_Settings.php |
— | — | @@ -16,25 +16,19 @@ |
17 | 17 | |
18 | 18 | define( 'SEQUENCE_TAG', 'sequence_hlrd' ); |
19 | 19 | |
20 | | -// include the global functions & register the extension |
| 20 | +// include the global functions & register the extension |
21 | 21 | include_once( 'MV_GlobalFunctions.php' ); |
22 | 22 | |
23 | 23 | |
24 | | -//greatly affects site performance (turn to false to avoid costly parent lookups on all search results) : |
| 24 | +//greatly affects site performance (turn to false to avoid costly parent lookups on all search results) : |
25 | 25 | $mvGetParentMeta = true; |
26 | 26 | |
27 | 27 | |
28 | | -//script loader settings: |
29 | | -$mvgJSDebug=false; |
30 | | -$wgEnableScriptLoader = false; //if the script loader is on |
| 28 | +//script loader settings: |
31 | 29 | |
32 | | -$wgEnableScriptLoaderJsFile = true; //if you can use the script loader with js files (rather than only js classes) |
33 | | -$wgEnableScriptMinify = true; |
34 | 30 | |
35 | | - |
36 | | - |
37 | 31 | // if the search portlet should autoComplete |
38 | | -// (causes the inclution of jquery into every page.. can slow things down a bit) |
| 32 | +// (causes the inclution of jquery into every page.. can slow things down a bit) |
39 | 33 | $mvEnableAutoComplete = true; |
40 | 34 | |
41 | 35 | |
— | — | @@ -46,9 +40,9 @@ |
47 | 41 | # semanticWiki integration options |
48 | 42 | # ######################### |
49 | 43 | // @@todo we should clean this up!... into a semantic maping array or object |
50 | | -// if you want to include spoken by relation in search results: |
| 44 | +// if you want to include spoken by relation in search results: |
51 | 45 | |
52 | | -// enable dissable varius digest data collection |
| 46 | +// enable dissable varius digest data collection |
53 | 47 | $mvEnableSearchDigest = true; |
54 | 48 | $mvEnableClipViewDigest = true; |
55 | 49 | // keeps track of popular pages in given categories over time |
— | — | @@ -58,7 +52,7 @@ |
59 | 53 | // 'property'=>category for auto_complete (ALL LOWER CASE) |
60 | 54 | $mvMetaDataHelpers = array( 'anno_en' => array( 'speech_by' => 'person', 'bill' => 'bill' ) ); |
61 | 55 | |
62 | | -// by default categories are handled differently enable or disable below: |
| 56 | +// by default categories are handled differently enable or disable below: |
63 | 57 | $mvMetaCategoryHelper = true; |
64 | 58 | |
65 | 59 | |
— | — | @@ -70,41 +64,41 @@ |
71 | 65 | |
72 | 66 | |
73 | 67 | # ######################## |
74 | | -# metavid paths |
| 68 | +# metavid paths |
75 | 69 | # @@todo clean up with internal handlers for annodex and images |
76 | | -# use the mediaWiki defaults for storage of media |
| 70 | +# use the mediaWiki defaults for storage of media |
77 | 71 | # ######################### |
78 | 72 | |
79 | 73 | // define the image location: |
80 | 74 | // $mvImageWebLoc ='http://metavid.org/image_media/'; |
81 | 75 | |
82 | | -// if we should load images from an external server: |
| 76 | +// if we should load images from an external server: |
83 | 77 | $mvExternalImages = false; |
84 | | -// path to metavidWiki install that is serving images: |
| 78 | +// path to metavidWiki install that is serving images: |
85 | 79 | $mvExternalImgServerPath = 'http://mvprime.cse.ucsc.edu/wiki/index.php'; |
86 | 80 | |
87 | 81 | $mvWebImgLoc = $mvgScriptPath . '/stream_images'; |
88 | | -// full local path for images (if hosted locally) |
| 82 | +// full local path for images (if hosted locally) |
89 | 83 | $mvLocalImgLoc = $mvgIP . '/stream_images'; |
90 | 84 | |
91 | 85 | // if mediaWiki should serve up redirects to image file path or have php send the image via GD |
92 | 86 | // if served directly its one less round trip to the server but may tax the server |
93 | | -// a bit more than having apache serving the file |
| 87 | +// a bit more than having apache serving the file |
94 | 88 | $mvServeImageRedirect = false; |
95 | 89 | |
96 | 90 | // the time in seconds of between image frames generated from movie clips. |
97 | | -// (set pretty high for the metavid context where we load the images via scripts |
| 91 | +// (set pretty high for the metavid context where we load the images via scripts |
98 | 92 | // (early on we did less frequent image grabs) |
99 | | -// normally you would want a lower value like 5 seconds or so |
| 93 | +// normally you would want a lower value like 5 seconds or so |
100 | 94 | $mvImageGranularityRate = '600'; |
101 | 95 | // the ffmpeg command to generate thumbnail (to disable generating images set to '') |
102 | 96 | $mvShellOggFrameGrab = ''; |
103 | | - |
104 | | -# define the video media locations based on path/server names |
| 97 | + |
| 98 | +# define the video media locations based on path/server names |
105 | 99 | $mvVideoArchivePaths['cap1'] = 'http://metavidstorage01.ucsc.edu/media/'; |
106 | 100 | $mvVideoArchivePaths['mvbox2'] = 'http://mvbox2.cse.ucsc.edu/media/'; |
107 | 101 | |
108 | | -// stream msgKeys that support ?t=start_time/end_time temporal url media serving: |
| 102 | +// stream msgKeys that support ?t=start_time/end_time temporal url media serving: |
109 | 103 | $mvDefaultVideoQualityKey = 'mv_ogg_low_quality'; |
110 | 104 | $mvDefaultFlashQualityKey = 'mv_flash_low_quality'; |
111 | 105 | $mvDefaultVideoHighQualityKey = 'mv_ogg_high_quality'; |
— | — | @@ -141,7 +135,7 @@ |
142 | 136 | //if to display the ROE resource link |
143 | 137 | $mvDispROEicon=false; |
144 | 138 | |
145 | | -//The text Embed a metavid Stream inline in the wiki |
| 139 | +//The text Embed a metavid Stream inline in the wiki |
146 | 140 | $mvEmbedKey = 'Embed'; |
147 | 141 | |
148 | 142 | //wars people of archive inacuracys (given its a wiki and the source is close caption feed) |
— | — | @@ -163,7 +157,7 @@ |
164 | 158 | */ |
165 | 159 | $mvMVDTypeDefaultDisp = array( 'ht_en', 'anno_en' ); |
166 | 160 | |
167 | | -//if we should show the layer controls: |
| 161 | +//if we should show the layer controls: |
168 | 162 | $mvgShowLayerControls = false; |
169 | 163 | |
170 | 164 | # ################## |
— | — | @@ -181,12 +175,12 @@ |
182 | 176 | # @@todo should really integrate "streams" with "media" |
183 | 177 | # here you can control what rights 'sysop', 'bot', 'user', 'anonymous', have in |
184 | 178 | # adding streams |
185 | | -# note: all streams are treated equally once added to the system |
| 179 | +# note: all streams are treated equally once added to the system |
186 | 180 | # (this only control import types) |
187 | 181 | # |
188 | 182 | # type: [metavid_file] -- used for pointing to an existing file on the server |
189 | | -# [metavid_live] -- used for the setting up the scripts for a live stream. |
190 | | -# [upload_file] -- used video file uploads |
| 183 | +# [metavid_live] -- used for the setting up the scripts for a live stream. |
| 184 | +# [upload_file] -- used video file uploads |
191 | 185 | # [external_file] -- used to add external files via http urls (such as a file from archive.org) |
192 | 186 | $mvStreamTypePermission['metavid_file'] = array( 'sysop', 'bot' ); |
193 | 187 | $mvStreamTypePermission['metavid_live'] = array(); |
— | — | @@ -209,7 +203,7 @@ |
210 | 204 | |
211 | 205 | 'mv_archive_org_mp4' => 'video/h264', |
212 | 206 | 'mv_flash_low_quality' => 'video/x-flv', |
213 | | - 'mv_ogg_high_quality' => 'video/ogg', |
| 207 | + 'mv_ogg_high_quality' => 'video/ogg', |
214 | 208 | 'mv_ogg_low_quality' => 'video/ogg' |
215 | 209 | ); |
216 | 210 | |
— | — | @@ -218,8 +212,8 @@ |
219 | 213 | # $mvNamespaceIndex = ???; in your config before including the settings |
220 | 214 | # should be larger than 100 and if you put in a default value |
221 | 215 | # if your using semantic wiki just init the semantic wiki namespace |
222 | | -# and metavid will take subsequent NS values accordingly. |
223 | | -# # |
| 216 | +# and metavid will take subsequent NS values accordingly. |
| 217 | +# # |
224 | 218 | if ( !isset( $mvNamespaceIndex ) ) { |
225 | 219 | mvInitNamespaces( 100 ); |
226 | 220 | } else { |
Index: trunk/extensions/MetavidWiki/includes/MV_Title.php |
— | — | @@ -4,15 +4,15 @@ |
5 | 5 | * |
6 | 6 | * All Metavid Wiki code is Released under the GPL2 |
7 | 7 | * for more info visit http://metavid.org/wiki/Code |
8 | | - * |
| 8 | + * |
9 | 9 | * @author Michael Dale |
10 | 10 | * @email dale@ucsc.edu |
11 | 11 | * @url http://metavid.org |
12 | | - * |
| 12 | + * |
13 | 13 | */ |
14 | 14 | if ( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
15 | | - |
16 | | - /*@@TODO document |
| 15 | + |
| 16 | + /*@@TODO document |
17 | 17 | * @@todo title implementation is a bit messy .. |
18 | 18 | * MV_Title should really just extend title and be passed around as a title |
19 | 19 | * instead of having two objects (Title and MV_title) |
— | — | @@ -24,15 +24,15 @@ |
25 | 25 | var $end_time = null; |
26 | 26 | var $id = null; |
27 | 27 | var $view_count = null; |
28 | | - |
| 28 | + |
29 | 29 | var $hasMVDType = false; |
30 | 30 | var $dispVideoPlayerTime = false; |
31 | | - // a pointer to the mvStream |
| 31 | + // a pointer to the mvStream |
32 | 32 | var $mvStream = null; |
33 | 33 | var $wiki_title = ''; |
34 | 34 | // default namespace for mvTitle MV_NS_MVD |
35 | | - function __construct( $title, $ns = MV_NS_MVD ) { |
36 | | - // handle title object |
| 35 | + function __construct( $title, $ns = MV_NS_MVD ) { |
| 36 | + // handle title object |
37 | 37 | if ( is_string( $title ) ) { |
38 | 38 | $title = parent::makeTitle( $ns, $title ); |
39 | 39 | } |
— | — | @@ -46,14 +46,14 @@ |
47 | 47 | function inheritTitle( & $title ) { |
48 | 48 | if( !is_object($title)){ |
49 | 49 | //print_r( debug_backtrace() ); |
50 | | - return false; |
| 50 | + return false; |
51 | 51 | } |
52 | 52 | foreach ( $title as $k => $v ) { |
53 | 53 | $this->$k = $v; |
54 | 54 | } |
55 | 55 | } |
56 | 56 | function hasMVDType() { return $this->hasMVDType; } |
57 | | - /* |
| 57 | + /* |
58 | 58 | * checks if the given request is valid: |
59 | 59 | * valid request include: |
60 | 60 | * type:existing_stream/##:##:##(/##:##:##)? |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | // @@todo should throw use exceptions |
64 | 64 | // first check if stream exists |
65 | 65 | if ( !$this->doesStreamExist() ) { |
66 | | - // print "stream does not exist"; |
| 66 | + // print "stream does not exist"; |
67 | 67 | return false; |
68 | 68 | } |
69 | 69 | if ( !$this->hasMVDType() ) { |
— | — | @@ -76,7 +76,7 @@ |
77 | 77 | return true; |
78 | 78 | } |
79 | 79 | /* |
80 | | - * Check the db for the given stream name |
| 80 | + * Check the db for the given stream name |
81 | 81 | */ |
82 | 82 | function doesStreamExist() { |
83 | 83 | // print "looking for: ". $this->stream_name; |
— | — | @@ -88,7 +88,7 @@ |
89 | 89 | function getStreamName() { return $this->stream_name; } |
90 | 90 | /* |
91 | 91 | * Returns the stream name with uppercase first word |
92 | | - * and spaces for underscores |
| 92 | + * and spaces for underscores |
93 | 93 | */ |
94 | 94 | function getStreamNameText( $sn = '' ) { |
95 | 95 | if ( $sn == '' )$sn = $this->stream_name; |
— | — | @@ -98,11 +98,11 @@ |
99 | 99 | $d = $this->mvStream->getStreamStartDate(); |
100 | 100 | if(!isset($d) || $d==0) |
101 | 101 | return $this->getStreamNameText(); |
102 | | - $sn_parts = split('_',$this->stream_name); |
103 | | - //remove the date part of the array: |
| 102 | + $sn_parts = split('_',$this->stream_name); |
| 103 | + //remove the date part of the array: |
104 | 104 | array_pop( $sn_parts); |
105 | 105 | foreach($sn_parts as & $sp) |
106 | | - $sp = ucfirst($sp); |
| 106 | + $sp = ucfirst($sp); |
107 | 107 | $sn = (count($sn_parts)>1)? implode(' ', $sn_parts): $sp[0]; |
108 | 108 | return $sn .' on '. date('M jS, Y',$d); |
109 | 109 | } |
— | — | @@ -126,28 +126,28 @@ |
127 | 127 | function getWikiTitle() { return $this->wiki_title; } |
128 | 128 | function getStartTime() { return $this->start_time; } |
129 | 129 | function setStartTimeNtp($start_time){ |
130 | | - $this->start_time = $start_time; |
131 | | - } |
132 | | - function getEndTime() { return $this->end_time; } |
| 130 | + $this->start_time = $start_time; |
| 131 | + } |
| 132 | + function getEndTime() { return $this->end_time; } |
133 | 133 | function setEndTimeNtp($end_time){ |
134 | 134 | $this->end_time = $end_time; |
135 | 135 | } |
136 | 136 | function getTimeRequest() { return $this->start_time . '/' . $this->end_time; } |
137 | 137 | function getMwTitle() { return Title::MakeTitle( MV_NS_MVD, $this->wiki_title ); } |
138 | | - |
| 138 | + |
139 | 139 | function setStartEndIfEmpty() { |
140 | 140 | global $mvDefaultStreamViewLength, $wgRequest; |
141 | | - //if overview mode override the time settings: |
| 141 | + //if overview mode override the time settings: |
142 | 142 | if( $wgRequest->getVal('view') == 'overview' ){ |
143 | 143 | $this->start_time_sec = 0; |
144 | | - $this->start_time = seconds2npt( $this->start_time_sec ); |
| 144 | + $this->start_time = seconds2npt( $this->start_time_sec ); |
145 | 145 | $this->end_time_sec = $this->getDuration(); |
146 | 146 | $this->end_time = seconds2npt( $this->end_time_sec ); |
147 | 147 | } |
148 | | - |
| 148 | + |
149 | 149 | if ( $this->start_time == null ) { |
150 | 150 | $this->start_time_sec = 0; |
151 | | - $this->start_time = seconds2npt( $this->start_time_sec ); |
| 151 | + $this->start_time = seconds2npt( $this->start_time_sec ); |
152 | 152 | } else { |
153 | 153 | $this->start_time_sec = npt2seconds( $this->start_time ); |
154 | 154 | } |
— | — | @@ -167,7 +167,7 @@ |
168 | 168 | } |
169 | 169 | } |
170 | 170 | } |
171 | | - /* |
| 171 | + /* |
172 | 172 | * returns start time in seconds |
173 | 173 | */ |
174 | 174 | function getStartTimeSeconds() { |
— | — | @@ -175,7 +175,7 @@ |
176 | 176 | $this->start_time_sec = npt2seconds( $this->start_time ); |
177 | 177 | return $this->start_time_sec; |
178 | 178 | } |
179 | | - /* |
| 179 | + /* |
180 | 180 | * returns end time in seconds |
181 | 181 | */ |
182 | 182 | function getEndTimeSeconds() { |
— | — | @@ -187,7 +187,7 @@ |
188 | 188 | return null; |
189 | 189 | } |
190 | 190 | /* |
191 | | - * legacy/convenience function (should probably just update all getDuration calls |
| 191 | + * legacy/convenience function (should probably just update all getDuration calls |
192 | 192 | * to call global MVstream directly |
193 | 193 | */ |
194 | 194 | function getDuration() { |
— | — | @@ -205,16 +205,16 @@ |
206 | 206 | */ |
207 | 207 | function getNearStreamName( $range = null, $length = null ) { |
208 | 208 | global $mvDefaultClipLength, $mvDefaultClipRange; |
209 | | - |
| 209 | + |
210 | 210 | $stream = & mvGetMVStream( $this->stream_name ); |
211 | | - |
| 211 | + |
212 | 212 | if ( $range === null )$range = $mvDefaultClipRange; |
213 | | - if ( $length === null )$length = $mvDefaultClipLength; |
214 | | - |
| 213 | + if ( $length === null )$length = $mvDefaultClipLength; |
| 214 | + |
215 | 215 | // subtract $range seconds from the start time: |
216 | 216 | $start_t = $this->getStartTimeSeconds() - $range; |
217 | 217 | if ( $start_t < 0 )$start_t = 0; |
218 | | - |
| 218 | + |
219 | 219 | $start_ntp = seconds2npt( $start_t ) ; |
220 | 220 | // add $range seconds to the end time: |
221 | 221 | if ( isset( $this->end_time ) ) { |
— | — | @@ -245,7 +245,7 @@ |
246 | 246 | } |
247 | 247 | function getFullStreamImageURL( $size = null, $req_time = null, $foce_server = '' ) { |
248 | 248 | global $wgServer, $mvExternalImages; |
249 | | - // if using external images already: |
| 249 | + // if using external images already: |
250 | 250 | if ( $mvExternalImages ) { |
251 | 251 | return $this->getStreamImageURL( $size, $req_time, $foce_server ); |
252 | 252 | } else { |
— | — | @@ -253,7 +253,7 @@ |
254 | 254 | return $wgServer . $this->getStreamImageURL( $size, $req_time, $foce_server ); |
255 | 255 | } |
256 | 256 | } |
257 | | - // @@todo force_server is a weird hack ... @@todo remove and update other code locations |
| 257 | + // @@todo force_server is a weird hack ... @@todo remove and update other code locations |
258 | 258 | function getStreamImageURL( $size = null, $req_time = null, $foce_server = '', $direct_link=false ) { |
259 | 259 | global $mvDefaultVideoPlaybackRes; |
260 | 260 | if ( $size == null ) { |
— | — | @@ -264,14 +264,14 @@ |
265 | 265 | if ( !$req_time )$req_time = '0:00:00'; |
266 | 266 | } |
267 | 267 | if ( $foce_server == '' ) { |
268 | | - // get the image path: (and generate the image if necessary) |
| 268 | + // get the image path: (and generate the image if necessary) |
269 | 269 | return MV_StreamImage::getStreamImageURL( $this->getStreamId(), $req_time, $size, $direct_link ); |
270 | 270 | } else { |
271 | 271 | return $foce_server . $this->getStreamName() . '?t=' . $req_time; |
272 | 272 | } |
273 | 273 | } |
274 | 274 | /* gets all ~direct~ metadata for the current MV_Title |
275 | | - * (does not grab overlapping metadata) |
| 275 | + * (does not grab overlapping metadata) |
276 | 276 | * (semantic properties and categories) |
277 | 277 | * */ |
278 | 278 | function getMetaData( $normalized_prop_name = true ) { |
— | — | @@ -281,7 +281,7 @@ |
282 | 282 | $text = $article->getContent(); |
283 | 283 | // @@todo should use semanticMediaWiki api here |
284 | 284 | $tmpProp = MV_Overlay::get_and_strip_semantic_tags( $text ); |
285 | | - // strip categories |
| 285 | + // strip categories |
286 | 286 | $retAry['striped_text'] = preg_replace( '/\[\[[^:]+:[^\]]+\]\]/', '', $text ); |
287 | 287 | if ( $normalized_prop_name ) { |
288 | 288 | foreach ( $tmpProp as $pkey => $pval ) { |
— | — | @@ -290,9 +290,9 @@ |
291 | 291 | } else { |
292 | 292 | $retAry['prop'] = $tmpProp; |
293 | 293 | } |
294 | | - |
| 294 | + |
295 | 295 | $sk =& $wgUser->getSkin(); |
296 | | - // run via parser to add in Category info: |
| 296 | + // run via parser to add in Category info: |
297 | 297 | $parserOptions = ParserOptions::newFromUser( $wgUser ); |
298 | 298 | $parserOutput = $wgParser->parse( $text , $this, $parserOptions ); |
299 | 299 | $retAry['categories'] = $parserOutput->getCategories(); |
— | — | @@ -300,17 +300,17 @@ |
301 | 301 | } |
302 | 302 | /* |
303 | 303 | * function: getWebStreamURL |
304 | | - * |
| 304 | + * |
305 | 305 | * returns full web accessible path to stream |
306 | 306 | * (by default this is the web streameable version of the file) |
307 | 307 | * web stream is file_desc_msg as: mv_ogg_low_quality |
308 | 308 | * $mvDefaultVideoQualityKey in MV_Settings.php |
309 | | - * |
| 309 | + * |
310 | 310 | */ |
311 | 311 | function getWebStreamURL( $quality = null ) { |
312 | 312 | global $mvVideoArchivePaths, $mvDefaultVideoQualityKey; |
313 | 313 | // @@todo mediawiki path for media (instead of hard link to $mvVideoArchive) |
314 | | - // @@todo make sure file exists |
| 314 | + // @@todo make sure file exists |
315 | 315 | if ( !$quality )$quality = $mvDefaultVideoQualityKey; |
316 | 316 | if ( $this->doesStreamExist() ) { |
317 | 317 | // @@todo cache this / have a more organized store for StreamFiles in streamTitle |
— | — | @@ -321,22 +321,22 @@ |
322 | 322 | ) ); |
323 | 323 | if ( $dbr->numRows( $result ) == 0 )return false; |
324 | 324 | $streamFile = $dbr->fetchObject( $result ); |
325 | | - |
326 | | - // print_r($streamFile); |
327 | | - // make sure we have streamFiles (used to generate the link) |
| 325 | + |
| 326 | + // print_r($streamFile); |
| 327 | + // make sure we have streamFiles (used to generate the link) |
328 | 328 | $mvStreamFile = new MV_StreamFile( $this->mvStream, $streamFile ); |
329 | | - // if link empty return false: |
| 329 | + // if link empty return false: |
330 | 330 | if ( $mvStreamFile->getFullURL() == '' )return false; |
331 | 331 | $time_req = ''; |
332 | 332 | if ( $this->getStartTime() != '' && $this->getEndTime() != '' ) { |
333 | 333 | if ( $mvStreamFile->supportsURLTimeEncoding() ) { |
334 | 334 | if( $mvStreamFile->path_type=='url_anx' ) |
335 | 335 | $time_req = '?t=' . $this->getStartTime() . '/' . $this->getEndTime(); |
336 | | - |
| 336 | + |
337 | 337 | if( $mvStreamFile->path_type=='mp4_stream' ) |
338 | 338 | $time_req = '?start=' . $this->getStartTimeSeconds() . '&end=' . $this->getEndTimeSeconds(); |
339 | 339 | } |
340 | | - } |
| 340 | + } |
341 | 341 | return $mvStreamFile->getFullURL() . $time_req; |
342 | 342 | } else { |
343 | 343 | // @@todo throw ERROR |
— | — | @@ -345,7 +345,7 @@ |
346 | 346 | } |
347 | 347 | function getROEURL() { |
348 | 348 | $roeTitle = Title::newFromText( 'MvExportStream', NS_SPECIAL ); |
349 | | - // add the query: |
| 349 | + // add the query: |
350 | 350 | $query = 'stream_name=' . htmlspecialchars( $this->getStreamName() ) . |
351 | 351 | '&t=' . htmlspecialchars( $this->getTimeRequest() . |
352 | 352 | '&feed_format=roe' ); |
— | — | @@ -359,7 +359,7 @@ |
360 | 360 | $force_server = (isset($options['force_server']))?$options['force_server']:''; |
361 | 361 | $autoplay = (isset($options['autoplay']))?$options['autoplay']:false; |
362 | 362 | $showmeta = (isset($options['showmeta']))?$options['showmeta']:false; |
363 | | - |
| 363 | + |
364 | 364 | $tag = 'video'; |
365 | 365 | if ( $size == '' ) { |
366 | 366 | global $mvDefaultVideoPlaybackRes; |
— | — | @@ -368,25 +368,25 @@ |
369 | 369 | } else { |
370 | 370 | list( $vWidth, $vHeight, $na ) = MV_StreamImage::getSizeType( $size ); |
371 | 371 | } |
372 | | - |
373 | | - |
| 372 | + |
| 373 | + |
374 | 374 | $stream_web_url = $this->getWebStreamURL( $mvDefaultVideoQualityKey ); |
375 | 375 | $flash_stream_url = $this->getWebStreamURL( $mvDefaultFlashQualityKey ); |
376 | 376 | $mp4_stream_url = $this->getWebStreamURL( $mvDefaultMP4QualityKey ); |
377 | 377 | // print "looking for q: $mvDefaultFlashQualityKey "; |
378 | 378 | |
379 | | - // print "FOUND: $flash_stream_url"; |
| 379 | + // print "FOUND: $flash_stream_url"; |
380 | 380 | $roe_url = $this->getROEURL(); |
381 | | - //if no urls available return missing: |
| 381 | + //if no urls available return missing: |
382 | 382 | if ( !$stream_web_url && !$flash_stream_url && !$mp4_stream_url ) { |
383 | | - return wfMsg( 'mv_error_stream_missing' ); |
| 383 | + return wfMsgWikiHtml( 'mv_error_stream_missing' ); |
384 | 384 | } |
385 | | - |
| 385 | + |
386 | 386 | if ( $stream_web_url || $flash_stream_url || $mp4_stream_url) { |
387 | 387 | $o = ''; |
388 | | - /*if($this->dispVideoPlayerTime){ |
| 388 | + /*if($this->dispVideoPlayerTime){ |
389 | 389 | $o.='<span id="mv_videoPlayerTime">'.$this->getStartTime().' to '. |
390 | | - htmlspecialchars( $this->getEndTime() ) . |
| 390 | + htmlspecialchars( $this->getEndTime() ) . |
391 | 391 | '</span>'; |
392 | 392 | }*/ |
393 | 393 | $o .= '<' . htmlspecialchars( $tag ) . ' '; |
— | — | @@ -394,31 +394,31 @@ |
395 | 395 | $o .= 'poster="' . $this->getStreamImageURL( $size, null, $force_server ) . '" ' . |
396 | 396 | 'roe="' . $roe_url . '" '; |
397 | 397 | $o .= ($showmeta)?'show_meta_link="true" ':'show_meta_link="false" ' ; |
398 | | - |
| 398 | + |
399 | 399 | $o .= ( $autoplay ) ? ' autoplay="true" ':''; |
400 | | - |
| 400 | + |
401 | 401 | $o .= 'style="width:' . htmlspecialchars( $vWidth ) . 'px;height:' . htmlspecialchars( $vHeight ) . 'px" ' . |
402 | 402 | 'controls="true" embed_link="true" >'; |
403 | | - |
| 403 | + |
404 | 404 | if ( $stream_web_url ) |
405 | 405 | $o .= '<source timeFormat="anx" type="' . |
406 | 406 | htmlspecialchars( MV_StreamFile::getTypeForQK( $mvDefaultVideoQualityKey ) ) . |
407 | 407 | '" src="' . $stream_web_url . '"></source>'; |
408 | | - |
| 408 | + |
409 | 409 | if ( $flash_stream_url ) |
410 | 410 | $o .= '<source timeFormat="anx" type="' . |
411 | 411 | htmlspecialchars( MV_StreamFile::getTypeForQK( $mvDefaultFlashQualityKey ) ) . |
412 | 412 | '" src="' . $flash_stream_url . '"></source>'; |
413 | | - |
| 413 | + |
414 | 414 | if ( $mp4_stream_url ) |
415 | 415 | $o.='<source timeFormat="mp4" type="' . |
416 | 416 | htmlspecialchars( MV_StreamFile::getTypeForQK( $mvDefaultMP4QualityKey ) ) . |
417 | 417 | '" src="' . $mp4_stream_url . '"></source>'; |
418 | | - |
| 418 | + |
419 | 419 | $o .= '</' . htmlspecialchars( $tag ) . '>'; |
420 | 420 | return $o; |
421 | | - } |
422 | | - } |
| 421 | + } |
| 422 | + } |
423 | 423 | function getViewCount() { |
424 | 424 | if ( $this->view_count == null ) { |
425 | 425 | $dbr = & wfGetDB( DB_READ ); |
— | — | @@ -446,19 +446,19 @@ |
447 | 447 | return $title_str; |
448 | 448 | } |
449 | 449 | /* |
450 | | - * returns a parsed title/request |
| 450 | + * returns a parsed title/request |
451 | 451 | */ |
452 | 452 | function parseTitle( $title ) { |
453 | 453 | global $mvDefaultClipLength; |
454 | 454 | // the metavid namespace: |
455 | 455 | // stream:stream_name || |
456 | | - // mvd:type:stream_name_date/start_time/end_time |
| 456 | + // mvd:type:stream_name_date/start_time/end_time |
457 | 457 | |
458 | 458 | $parts = split( '/', $title ); |
459 | 459 | if ( !isset( $parts[1] ) )$parts[1] = ''; |
460 | 460 | // check for type: |
461 | 461 | $sub_parts = split( ':', $parts[0] ); |
462 | | - |
| 462 | + |
463 | 463 | if ( count( $sub_parts ) == 2 ) { |
464 | 464 | if ( $sub_parts[0] == '' && $sub_parts[1] == '' ) { |
465 | 465 | $this->stream_name = null; |
— | — | @@ -474,7 +474,7 @@ |
475 | 475 | $this->stream_name = null; |
476 | 476 | } else { |
477 | 477 | // print_r($sub_parts); |
478 | | - // @@todo do look up of single part request |
| 478 | + // @@todo do look up of single part request |
479 | 479 | $this->stream_name = $sub_parts[0]; |
480 | 480 | // $this->stream_name = null; |
481 | 481 | } |
— | — | @@ -492,28 +492,28 @@ |
493 | 493 | } |
494 | 494 | } |
495 | 495 | // (support null endtimes) |
496 | | - // if the endtime is unset set it to the default length after the start time: |
| 496 | + // if the endtime is unset set it to the default length after the start time: |
497 | 497 | // if(!isset($end_time)){ |
498 | 498 | // $this->end_time = seconds2npt(npt2seconds($this->start_time) + $mvDefaultClipLength) ; |
499 | 499 | // } |
500 | 500 | |
501 | | - // @@todo make sure start time is not negative & end time is not > duration |
| 501 | + // @@todo make sure start time is not negative & end time is not > duration |
502 | 502 | |
503 | | - // validate the start time: |
| 503 | + // validate the start time: |
504 | 504 | if ( mvIsNtpTime( $this->start_time ) == false )$this->start_time = null; |
505 | | - |
506 | | - // validate the end time: |
| 505 | + |
| 506 | + // validate the end time: |
507 | 507 | if ( $this->end_time != null ) { |
508 | 508 | if ( mvIsNtpTime( $this->end_time ) == false )$this->end_time = null; |
509 | | - |
510 | | - // make sure the end time is > than the start time: |
| 509 | + |
| 510 | + // make sure the end time is > than the start time: |
511 | 511 | if ( npt2seconds( $this->start_time ) > npt2seconds( $this->end_time ) ) { |
512 | | - // @@TODO better error handling |
| 512 | + // @@TODO better error handling |
513 | 513 | $this->start_time = null; |
514 | 514 | $this->end_time = null; |
515 | 515 | } |
516 | 516 | } |
517 | 517 | } |
518 | | - |
| 518 | + |
519 | 519 | } |
520 | 520 | ?> |
Index: trunk/extensions/MetavidWiki/skins/mv_allpages.js |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | if( typeof wgServer!='undefined' && typeof wgScript != 'undefined'){ |
7 | 7 | var base_roe_url = wgServer + wgScript + '?title=Special:MvExportStream&feed_format=roe&stream_name='; |
8 | 8 | }else{ |
9 | | - var base_roe_url=''; |
| 9 | + var base_roe_url = ''; |
10 | 10 | } |
11 | 11 | //force wgScript path for blog support |
12 | 12 | if(typeof wgScript=='undefined') |
Index: trunk/extensions/MetavidWiki/skins/add_media_wizard.OFF.js |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | } |
56 | 56 | |
57 | 57 | //check if we are on a edit page: |
58 | | -if( wgAction == 'edit' || wgAction == 'submit' ){ |
| 58 | +if( wgAction == 'edit' || wgAction == 'submit' ){ |
59 | 59 | //add onPage ready request: |
60 | 60 | addOnloadHook( function(){ |
61 | 61 | var imE = document.createElement('img'); |