Index: trunk/extensions/MetavidWiki/maintenance/video_ocr_thumb_insert.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | // include commandLine.inc from the mediaWiki maintance dir: |
16 | 16 | require_once ( '../../../maintenance/commandLine.inc' ); |
17 | 17 | require_once ( 'metavid2mvWiki.inc.php' ); |
18 | | - |
| 18 | + |
19 | 19 | // include util functions: |
20 | 20 | require_once( 'maintenance_util.inc.php' ); |
21 | 21 | |
— | — | @@ -53,28 +53,28 @@ |
54 | 54 | $filename = $workingdir .'/'. $stream_name . '.mpeg'; |
55 | 55 | $duration = getDuration($filename); |
56 | 56 | |
| 57 | + |
| 58 | +//read the timestamp from the .srt |
| 59 | +$srt_file = $workingdir . '/' . $stream_name . '.srt'; |
| 60 | +$srt_ary = file( $srt_file ); |
| 61 | +if($srt_ary === false) |
| 62 | + die(' could not find srt file: ' . $srt_file); |
| 63 | + |
| 64 | +//time stamp: |
| 65 | +$org_start_time = intval( trim( str_replace( 'starttime' , '', $srt_ary[2] )) ); |
| 66 | + |
| 67 | +class streamObject{ }; |
| 68 | +$stream = new streamObject(); |
| 69 | +$stream->name = $stream_name; |
| 70 | +$stream->org_start_time = $org_start_time; |
| 71 | +$stream->sync_status = 'in_sync'; |
| 72 | +$stream->duration = $duration; |
| 73 | + |
| 74 | + |
57 | 75 | $mvTitle = new MV_Title( 'Stream:' . $stream_name ); |
58 | 76 | if ( !$mvTitle->doesStreamExist() ) { |
59 | 77 | print $stream_name . " does not exist ... creating\n"; |
60 | | - // print 'do stream desc'."\n"; |
61 | | - include_once('metavid2mvWiki.inc.php'); |
62 | | - |
63 | | - //read the timestamp from the .srt (this should be unified) |
64 | | - $srt_file = $workingdir . '/' . $stream_name . '.srt'; |
65 | | - $srt_ary = file( $srt_file ); |
66 | | - if($srt_ary === false) |
67 | | - die(' could not find srt file: ' . $srt_file); |
68 | | - |
69 | | - //time stamp: |
70 | | - $org_start_time = intval( trim( str_replace( 'starttime' , '', $srt_ary[2] )) ); |
71 | | - class streamObject{ |
72 | | - |
73 | | - } |
74 | | - $stream = new streamObject(); |
75 | | - $stream->name = $stream_name; |
76 | | - $stream->org_start_time = $org_start_time; |
77 | | - $stream->sync_status = 'in_sync'; |
78 | | - $stream->duration = $duration; |
| 78 | + // print 'do stream desc'."\n"; |
79 | 79 | |
80 | 80 | if(!isset($MVStreams)) |
81 | 81 | $MVStreams = array(); |
— | — | @@ -86,8 +86,16 @@ |
87 | 87 | } |
88 | 88 | $stream_id = $mvTitle->getStreamId(); |
89 | 89 | print 'got stream id: '. $stream_id . "\n"; |
| 90 | + |
| 91 | +//check for & update stream files: |
| 92 | +do_stream_file_check( $stream ); |
| 93 | + |
| 94 | + |
90 | 95 | $filedir = '/video/metavid/mvprime_stream_images/' . MV_StreamImage::getRelativeImagePath( $stream_id ); |
91 | | - |
| 96 | +if(!is_dir($filedir)){ |
| 97 | + shell_exec("mkdir {$filedir}"); |
| 98 | + shell_exec("chmod -R 777 {$filedir}"); |
| 99 | +} |
92 | 100 | echo "working on: $filename \n"; |
93 | 101 | $ocroutput = ""; |
94 | 102 | //@@TODO we should do sequential output and parse the OCR file if it already exists. |
— | — | @@ -110,8 +118,8 @@ |
111 | 119 | |
112 | 120 | //get ocr: |
113 | 121 | shell_exec("convert {$filedir}/{$i}.jpg -crop 457x30+63+358 {$workingdir}/temp.{$stream_id}.ocr.tif && convert {$workingdir}/temp.{$stream_id}.ocr.tif -resize 300% -level 10%,1,20% -monochrome +compress {$workingdir}/temp.{$stream_id}.ocr.tif"); |
114 | | - shell_exec("tesseract {$workingdir}/temp.{$stream_id}.ocr.tif {$workingdir}/ocrtemp{$i} nobatch lettersonly 2>&1"); |
115 | | - $ocr = shell_exec("tail {$workingdir}/ocrtemp{$i}.txt") ." at " . seconds2ntp($i) ." \n"; |
| 122 | + shell_exec("tesseract {$workingdir}/temp.{$stream_id}.ocr.tif {$workingdir}/ocrtemp{$stream_id} nobatch lettersonly 2>&1"); |
| 123 | + $ocr = shell_exec("tail {$workingdir}/ocrtemp{$stream_id}.txt") ." at " . seconds2ntp($i) ." \n"; |
116 | 124 | echo 'got ocr:'. $ocr; |
117 | 125 | $ocroutput .= $ocr; |
118 | 126 | |
— | — | @@ -120,7 +128,7 @@ |
121 | 129 | } |
122 | 130 | } |
123 | 131 | //remove temporary files: |
124 | | -shell_exec("rm {$workingdir}ocrtemp{$i}.txt"); |
| 132 | +shell_exec("rm {$workingdir}/ocrtemp{$i}.txt"); |
125 | 133 | shell_exec("rm {$workingdir}/temp.{$stream_id}.ocr.tif"); |
126 | 134 | |
127 | 135 | $ocrfileloc = "$workingdir/$stream_name.ocr"; |
Index: trunk/extensions/MetavidWiki/maintenance/metavid2mvWiki.php |
— | — | @@ -130,6 +130,9 @@ |
131 | 131 | case 'interest': |
132 | 132 | do_people_insert( $lookUpInterest = true ); |
133 | 133 | break; |
| 134 | + case 'file_check': |
| 135 | + do_stream_file_check(); |
| 136 | + break; |
134 | 137 | case 'update_templates' : |
135 | 138 | $force = ( isset( $options['force'] ) ) ? true:false; |
136 | 139 | include_once( 'metavid_gov_templates.php' ); |
Index: trunk/extensions/MetavidWiki/maintenance/metavid2mvWiki.inc.php |
— | — | @@ -34,105 +34,110 @@ |
35 | 35 | // if($i==3)die; |
36 | 36 | // $i++; |
37 | 37 | } |
38 | | -function do_stream_file_check( & $old_stream ) { |
| 38 | +function do_stream_file_check( $old_stream=false ) { |
39 | 39 | global $mvgIP, $mvVideoArchivePaths; |
40 | | - $mvStream = & mvGetMVStream( array ( |
41 | | - 'name' => $old_stream->name |
42 | | - ) ); |
43 | | - $file_list = $mvStream->getFileList(); |
44 | | - |
45 | | - // if ($old_stream->trascoded != 'none') { |
46 | | - // print "transcode is: " . $old_stream->trascoded; |
47 | | - /*if ($old_stream->trascoded == 'low') |
48 | | - $set = array ( |
49 | | - 'mv_ogg_low_quality' |
50 | | - ); |
51 | | - if ($old_stream->trascoded == 'high') |
52 | | - $set = array ( |
53 | | - 'mv_ogg_high_quality' |
54 | | - ); |
55 | | - if ($old_stream->trascoded == 'all') |
56 | | - $set = array ( |
57 | | - 'mv_ogg_high_quality', |
58 | | - 'mv_ogg_low_quality' |
59 | | - );*/ |
60 | | - // find the files and check for them on the servers: |
61 | | - // @@todo have multiple file locations for same file? |
62 | | - $set = array(); |
63 | | - foreach ( $mvVideoArchivePaths as $path ) { |
64 | | - if ( url_exists( $path . $old_stream->name . '.ogg' ) ) { |
65 | | - $set['mv_ogg_low_quality'] = $path . $old_stream->name . '.ogg'; |
66 | | - // force cap1 path @@todo remove!: |
67 | | - // $set['mv_ogg_low_quality']='http://128.114.20.64/media/' . $old_stream->name . '.ogg'; |
| 40 | + $stream_set = Array(); |
| 41 | + if($old_stream==false){ |
| 42 | + $dbr = wfGetDB( DB_READ ); |
| 43 | + $result = $dbr->select( 'mv_streams', |
| 44 | + array('name','state','date_start_time','duration'), |
| 45 | + '', |
| 46 | + __METHOD__, |
| 47 | + array('LIMIT'=> 9000)); |
| 48 | + if ( $dbr->numRows( $result ) == 0 )die("do_stream_file_check: no streams found"); |
| 49 | + while ( $row = $dbr->fetchObject( $result ) ) { |
| 50 | + $stream_set[] = $row; |
68 | 51 | } |
69 | | - if ( url_exists( $path . $old_stream->name . '.HQ.ogg' ) ) { |
70 | | - $set['mv_ogg_high_quality'] = $path . $old_stream->name . '.HQ.ogg'; |
71 | | - // force cap1 path @@todo remove!: |
72 | | - // $set['mv_ogg_high_quality']='http://128.114.20.64/media/' . $old_stream->name . '.HQ.ogg'; |
73 | | - } |
| 52 | + }else{ |
| 53 | + $stream_set = Array( $old_stream ); |
74 | 54 | } |
75 | | - if ( count( $set ) == 0 ) { |
76 | | - // no files present (remove stream) |
77 | | - print 'no files present should remove: ' . $old_stream->name . "\n"; |
78 | | - // make a valid mv title (with requted time: ) |
79 | | - /*$mvTitle = new MV_Title( $old_stream->name); |
80 | | - |
81 | | - $streamTitle = Title::newFromText( $old_stream->name, MV_NS_STREAM); |
82 | | - //print " new title: " . $streamTitle . "\n"; |
83 | | - $article = new MV_StreamPage($streamTitle, $mvTitle); |
84 | | - $article->doDelete('no files present for stream');*/ |
85 | | - } |
86 | | - // print "set: " . print_r($set); |
87 | | - // remove old file pointers: |
88 | | - $dbw = wfGetDB( DB_WRITE ); |
89 | | - $sql = "DELETE FROM `mv_stream_files` WHERE `stream_id`=" . $mvStream->id . " AND " . |
90 | | - "(`file_desc_msg`='mv_ogg_high_quality' OR `file_desc_msg`='mv_ogg_low_quality')"; |
91 | | - $dbw->query( $sql ); |
92 | | - // update files: |
93 | | - foreach ( $set as $qf => $path_url ) { |
94 | | - do_insert_stream_file( $mvStream, $path_url, $qf ); |
95 | | - } |
96 | | - // } |
97 | | - // check for archive.org stuff too.. |
98 | | - /*if($old_stream->archive_org!=''){ |
99 | | - $found=false; |
100 | | - foreach($file_list as $file){ |
101 | | - if($file->path_type =='ext_archive_org'){ |
102 | | - $found=true; |
| 55 | + foreach($stream_set as $stream){ |
| 56 | + $mvStream = & mvGetMVStream( array ( |
| 57 | + 'name' => $stream->name, |
| 58 | + 'duration' => $stream->duration |
| 59 | + ) ); |
| 60 | + $file_list = $mvStream->getFileList(); |
| 61 | + //print 'f:do_stream_file_check:' . $stream->name . ' dur: ' . $mvStream->getDuration() . "\n"; |
| 62 | + |
| 63 | + // @@todo have multiple file locations for same file? |
| 64 | + $set = array(); |
| 65 | + foreach ( $mvVideoArchivePaths as $path ) { |
| 66 | + if ( url_exists( $path . $stream->name . '.ogg' ) ) { |
| 67 | + $set['mv_ogg_low_quality'] = $path . $stream->name . '.ogg'; |
| 68 | + // force cap1 path @@todo remove!: |
| 69 | + // $set['mv_ogg_low_quality']='http://128.114.20.64/media/' . $stream->name . '.ogg'; |
103 | 70 | } |
| 71 | + if ( url_exists( $path . $stream->name . '.HQ.ogg' ) ) { |
| 72 | + $set['mv_ogg_high_quality'] = $path . $stream->name . '.HQ.ogg'; |
| 73 | + // force cap1 path @@todo remove!: |
| 74 | + // $set['mv_ogg_high_quality']='http://128.114.20.64/media/' . $stream->name . '.HQ.ogg'; |
| 75 | + } |
| 76 | + if ( url_exists( $path . $stream->name . '.flv' ) ) { |
| 77 | + $path = str_replace('/media/','', $path); |
| 78 | + $set['mv_flash_low_quality'] = $path . '/mvFlvServer.php/'. $stream->name . '.flv'; |
| 79 | + // force cap1 path @@todo remove!: |
| 80 | + // $set['mv_ogg_high_quality']='http://128.114.20.64/media/' . $stream->name . '.HQ.ogg'; |
| 81 | + } |
104 | 82 | } |
105 | | - if(!$found)do_insert_stream_file($mvStream, $old_stream, 'mv_archive_org_link'); |
106 | | - }*/ |
| 83 | + if ( count( $set ) == 0 ) { |
| 84 | + // no files present (remove stream) |
| 85 | + print 'no files present should remove: ' . $stream->name . "\n"; |
| 86 | + continue; |
| 87 | + } |
| 88 | + $dbw = wfGetDB( DB_WRITE ); |
| 89 | + $sql = "DELETE FROM `mv_stream_files` WHERE `stream_id`=" . $mvStream->id . " AND " . |
| 90 | + "(`file_desc_msg`='mv_ogg_high_quality' " . |
| 91 | + " OR `file_desc_msg`='mv_ogg_low_quality' " . |
| 92 | + " OR `file_desc_msg`='mv_flash_low_quality')"; |
| 93 | + $dbw->query( $sql ); |
| 94 | + // update files: |
| 95 | + if(!isset($set['mv_ogg_low_quality'])){ |
| 96 | + print "Missing lowQ ogg for: " .$stream->name ."\n"; |
| 97 | + } |
| 98 | + if(!isset($set['mv_ogg_high_quality'])){ |
| 99 | + print "Missing highQ ogg for: " .$stream->name ."\n"; |
| 100 | + } |
| 101 | + if(!isset($set['mv_flash_low_quality'])){ |
| 102 | + print "Missing flash for: " .$stream->name ."\n"; |
| 103 | + } |
| 104 | + foreach ( $set as $qf => $path_url ) { |
| 105 | + do_insert_stream_file( $mvStream, $path_url, $qf ); |
| 106 | + } |
| 107 | + } |
107 | 108 | } |
108 | 109 | |
109 | 110 | function do_insert_stream_file( $mvStream, $path, $quality_msg ) { |
110 | 111 | global $mvVideoArchivePaths; |
111 | 112 | $dbw = wfGetDB( DB_WRITE ); |
112 | | - |
113 | | - // get file duration from nfo file (if avaliable ): |
114 | | - $nfo_url = $path . '.nfo'; |
115 | | - $nfo_txt = @file( $nfo_url ); |
116 | | - if ( $nfo_txt ) { |
117 | | - if ( isset( $nfo_txt[0] ) ) { |
118 | | - list( $na, $len ) = explode( 'n:', $nfo_txt[0] ); |
119 | | - $len = trim( $len ); |
120 | | - // trim leading zero |
121 | | - if ( $len[0] == '0' )$len = substr( $len, 1 ); |
122 | | - // trim sub frame times: |
123 | | - if ( strpos( $len, '.' ) !== false ) { |
124 | | - $len = substr( $len, 0, strpos( $len, '.' ) ); |
| 113 | + $dur = $mvStream->getDuration(); |
| 114 | + // get file duration from nfo file : |
| 115 | + if($dur == 0){ |
| 116 | + $nfo_url = $path . '.nfo'; |
| 117 | + if( url_exists($nfo_url) ){ |
| 118 | + $nfo_txt = @file( $nfo_url ); |
| 119 | + if ( $nfo_txt !== false ) { |
| 120 | + if ( isset( $nfo_txt[0] ) ) { |
| 121 | + list( $na, $len ) = explode( 'n:', $nfo_txt[0] ); |
| 122 | + $len = trim( $len ); |
| 123 | + // trim leading zero |
| 124 | + if ( $len[0] == '0' )$len = substr( $len, 1 ); |
| 125 | + // trim sub frame times: |
| 126 | + if ( strpos( $len, '.' ) !== false ) { |
| 127 | + $len = substr( $len, 0, strpos( $len, '.' ) ); |
| 128 | + } |
| 129 | + $dur = ntp2seconds( $len ); |
| 130 | + } else { |
| 131 | + echo "empty nfo file: $nfo_url \n"; |
| 132 | + $dur = 0; |
| 133 | + } |
| 134 | + } else { |
| 135 | + echo "missing nfo file: $nfo_url \n"; |
| 136 | + $dur = 0; |
125 | 137 | } |
126 | | - $dur = ntp2seconds( $len ); |
127 | | - } else { |
128 | | - echo "empty nfo file: $nfo_url \n"; |
129 | | - $dur = 0; |
130 | 138 | } |
131 | | - } else { |
132 | | - echo "missing nfo file: $nfo_url \n"; |
133 | | - $dur = 0; |
134 | 139 | } |
135 | 140 | $sql = "INSERT INTO `mv_stream_files` (`stream_id`, `file_desc_msg`, `path`, `duration`)" . |
136 | | - " VALUES ('{$mvStream->id}', '{$quality_msg}', " . " '{$path}', {$dur} )"; |
| 141 | + " VALUES ('{$mvStream->id}', '{$quality_msg}', '{$path}', {$dur} )"; |
137 | 142 | $dbw->query( $sql ); |
138 | 143 | } |
139 | 144 | // @@todo convert to MV_EditStream |
Index: trunk/extensions/MetavidWiki/maintenance/maintenance_util.inc.php |
— | — | @@ -193,7 +193,7 @@ |
194 | 194 | return $new_n; |
195 | 195 | } |
196 | 196 | function url_exists( $url ) { |
197 | | - $url = str_replace( "http://", "", $url ); |
| 197 | + $url = str_replace( "http://", "", $url ); |
198 | 198 | if ( strstr( $url, "/" ) ) { |
199 | 199 | $url = explode( "/", $url, 2 ); |
200 | 200 | $url[1] = "/" . $url[1]; |
Index: trunk/extensions/MetavidWiki/includes/MV_DefaultSettings.php |
— | — | @@ -88,8 +88,8 @@ |
89 | 89 | $mvShellOggFrameGrab = ''; |
90 | 90 | |
91 | 91 | # define the video media locations based on path/server names |
92 | | -$mvVideoArchivePaths['mvprime'] = 'http://metavid.org/media/'; |
93 | | -$mvVideoArchivePaths['cap1'] = 'http://128.114.20.64/media/'; |
| 92 | +$mvVideoArchivePaths['cap1'] = 'http://metavidstorage01.ucsc.edu/media/'; |
| 93 | +$mvVideoArchivePaths['mvbox2'] = 'http://mvbox2.cse.ucsc.edu/media/'; |
94 | 94 | |
95 | 95 | // stream msgKeys that support ?t=start_time/end_time temporal url media serving: |
96 | 96 | $mvDefaultVideoQualityKey = 'mv_ogg_low_quality'; |
Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php |
— | — | @@ -594,7 +594,7 @@ |
595 | 595 | //check a few different types: |
596 | 596 | $stream_url = $mvTitle->getWebStreamURL($mvDefaultVideoQualityKey); |
597 | 597 | if($stream_url !== false && isset( $mvVidQualityMsgKeyType[ $mvDefaultVideoQualityKey ]) ) { |
598 | | - echo '<enclosure name="'. wfMsg($vid_key) .'" type="video/ogg" url="'. mvRSSFeed::xmlEncode( $ogg_stream_url ) .'"/>'; |
| 598 | + echo '<enclosure name="'. wfMsg($mvDefaultVideoQualityKey) .'" type="video/ogg" url="'. mvRSSFeed::xmlEncode( $ogg_stream_url ) .'"/>'; |
599 | 599 | } |
600 | 600 | ?> |
601 | 601 | <comments> |
Index: trunk/extensions/MetavidWiki/skins/add_media_wizard.js |
— | — | @@ -8,7 +8,6 @@ |
9 | 9 | |
10 | 10 | //if mv_embed is hosted somewhere other than near by the add_media_wizard you can define it here: |
11 | 11 | var mv_add_media_wizard_path = 'http://mvbox2.cse.ucsc.edu/w/extensions/MetavidWiki/skins/'; |
12 | | -var mv_add_media_wizard_path = 'http://localhost/wiki/extensions/MetavidWiki/skins/'; |
13 | 12 | |
14 | 13 | |
15 | 14 | //*code should not have to modify anything below*/ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mv_upload.js |
— | — | @@ -11,6 +11,7 @@ |
12 | 12 | gMsg['upload-transcoded-status'] = 'Transcoded'; |
13 | 13 | gMsg['uploaded-status'] = 'Uploaded'; |
14 | 14 | gMsg['upload-select-file'] = 'Select File...'; |
| 15 | +gMsg['wgfogg_wrong_version'] = 'You have firefogg installed but its outdated, <a href="http://firefogg.org">please upgrade</a> '; |
15 | 16 | |
16 | 17 | var default_upload_options = { |
17 | 18 | 'target_div':'', |
— | — | @@ -86,7 +87,7 @@ |
87 | 88 | //if firefog is not taking over the submit we can here: |
88 | 89 | if( ! init_firefogg( intFirefoggObj ) ){ |
89 | 90 | //firefogg handles the form submit (even on image uploads when called by gui) |
90 | | - if( !this.on_upload_page ){ |
| 91 | + if( ! this.on_upload_page ){ |
91 | 92 | |
92 | 93 | } |
93 | 94 | } |
— | — | @@ -101,6 +102,9 @@ |
102 | 103 | '<span id="wgfogg_not_installed">' + |
103 | 104 | getMsg('upload-fogg_not_installed') + |
104 | 105 | '</span>'+ |
| 106 | + '<span id="wgfogg_wrong_version">'+ |
| 107 | + getMsg('wgfogg_wrong_version')+ |
| 108 | + '</span>'+ |
105 | 109 | '<span id="wgfogg_installed" style="display:none" >'+ |
106 | 110 | '<input id="wgEnableFirefogg" type="checkbox" name="wgEnableFirefogg" >' + |
107 | 111 | getMsg('upload-enable-converter') + |
— | — | @@ -109,7 +113,7 @@ |
110 | 114 | //hard code style (since not always easy to import style sheets) |
111 | 115 | $j('[@name=wpUpload]').eq(0).before('<div id="dlbox-centered" class="dlbox-centered" style="display:none;'+ |
112 | 116 | 'position:fixed;background:#DDD;border:3px solid #AAA;font-size:115%;width:40%;'+ |
113 | | - 'height:50%;padding: 10px;z-index:100;top:50%;left:15%;" >'+ |
| 117 | + 'height:50%;padding: 10px;z-index:100;top:30%;left:15%;" >'+ |
114 | 118 | '<h5>' + getMsg('upload-in-progress') + '</h5>' + |
115 | 119 | '<div id="fogg-pbar-container" style="border:solid thin gray;width:90%;height:15px;" >' + |
116 | 120 | '<div id="fogg-progressbar" style="background:#AAC;width:0%;height:15px;"></div>' + |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/firefogg.js |
— | — | @@ -8,6 +8,7 @@ |
9 | 9 | init_firefogg(); |
10 | 10 | }); |
11 | 11 | } |
| 12 | +var min_firefogg_version = '0.9.2'; |
12 | 13 | function init_firefogg( iObj ){ |
13 | 14 | if(!iObj) |
14 | 15 | iObj = {}; |
— | — | @@ -21,8 +22,12 @@ |
22 | 23 | }else{ |
23 | 24 | e = document.getElementById('wgfogg_not_installed'); |
24 | 25 | if(e) |
| 26 | + e.style.display='none'; |
| 27 | + |
| 28 | + e = document.getElementById('wgfogg_wrong_version'); |
| 29 | + if(e) |
25 | 30 | e.style.display='none'; |
26 | | - |
| 31 | + |
27 | 32 | e = document.getElementById('wgfogg_installed'); |
28 | 33 | if(e) |
29 | 34 | e.style.display='inline'; |
— | — | @@ -32,6 +37,18 @@ |
33 | 38 | js_log('wgEnableFirefogg found:'); |
34 | 39 | //get a new fogg object with default options |
35 | 40 | var fogg = new upFirefogg( iObj ); |
| 41 | + |
| 42 | + //do the version check: |
| 43 | + var fv = fogg.ogg.version; |
| 44 | + if(fv.replace(/[^0-9]/gi, '') < min_firefogg_version.replace(/[^0-9]/gi, '') ){ |
| 45 | + e = document.getElementById('wgfogg_wrong_version'); |
| 46 | + if(e) |
| 47 | + e.style.display='inline'; |
| 48 | + |
| 49 | + e = document.getElementById('wgfogg_installed'); |
| 50 | + if(e) |
| 51 | + e.style.display='none'; |
| 52 | + } |
36 | 53 | |
37 | 54 | //make sure the checkbox accurately reflects the current state: |
38 | 55 | if(fogg.enabled == false) |
— | — | @@ -68,6 +85,8 @@ |
69 | 86 | this[i] = default_firefogg_options[i]; |
70 | 87 | } |
71 | 88 | } |
| 89 | + //init the Firefogg obj |
| 90 | + this.ogg = new Firefogg(); |
72 | 91 | }, |
73 | 92 | enable_fogg:function(){ |
74 | 93 | var _this = this; |
— | — | @@ -87,7 +106,7 @@ |
88 | 107 | sfe = document.getElementById('fogg-video-file'); |
89 | 108 | if(sfe) sfe.style.display='inline'; |
90 | 109 | |
91 | | - _this.ogg = new Firefogg(); |
| 110 | + |
92 | 111 | addHandler( sfe, 'click', function(){ |
93 | 112 | //add binding: |
94 | 113 | _this.select_fogg(); |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css |
— | — | @@ -256,7 +256,7 @@ |
257 | 257 | z-index: 4; |
258 | 258 | float: right; |
259 | 259 | display: inline; |
260 | | - margin: -13px 0 0 0; |
| 260 | + margin: -12px 0 0 0; |
261 | 261 | background: url(images/player_seek_right.png) 0 0 no-repeat; |
262 | 262 | } |
263 | 263 | .videoPlayer .seeker .mv_progress{ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -1410,7 +1410,7 @@ |
1411 | 1411 | var no_param_uri = uri.substr(0, end_inx); |
1412 | 1412 | switch( no_param_uri.substr(no_param_uri.lastIndexOf('.'),4) ){ |
1413 | 1413 | case '.flv':return 'video/x-flv';break; |
1414 | | - case '.ogg':return 'video/ogg';break; |
| 1414 | + case '.ogg': case '.ogv': return 'video/ogg';break; |
1415 | 1415 | case '.anx':return 'video/ogg';break; |
1416 | 1416 | } |
1417 | 1417 | } |
— | — | @@ -1903,13 +1903,21 @@ |
1904 | 1904 | return default_time_req; |
1905 | 1905 | return this.media_element.selected_source.start_ntp+'/'+this.media_element.selected_source.end_ntp; |
1906 | 1906 | }, |
1907 | | - getDuration:function(){ |
1908 | | - //update some local pointers for the selected source: |
1909 | | - if( this.media_element.selected_source.duration != 0 ) |
| 1907 | + getDuration:function(){ |
| 1908 | + //update some local pointers for the selected source: |
| 1909 | + if( this.media_element.selected_source.duration && |
| 1910 | + this.media_element.selected_source.duration != 0 ){ |
1910 | 1911 | this.duration = this.media_element.selected_source.duration; |
1911 | | - this.start_offset = this.media_element.selected_source.start_offset; |
1912 | | - this.start_ntp = this.media_element.selected_source.start_ntp; |
1913 | | - this.end_ntp = this.media_element.selected_source.end_ntp; |
| 1912 | + this.start_offset = this.media_element.selected_source.start_offset; |
| 1913 | + this.start_ntp = this.media_element.selected_source.start_ntp; |
| 1914 | + this.end_ntp = this.media_element.selected_source.end_ntp; |
| 1915 | + }else{ |
| 1916 | + //update start end_ntp if duration !=0 (set from plugin) |
| 1917 | + if(this.duration && this.duration !=0){ |
| 1918 | + this.start_ntp = '0:0:0'; |
| 1919 | + this.end_ntp = seconds2ntp( this.duration ); |
| 1920 | + } |
| 1921 | + } |
1914 | 1922 | //return the duration |
1915 | 1923 | return this.duration; |
1916 | 1924 | }, |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_flashEmbed.js |
— | — | @@ -1692,13 +1692,19 @@ |
1693 | 1693 | if( ! this.monitorTimerId ){ |
1694 | 1694 | if( $j('#'+this.id).length != 0 ) |
1695 | 1695 | this.monitorTimerId = window.setInterval('$j(\'#'+_this.id+'\').get(0).monitor()', 250); |
1696 | | - } |
1697 | | - //set the start & end ntp |
1698 | | - var end_ntp = (this.media_element.selected_source.end_ntp)? |
1699 | | - this.media_element.selected_source.end_ntp : seconds2ntp(0); |
1700 | | - var start_ntp = this.media_element.selected_source.start_ntp; |
| 1696 | + } |
1701 | 1697 | |
1702 | 1698 | var flash_state = this.fla.getStatus(); |
| 1699 | + //update the duration from the clip if its zero or not set: |
| 1700 | + if( !this.duration || this.duration==0 ){ |
| 1701 | + if( this.fla.getClip() ){ |
| 1702 | + this.duration = this.fla.getClip().fullDuration; |
| 1703 | + js_log('set duration via clip value: ' + this.getDuration() ); |
| 1704 | + } |
| 1705 | + } |
| 1706 | + //update the duration ntp values: |
| 1707 | + this.getDuration(); |
| 1708 | + |
1703 | 1709 | if( typeof flash_state == 'undefined' ){ |
1704 | 1710 | var flash_state = { |
1705 | 1711 | "time" : this.fla.getTime() |
— | — | @@ -1724,7 +1730,7 @@ |
1725 | 1731 | } |
1726 | 1732 | } |
1727 | 1733 | |
1728 | | - if(this.currentTime > ntp2seconds(start_ntp) && !this.startedTimedPlayback){ |
| 1734 | + if(this.currentTime > ntp2seconds(this.start_ntp) && !this.startedTimedPlayback){ |
1729 | 1735 | var fail = false; |
1730 | 1736 | try |
1731 | 1737 | { |
— | — | @@ -1747,35 +1753,30 @@ |
1748 | 1754 | js_log('flashEmbed: _local_ Seeking to ' + this.seek_time_sec); |
1749 | 1755 | this.fla.seek( this.seek_time_sec ); |
1750 | 1756 | this.seek_time_sec = 0; |
1751 | | - } |
1752 | | - |
1753 | | - //flash is giving bogus duration get from "this" (if available) |
1754 | | - /*if(!this.media_element.selected_source.end_ntp && this.fla.getDuration()>0) |
1755 | | - this.media_element.selected_source.setDuration(this.fla.getDuration()); |
1756 | | - */ |
| 1757 | + } |
1757 | 1758 | |
1758 | 1759 | if(!this.userSlide){ |
1759 | | - if((this.currentTime - ntp2seconds(start_ntp)) < 0){ |
| 1760 | + if((this.currentTime - ntp2seconds(this.start_ntp)) < 0){ |
1760 | 1761 | this.setStatus('buffering...'); |
1761 | 1762 | this.fla.setVolume(0); |
1762 | 1763 | }else{ |
1763 | | - this.setStatus( seconds2ntp(this.currentTime) + '/' + end_ntp); |
1764 | | - this.setSliderValue((this.currentTime - ntp2seconds(start_ntp)) / (ntp2seconds(end_ntp)-ntp2seconds(start_ntp)) ); |
| 1764 | + this.setStatus( seconds2ntp(this.currentTime) + '/' + this.end_ntp); |
| 1765 | + this.setSliderValue((this.currentTime - ntp2seconds(this.start_ntp)) / (ntp2seconds(this.end_ntp)-ntp2seconds(this.start_ntp)) ); |
1765 | 1766 | } |
1766 | 1767 | } |
1767 | 1768 | |
1768 | 1769 | //checks to see if we reached the end of playback: |
1769 | | - if(this.startedTimedPlayback && |
1770 | | - ( this.currentTime > (ntp2seconds(end_ntp)+1) |
| 1770 | + if(this.duration && this.startedTimedPlayback && |
| 1771 | + ( this.currentTime > (ntp2seconds(this.end_ntp)+1) |
1771 | 1772 | || |
1772 | | - ( this.currentTime > (ntp2seconds(end_ntp)-1) |
| 1773 | + ( this.currentTime > (ntp2seconds(this.end_ntp)-1) |
1773 | 1774 | && this.prevTime == this.currentTime) ) |
1774 | 1775 | ){ |
1775 | | - js_log('probally reached end of stream: '+this.currentTime); |
| 1776 | + js_log('prbally reached end of stream: '+this.currentTime); |
1776 | 1777 | this.onClipDone(); |
1777 | 1778 | } |
1778 | 1779 | this.prevTime = this.currentTime; |
1779 | | - //js_log('cur perc loaded: ' + this.fla.getPercentLoaded() +' cur time : ' + (this.currentTime - ntp2seconds(start_ntp)) +' / ' +(ntp2seconds(end_ntp)-ntp2seconds(start_ntp))); |
| 1780 | + //js_log('cur perc loaded: ' + this.fla.getPercentLoaded() +' cur time : ' + (this.currentTime - ntp2seconds(this.start_ntp)) +' / ' +(ntp2seconds(this.end_ntp)-ntp2seconds(this.start_ntp))); |
1780 | 1781 | }, |
1781 | 1782 | // get the embed fla object |
1782 | 1783 | getFLA : function (){ |