Changeset 738
- Timestamp:
- 12/10/09 04:35:15 (4 years ago)
- Location:
- plugins
- Files:
-
- 4 added
- 8 edited
-
livestream/com/jeroenwijering/plugins/Livestream.as (modified) (4 diffs)
-
livestream/livestream.swf (modified) (previous)
-
sharing/com/jeroenwijering/plugins/Sharing.as (modified) (3 diffs)
-
sharing/shareScreen.png (modified) (previous)
-
sharing/sharing.swf (modified) (previous)
-
snapshot/com/jeroenwijering/plugins/Snapshot.as (modified) (6 diffs)
-
snapshot/com/longtailvideo (added)
-
snapshot/com/longtailvideo/jwplayer (added)
-
snapshot/com/longtailvideo/jwplayer/utils (added)
-
snapshot/com/longtailvideo/jwplayer/utils/RootReference.as (added)
-
snapshot/snapshot.swf (modified) (previous)
-
snapshot/snapshot.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
plugins/livestream/com/jeroenwijering/plugins/Livestream.as
r436 r738 58 58 private function build():void { 59 59 back = new Sprite(); 60 back.graphics.beginFill(0x000000,0. 8);60 back.graphics.beginFill(0x000000,0.9); 61 61 back.graphics.drawRect(0,0,300,70); 62 62 addChild(back); … … 110 110 public function initializePlugin(vie:AbstractView):void { 111 111 view = vie; 112 view.config['icons'] = false;113 view.config['repeat'] = 'always';114 view.config['autostart'] = true;115 112 view.addControllerListener(ControllerEvent.RESIZE,resizeHandler); 116 113 field.text = config['message']; … … 122 119 /** The livestream is found. Now switch to it. **/ 123 120 private function load():void { 124 view.config['icons'] = true;125 view.config['repeat'] = 'none';126 121 view.sendEvent('LOAD',{ 127 122 duration:0, … … 131 126 type:'rtmp' 132 127 }); 128 setTimeout(view.sendEvent,100,'ITEM',0); 133 129 }; 134 130 -
plugins/sharing/com/jeroenwijering/plugins/Sharing.as
r354 r738 158 158 drawShare(); 159 159 } 160 } else if (view.config['link']) { 161 config['link'] = view.config['link']; 160 } else { 161 try { 162 config['link'] = ExternalInterface.call("function(){return window.location.href;}"); 163 } catch (err:Error) {} 162 164 drawShare(); 163 } else if (ExternalInterface.available) { 164 config['link'] = ExternalInterface.call("function(){return window.location.href;}"); 165 drawShare(); 166 } 167 if(view.config['title']) { 168 config['title'] = encodeURI(view.config['title']); 165 view.addControllerListener(ControllerEvent.ITEM,itemHandler); 166 view.addControllerListener(ControllerEvent.PLAYLIST,itemHandler); 169 167 } 170 168 showHide('none'); … … 175 173 private function linkHandler(evt:MouseEvent):void { 176 174 if(shareScreen.mouseY < 80) { 177 stage.focus = shareField; 178 shareField.setSelection(0,999999); 179 System.setClipboard(config['link']); 175 if(shareScreen.mouseX < 80) { 176 navigateToURL(new URLRequest(config['link']),view.config['linktarget']); 177 } else { 178 stage.focus = shareField; 179 shareField.setSelection(0,999999); 180 System.setClipboard(config['link']); 181 } 180 182 } else { 181 183 var url:String; … … 201 203 202 204 205 /** Save link from new item. **/ 206 private function itemHandler(evt:ControllerEvent):void { 207 config['title'] = encodeURI(view.playlist[view.config['item']]['title']); 208 if (view.playlist[view.config['item']]['link']) { 209 config['link'] = view.playlist[view.config['item']]['link']; 210 shareField.text = config['link']; 211 } 212 }; 213 214 203 215 /** Resize the clip when on screen. **/ 204 216 private function resizeHandler(evt:ControllerEvent):void { -
plugins/snapshot/com/jeroenwijering/plugins/Snapshot.as
r451 r738 5 5 import com.jeroenwijering.events.*; 6 6 import com.jeroenwijering.utils.Logger; 7 import com.longtailvideo.jwplayer.utils.RootReference; 7 8 8 9 import flash.display.*; … … 62 63 back = new Sprite(); 63 64 back.buttonMode = true; 64 back.graphics.beginFill(0x000000,0. 5);65 back.graphics.beginFill(0x000000,0.6); 65 66 back.graphics.drawRect(0,0,400,20); 66 back.graphics.beginFill(0x000000,0. 6);67 back.graphics.beginFill(0x000000,0.7); 67 68 back.graphics.drawRect(0,20,400,20); 68 69 addChild(back); … … 114 115 } 115 116 back.buttonMode = true; 116 view.skin.display.bufferIcon.visible = false;117 view.skin.display.playIcon.visible = true;118 117 }; 119 118 … … 145 144 field.htmlText = 'Sending snapshot, please wait...'; 146 145 back.buttonMode = false; 147 try {148 view.skin.display.bufferIcon.visible = true;149 view.skin.display.playIcon.visible = false;150 view.skin.display.bufferIcon.txt.text = '';151 } catch (err:Error) {}152 146 var req:URLRequest = new URLRequest(view.config['snapshot.script']); 153 147 req.method = URLRequestMethod.POST; 154 148 if(config['bitmap']) { 155 149 try { 156 bitmap.draw(vi ew.getPlugin('display').clip.media);150 bitmap.draw(videoObject()); 157 151 req.requestHeaders.push(new URLRequestHeader("Content-type","application/octet-stream")); 158 152 req.data = encoder.encode(bitmap); … … 160 154 Logger.log('Sending snapshot to '+view.config['snapshot.script'],'snapshot'); 161 155 } catch(err:SecurityError) { 162 field.htmlText = "Security error: no crossdomain.xml or 302 redirect on video."; 156 field.htmlText = err.message; 157 //field.htmlText = "Security error: no crossdomain.xml or 302 redirect on video."; 163 158 } 164 159 } else { … … 193 188 194 189 190 /** Grab the video object - nasty hack that depends on player version. **/ 191 private function videoObject():DisplayObject { 192 var ply:String = view.config['version'].substr(0,3); 193 switch (ply) { 194 case '4.6': 195 case '4.7': 196 return view.skin.display.media.getChildAt(0) as DisplayObject; 197 case '4.5': 198 return view.skin.display.media as DisplayObject; 199 case '4.4': 200 case '4.3': 201 case '4.2': 202 case '4.1': 203 view.skin.display.media.mask = null; 204 return view.skin.display.media as DisplayObject; 205 default: 206 var skn:Sprite = RootReference.stage.getChildAt(0) as Sprite; 207 return Sprite(skn.getChildAt(1)).getChildAt(0) as DisplayObject; 208 } 209 }; 210 211 195 212 }; 196 213 -
plugins/snapshot/snapshot.xml
r330 r738 10 10 Note that the server hosting your FLV files needs to have a crossdomain XML for this. 11 11 Here is a very basic example of such a (PHP) script. 12 13 <?php14 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 ?>]]>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 if (exif_imagetype($rn.'.jpg') == IMAGETYPE_JPEG) { 21 echo 'http://www.myserver.com/snapshots/'.$rn.'.jpg'; 22 exit(); 23 } 24 } 25 echo "error"; 26 ?>]]> 27 27 </description> 28 28 <href>http://developer.longtailvideo.com/trac/browser/plugins/snapshot</href>
Note: See TracChangeset
for help on using the changeset viewer.
