Changeset 220
- Timestamp:
- 06/16/09 02:35:00 (5 months ago)
- Files:
-
- 4 removed
- 21 modified
-
plugins/captions/captions.swf (modified) (previous)
-
plugins/captions/com/jeroenwijering/plugins/Captions.as (modified) (6 diffs)
-
plugins/hd/com/jeroenwijering/plugins/HD.as (modified) (1 diff)
-
plugins/hd/hd.swf (modified) (previous)
-
plugins/hd/hd.xml (modified) (2 diffs)
-
plugins/livestream/livestream.swf (modified) (previous)
-
plugins/revolt/revolt.xml (modified) (1 diff)
-
plugins/snapshot/snapshot.xml (modified) (1 diff)
-
plugins/yousearch/yousearch.xml (modified) (1 diff)
-
testing/index.html (modified) (1 diff)
-
testing/settings.js (modified) (2 diffs)
-
trunk/as2 (deleted)
-
trunk/as3/com/jeroenwijering/models/HTTPModel.as (modified) (3 diffs)
-
trunk/as3/com/jeroenwijering/models/RTMPModel.as (modified) (4 diffs)
-
trunk/as3/com/jeroenwijering/models/VideoModel.as (modified) (1 diff)
-
trunk/as3/com/jeroenwijering/player/Controller.as (modified) (1 diff)
-
trunk/as3/com/jeroenwijering/plugins/Controlbar.as (modified) (1 diff)
-
trunk/as3/com/jeroenwijering/plugins/Dock.as (modified) (4 diffs)
-
trunk/as3/player.pdf (deleted)
-
trunk/as3/player.swf (modified) (previous)
-
trunk/sdk/plugins/controlling/Controlling.as (modified) (1 diff)
-
trunk/sdk/plugins/controlling/controlling.swf (modified) (previous)
-
trunk/sdk/readme.html (modified) (2 diffs)
-
trunk/sl1/wmvplayer.pdf (deleted)
-
trunk/sl2 (deleted)
Legend:
- Unmodified
- Added
- Removed
-
plugins/captions/com/jeroenwijering/plugins/Captions.as
r217 r220 42 42 /** Reference to the textfield. **/ 43 43 public var field:TextField; 44 /** Reference to the background graphic. **/ 45 private var back:MovieClip; 44 46 /** The array the captions are loaded into. **/ 45 47 private var captions:Array; … … 66 68 67 69 private function drawClip():void { 68 var rct:MovieClip = new MovieClip(); 69 rct.graphics.beginFill(0x000000,0.6); 70 rct.graphics.drawRect(0,0,400,60); 70 back = new MovieClip(); 71 back.graphics.beginFill(0x000000,0.75); 72 back.graphics.drawRect(0,0,400,20); 73 clip.addChild(back); 71 74 format = new TextFormat(); 72 75 format.color = 0xFFFFFF; … … 78 81 field.width = 400; 79 82 field.height = 10; 80 field.y = 10;83 field.y = 5; 81 84 field.autoSize = "center"; 82 85 field.selectable = false; … … 84 87 field.wordWrap = true; 85 88 field.defaultTextFormat = format; 86 clip.addChild(rct);87 89 clip.addChild(field); 88 90 if(config['back'] == false) { 89 rct.alpha = 0; 90 var ftr:DropShadowFilter = new DropShadowFilter(0,45,0,1,2,2,10,3); 91 field.filters = new Array(ftr); 91 back.alpha = 0; 92 field.filters = new Array(new DropShadowFilter(0,45,0,1,2,2,10,3)); 92 93 } 93 94 }; … … 186 187 } 187 188 if(fnd == true && !captions) { 188 field.htmlText = txt ;189 field.htmlText = txt+' '; 189 190 resizeHandler(); 190 191 Logger.log(txt,'caption'); … … 195 196 /** Resize the captions if the display changes. **/ 196 197 private function resizeHandler(evt:ControllerEvent=undefined):void { 198 back.height = field.height + 10; 197 199 clip.width = view.config['width']; 198 200 clip.scaleY = clip.scaleX; 199 if(config['back'] == false) {200 field.y = 50 - field.height;201 }202 201 clip.y = view.config['height']-clip.height; 203 202 }; -
plugins/hd/com/jeroenwijering/plugins/HD.as
r218 r220 106 106 if(evt.data.bandwidth && !checked) { 107 107 checked = true; 108 if( (evt.data.bandwidth < config['bitrate']) ==config['state']) {108 if(evt.data.bandwidth < config['bitrate'] && config['state']) { 109 109 clickHandler(); 110 110 } -
plugins/hd/hd.xml
r217 r220 19 19 <default>1500</default> 20 20 <description> 21 Bitrate of the HD file to play. 21 Bitrate of the HD file to play. 22 22 This is automatically picked up for HTTP streamed files, but not for RTMP streamed files. 23 23 Therefore you can set an HD bitrate through this flashvar. … … 40 40 </description> 41 41 </flashvar> 42 <flashvar> 43 <name>state</name> 44 <default>true</default> 45 <description> 46 When false, the player will start with the low-quality video, no matter the bandwidth detected. 47 </description> 48 </flashvar> 42 49 </flashvars> 43 50 -
plugins/revolt/revolt.xml
r173 r220 10 10 <flashvars> 11 11 <flashvar> 12 <name>position</name>13 <default></default>14 <description>Position of the plugin. Over the display by default.</description>15 </flashvar>16 <flashvar>17 <name>size</name>18 <default></default>19 <description>Width or height of the plugin when not over the display.</description>20 </flashvar>21 <flashvar>22 12 <name>gain</name> 23 13 <default>1</default> 24 14 <description>Amplicifation of the audio input for building the graphics. Set this higher (e.g. 1.5) for wilder graphics.</description> 25 </flashvar>26 <flashvar>27 <name>simple</name>28 <default></default>29 <description>When set to "true", the plugin shows a simple waveform instead of the fancy, colorful graphics. The waveform will have the color of the "lightcolor" flashvar of the player.</description>30 15 </flashvar> 31 16 <flashvar> -
plugins/snapshot/snapshot.xml
r217 r220 9 9 It sends the JPG to a serverside script for processing and displays the returning URL. 10 10 Note that the server hosting your FLV files needs to have a crossdomain XML for this. 11 Here is a very basic example of such a (PHP) script. Note it doesn't take security into account!11 Here is a very basic example of such a (PHP) script. 12 12 13 <?php 14 if(isset ($GLOBALS["HTTP_RAW_POST_DATA"])) { 15 $im = $GLOBALS["HTTP_RAW_POST_DATA"]; 16 $rn = rand(); 17 $fp = fopen('snapshots/'.$rn.'.jpg', 'wb'); 18 fwrite($fp, $im); 19 fclose($fp); 20 echo 'http://www.myserver.com/snapshots/'.$rn.'.jpg'; 21 } else { 22 echo 'result=An error occured.'; 23 } 24 ?>]]> 25 26 Alternatively, the player can send just a position variable to the server. 27 The server then has to take care of rendering the snapshot. 13 <?php 14 if(isset ($GLOBALS["HTTP_RAW_POST_DATA"])) { 15 $im = $GLOBALS["HTTP_RAW_POST_DATA"]; 16 $rn = rand(); 17 $fp = fopen('snapshots/'.$rn.'.jpg', 'wb'); 18 fwrite($fp, $im); 19 fclose($fp); 20 if (exif_imagetype($rn.'.jpg') == IMAGETYPE_JPEG) { 21 echo 'http://www.myserver.com/snapshots/'.$rn.'.jpg'; 22 exit(); 23 } 24 } 25 echo "error"; 26 ?>]]> 28 27 </description> 29 28 <href>http://developer.longtailvideo.com/trac/browser/plugins/snapshot</href> 30 29 31 30 <flashvars> 32 <flashvar>33 <name>data</name>34 <default>true</default>35 <description>If true, the plugin will send raw JPG data to the serverside script. If false, the plugin will do a simple GET ping to the serverside script with the position in seconds as variable. You can use the latter if you want to generate the snapshot serverside.</description>36 </flashvar>37 31 <flashvar> 38 32 <name>script</name> -
plugins/yousearch/yousearch.xml
r215 r220 14 14 <href>http://developer.longtailvideo.com/trac/browser/plugins/yousearch</href> 15 15 16 <flashvars> 17 <flashvar> 18 <name>script</name> 19 <default>http://gdata.youtube.com/feeds/api/videos?vq=QUERY&format=5</default> 20 <description> 21 Location of the script called when a search is performed. 22 The 'QUERY' part will be replaced by the actul search query. 23 Defaults to a search at Youtube.com. 24 </description> 25 </flashvar> 26 </flashvars> 16 <flashvars /> 27 17 28 18 </plugin> -
testing/index.html
r218 r220 406 406 <label>repeat</label> 407 407 <input type="text" name="repeat" /> 408 <label>resizing</label>409 <input type="text" name="resizing" />410 408 <label>shuffle</label> 411 409 <input type="text" name="shuffle" /> -
testing/settings.js
r217 r220 232 232 width:500, 233 233 plugins:'hd', 234 'hd.file':'../../testing/files/bunny.m p4'234 'hd.file':'../../testing/files/bunny.m4v' 235 235 }, 236 236 'Livestream plugin': { … … 243 243 'livestream.streamer':'rtmp://fl9.maelstrom.jet-stream.nl:80/vod/' 244 244 }, 245 'Metaviewer and revolt plugins': {245 'Metaviewer plugin': { 246 246 file:'../../testing/files/bunny.flv', 247 247 height:260, 248 width: 900,248 width:800, 249 249 repeat:'always', 250 250 stretching:'fill', 251 plugins:'revolt,metaviewer', 252 'revolt.gain':2, 253 'revolt.position':'left', 254 'revolt.size':300, 251 plugins:'metaviewer', 255 252 'metaviewer.position':'right', 256 'metaviewer.size':300 253 'metaviewer.size':400 254 }, 255 'Revolt plugin': { 256 file:'files/bunny.mp3', 257 height:260, 258 width:500, 259 repeat:'always', 260 plugins:'revolt', 261 'revolt.gain':2 257 262 }, 258 263 'Snapshot plugin': { -
trunk/as3/com/jeroenwijering/models/HTTPModel.as
r213 r220 147 147 protected function loadHandler():void { 148 148 var ldd:Number = stream.bytesLoaded; 149 var ttl:Number = stream.bytesTotal + byteoffset; 150 var off:Number = byteoffset; 149 var ttl:Number = stream.bytesTotal; 150 var pct:Number = timeoffset/(item['duration']+0.001); 151 var off:Number = Math.round(ttl*pct/(1-pct)); 152 ttl += off; 151 153 model.sendEvent(ModelEvent.LOADED,{loaded:ldd,total:ttl,offset:off}); 152 154 if(ldd+off >= ttl && ldd > 0) { … … 230 232 model.sendEvent(ModelEvent.TIME,{position:position,duration:item['duration']}); 231 233 } else if (item['duration'] > 0) { 232 pause(); 234 stream.pause(); 235 clearInterval(interval); 233 236 model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.COMPLETED}); 234 237 } … … 254 257 stream.seek(getOffset(position,true)); 255 258 } 256 interval = setInterval(positionInterval,100); 257 model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.PLAYING}); 259 play(); 258 260 } 259 261 }; -
trunk/as3/com/jeroenwijering/models/RTMPModel.as
r210 r220 140 140 if(position < item['duration']) { 141 141 model.sendEvent(ModelEvent.TIME,{position:position,duration:item['duration']}); 142 } else if (item['duration'] > 0) { 143 pause(); 142 } else if (!isNaN(position) && item['duration'] > 0) { 143 stream.pause(); 144 clearInterval(interval); 145 if(started && item['duration'] == 0) { stop(); } 144 146 model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.COMPLETED}); 145 147 } … … 151 153 position = pos; 152 154 clearInterval(interval); 153 if(model.config['state'] == ModelStates.PAUSED) {155 if(model.config['state'] != ModelStates.PLAYING) { 154 156 stream.resume(); 155 157 } … … 181 183 case 'NetConnection.Connect.Success': 182 184 if(evt.info.secureToken != undefined) { 183 connection.call("secureTokenResponse",null,TEA.decrypt(evt.info.secureToken,model.config['token'])); 185 connection.call("secureTokenResponse",null, 186 TEA.decrypt(evt.info.secureToken,model.config['token'])); 184 187 } 185 188 setStream(); … … 199 202 break; 200 203 case 'NetConnection.Connect.Rejected': 201 if(evt.info.ex && evt.info.ex.code == 302) {204 if(evt.info.ex.code == 302) { 202 205 item['streamer'] = evt.info.ex.redirect; 203 connection.connect(item['streamer']); 206 setTimeout(load,100,item); 207 return; 204 208 } 205 209 break; -
trunk/as3/com/jeroenwijering/models/VideoModel.as
r210 r220 141 141 model.sendEvent(ModelEvent.TIME,{position:position,duration:item['duration']}); 142 142 } else if (item['duration'] > 0) { 143 pause(); 143 stream.pause(); 144 clearInterval(interval); 144 145 model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.COMPLETED}); 145 146 } -
trunk/as3/com/jeroenwijering/player/Controller.as
r211 r220 325 325 private function playlistHandler(ply:Array):void { 326 326 for(var i:Number = ply.length-1; i > -1; i--) { 327 if(!ply[i]['duration'] ) { ply[i]['duration'] = 0; }328 if(!ply[i]['start'] ) { ply[i]['start'] = 0; }327 if(!ply[i]['duration'] || isNaN(ply[i]['duration'])) { ply[i]['duration'] = 0; } 328 if(!ply[i]['start'] || isNaN(ply[i]['start'])) { ply[i]['start'] = 0; } 329 329 if(!ply[i]['streamer'] && config['streamer']) { 330 330 ply[i]['streamer'] = config['streamer']; -
trunk/as3/com/jeroenwijering/plugins/Controlbar.as
r210 r220 179 179 } catch (err:Error) {} 180 180 try { 181 if(view.playlist && view.playlist[view.config['item']]['link'] && !view.config['dock']) {181 if(view.playlist && view.playlist[view.config['item']]['link']) { 182 182 clip.linkButton.visible = true; 183 183 } else { -
trunk/as3/com/jeroenwijering/plugins/Dock.as
r218 r220 19 19 /** Configuration vars for this plugin. **/ 20 20 public var config:Object = { 21 align:'right', 22 link:true 21 align:'right' 23 22 }; 24 23 /** Reference to the skin MVC. **/ … … 32 31 /** Timeout for hiding the buttons when the video plays. **/ 33 32 private var timeout:Number; 34 /** Linkbutton reference. **/35 private var link:DockButton;36 33 37 34 … … 64 61 if(view.config['dock']) { 65 62 view.addControllerListener(ControllerEvent.RESIZE,resizeHandler); 66 view.addControllerListener(ControllerEvent.ITEM,itemHandler);67 view.addControllerListener(ControllerEvent.PLAYLIST,itemHandler);68 63 view.addModelListener(ModelEvent.STATE,stateHandler); 69 64 clip.stage.addEventListener(MouseEvent.MOUSE_MOVE,moveHandler); … … 74 69 setColorTransforms(); 75 70 } 76 };77 78 79 /** Let's see if the new item has a link. **/80 private function itemHandler(evt:ControllerEvent):void {81 if(link) {82 removeButton(link);83 }84 if(view.playlist[view.config['item']]['link'] && config['link']) {85 link = addButton(null,'visit link',linkHandler);86 }87 }88 89 90 /** Manage clicks on the docks' link button. **/91 private function linkHandler(evt:MouseEvent):void {92 view.sendEvent(ViewEvent.LINK,view.config['item']);93 71 }; 94 72 -
trunk/sdk/plugins/controlling/Controlling.as
r209 r220 26 26 button.graphics.beginFill(0x000000,0.5); 27 27 button.graphics.drawRoundRect(10,10,40,40,5); 28 button.graphics.beginFill(0xFF FFFF,1);28 button.graphics.beginFill(0xFF0000,1); 29 29 button.graphics.drawCircle(30,30,8); 30 30 addChild(button); -
trunk/sdk/readme.html
r209 r220 47 47 <p>Exactly which players, skins, plugins and examples to show can be set in the <a href="files/settings.js">files/settings.js</a> file. It is a javascript dictionary that is easy to understand and change, but be careful to correctly set commas and curly braces!</p> 48 48 49 <p>Next to the location of your plugin SWF file, the testing page also needs an XML file that describes your plugin. It is a simple xml format (<a href="plugins/flashvars .xml">example</a>) that contains an overview and the list of flashvars for your plugin. You also need to have this XML later on for <a href="http://www.longtailvideo.com/addons/submitregister.html">submitting your plugin</a> to LongTail Video.</p>49 <p>Next to the location of your plugin SWF file, the testing page also needs an XML file that describes your plugin. It is a simple xml format (<a href="plugins/flashvars/flashvars.xml">example</a>) that contains an overview and the list of flashvars for your plugin. You can also use this XML later on for <a href="http://www.longtailvideo.com/addons/submitregister.html">submitting your plugin</a> to LongTail Video.</p> 50 50 51 51 … … 54 54 <p>The developer Wiki contains a wealth of resources for building plugins, including:</p> 55 55 <ul> 56 <li>The general <a href="http://developer.longtailvideo.com/trac/wiki/BuildingPlugins">plugin building tutorial</a>.</li> 57 <li>A hands-on tutorial that <a href="http://developer.longtailvideo.com/trac/wiki/YousearchTutorial">Rebuilds the Yousearch plugin</a>.</li> 58 <li>A tutorial about <a href="http://developer.longtailvideo.com/trac/wiki/CrossDomain">Flash security restrictions</a>. Read this if you want to load XML or other data across websites.</li> 56 <li>The general <a href="http://developer.longtailvideo.com/trac/wiki/FlashPlugins">player plugin documentation</a>. It's a general overview of how plugins work.</li> 57 <li>A tutorial about <a href="http://developer.longtailvideo.com/trac/wiki/FlashSecurity">Flash security restrictions</a>. Read this if you want to load XML or other data across websites.</li> 58 <li>A reference of the <a href="http://developer.longtailvideo.com/trac/wiki/FlashApi">API calls</a> plugins can use to interact with the player.</li> 59 <li>A reference of all <a href="http://developer.longtailvideo.com/trac/wiki/FlashEvents">events the player fires</a>. The <i>View</i> events are the ones your plugin can trigger.</li> 59 60 </ul> 60 <ul> 61 <li>A reference of the <a href="http://developer.longtailvideo.com/trac/wiki/FlashAPI">API calls</a> plugins can use to interact with the player.</li> 62 <li>A reference of all <a href="http://developer.longtailvideo.com/trac/wiki/FlashEvents">events the player fires</a>. The <i>View</i> events are the ones your plugin can fire too.</li> 63 <li>A reference of the <a href="http://developer.longtailvideo.com/trac/wiki/FlashOverview">architecture of the JW Player</a> (including the plugin loading and positioning/resizing).</li> 64 </ul> 65 <p>You can also directly download the source code of a string of plugins <a href="http://developer.longtailvideo.com/trac/browser/plugins">from the developer site</a>. Feel free to copy/paste code and/or create your own branch of any of these plugins!</p> 61 <p>You can also find <a href="http://developer.longtailvideo.com/trac/#Plugins">info and source code</a> on a string of plugins we built. Feel free to (re)use this code or create your own branch of any of these plugins!</p> 66 62 67 63 68 64 69 65 <h3>Submit your plugin</h3> 70 <p>If you're happy with the way your plugin works, you can <a href="http://www.longtailvideo.com/addons/submitregister.html">submit it to LongTail Video</a>. We'll do a quick sanity check of your plugin and then list it in <a href="http://www.longtailvideo.com/addons/">our addons section</a>. You can also ask for donations o r sell licenses of your plugin through our site to make money. For more info about that, please <a href="http://www.longtailvideo.com/support/contact-us">contact us</a>.</p>66 <p>If you're happy with the way your plugin works, you can <a href="http://www.longtailvideo.com/addons/submitregister.html">submit it to LongTail Video</a>. We'll do a quick sanity check of your plugin and then list it in <a href="http://www.longtailvideo.com/addons/">our addons section</a>. You can also ask for donations of your plugin through our site to make some money. For more info about that, please <a href="http://www.longtailvideo.com/support/contact-us">contact us</a>.</p> 71 67 72 68 </body>
