{"id":0,"registry":{"0":{"submorphs":[{"__isSmartRef__":true,"id":1}],"scripts":[],"id":"377815D8-C441-4C29-9B10-42E726D01C5D","shape":{"__isSmartRef__":true,"id":86},"droppingEnabled":true,"halosEnabled":true,"registeredForMouseEvents":true,"showsHalos":false,"name":"ScreenCastRecorder","partsBinMetaInfo":{"__isSmartRef__":true,"id":87},"eventHandler":{"__isSmartRef__":true,"id":111},"derivationIds":[127,"F0291F62-F100-480C-AEBF-0230398F7983","AE8B5ED7-E305-45BC-BE4A-1C28A49EE12B","39BA345C-17FA-45A0-BAC2-F0CF5654ACF8","FE91EA31-D8AE-461B-8A49-95DA5FBAE5B4","F38439A3-2F4E-4AC2-BF73-2633C00B1393","6748F5B5-2284-4748-A6EE-F1A261CBAD0B","BBAFB862-93AE-4F89-BCFF-9F1C67B7FE4C","7EC17E78-593A-4CC8-B7E3-859BCBBFE785","BD8BECDB-A9A1-4009-B433-C925F0AFCCFC","F2677A9D-5855-4DF2-B248-94545B34B762","D52188B3-7DC0-410E-96B1-50892AC00A37","1C29A615-2A45-43E4-A884-293C8BD4048B","57B512A6-5396-49B8-A98F-1448C01ADB9F","AB55B679-DF7D-464B-B6DC-D9CEEED436B3","8EEAEAB1-9AB2-4315-90A7-03581562EF24"],"partTests":{"__isSmartRef__":true,"id":112},"_ClipMode":"visible","moved":true,"isBeingDragged":false,"_Rotation":0,"_Scale":1,"__serializedExpressions__":["_Position","distanceToDragEvent"],"__LivelyClassName__":"lively.morphic.Box","__SourceModuleName__":"Global.lively.morphic.Core","_Position":"lively.pt(0.0,0.0)","distanceToDragEvent":"lively.pt(240.6,-13.9)"},"1":{"submorphs":[{"__isSmartRef__":true,"id":2}],"scripts":[],"shape":{"__isSmartRef__":true,"id":7},"eventHandler":{"__isSmartRef__":true,"id":8},"_ClipMode":"visible","derivationIds":["EC7EBB28-54AE-4244-80ED-3E13650F82B7","9FD2DCE2-B997-4536-B2A5-90D7DD92B3E6","0D8CC908-BD1C-4062-BB03-3FCEB910483D","D44EEAF2-909E-4889-B422-E9DA93DCB8F4","41E44EEE-7D11-4CD1-A529-8312EBD272D4","63160BCA-5917-4A70-BD4E-D32ECED39917","F08EB6DA-189F-4C0A-8FD9-804CC3BE6F77","9CFC97EA-9651-42C5-B782-4CE95433455D","F2EA4707-1B99-47A6-A608-9A3B81E715E0"],"id":"359EB317-F352-43D0-8B6F-BCB1E9B0CDD0","grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"value":false,"toggle":false,"isActive":true,"label":{"__isSmartRef__":true,"id":2},"_PreviousBorderWidth":1,"isPressed":false,"showsHalos":false,"attributeConnections":[{"__isSmartRef__":true,"id":9}],"doNotSerialize":["$$fire"],"doNotCopyProperties":["$$fire"],"name":"SelfieVideoButton1","partsBinMetaInfo":{"__isSmartRef__":true,"id":11},"pinSpecs":[{"__isSmartRef__":true,"id":23}],"_StyleClassNames":["Morph","Button"],"recorder":{"__isSmartRef__":true,"id":24},"webcam":{"__isSmartRef__":true,"id":25},"screen":{"__isSmartRef__":true,"id":26},"owner":{"__isSmartRef__":true,"id":0},"audioStream":{"__isSmartRef__":true,"id":27},"audioRecorder":{"__isSmartRef__":true,"id":28},"videoRecorder":{"__isSmartRef__":true,"id":32},"_Rotation":0,"_Scale":1,"__serializedExpressions__":["_Position","distanceToDragEvent"],"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":36},"__LivelyClassName__":"lively.morphic.Button","__SourceModuleName__":"Global.lively.morphic.Widgets","_Position":"lively.pt(10.0,6.0)","distanceToDragEvent":"lively.pt(73.0,-16.0)"},"2":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":3},"_WhiteSpaceHandling":"pre-wrap","textChunks":[{"__isSmartRef__":true,"id":4}],"eventHandler":{"__isSmartRef__":true,"id":6},"_ClipMode":"hidden","derivationIds":["7884E73F-0D17-44B3-907F-44A5223F1F3D","444B63A6-D9E7-4AB2-AB57-4A9146C18BFF","08999E10-CCC3-4CAB-99BC-4EF500309EC4","D512F227-5573-4562-88F6-F4BCE92CEF01","7EDCDD96-9C7F-460A-ADE5-10AB0A39549A","1E2CE665-CF22-437E-9C3E-0CF9CFBDB62D","EAF05123-9AA5-4E20-A937-676F64946BB9","66789053-CFE4-4F76-BD28-D6E7E17A7706","782EA25E-B032-4C0D-8681-63ABC9E1F611"],"id":"A61BF101-F437-4731-88C7-58D53C0B7A90","grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"_WordBreak":"break-all","fixedHeight":true,"_InputAllowed":false,"_HandStyle":"default","allowInput":false,"_FontFamily":"Helvetica","_FontSize":10,"evalEnabled":false,"owner":{"__isSmartRef__":true,"id":1},"isLabel":true,"_Align":"center","eventsAreIgnored":true,"_TextStylingMode":true,"showsHalos":false,"eventsAreDisabled":true,"_PointerEvents":"none","__serializedExpressions__":["_TextColor"],"__LivelyClassName__":"lively.morphic.Text","__SourceModuleName__":"Global.lively.morphic.TextCore","_TextColor":"Color.rgb(0,0,0)"},"3":{"_BorderWidth":0,"_Fill":null,"__serializedExpressions__":["_Position","_Extent","_Padding","_BorderColor"],"__LivelyClassName__":"lively.morphic.Shapes.Rectangle","__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":"lively.pt(0.0,0.0)","_Extent":"lively.pt(100.0,20.0)","_Padding":"lively.rect(0,3,0,0)","_BorderColor":"Color.rgb(0,0,0)"},"4":{"style":{"__isSmartRef__":true,"id":5},"chunkOwner":{"__isSmartRef__":true,"id":2},"_id":"_7427","storedString":"Record Screen","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"5":{"__serializedExpressions__":["color"],"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore","color":"Color.rgb(0,0,0)"},"6":{"morph":{"__isSmartRef__":true,"id":2},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"7":{"_BorderWidth":1,"_BorderRadius":5,"_AppearanceStylingMode":false,"_BorderStylingMode":true,"_Fill":null,"__serializedExpressions__":["_Position","_Extent","_Padding","_BorderColor"],"__LivelyClassName__":"lively.morphic.Shapes.Rectangle","__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":"lively.pt(0.0,0.0)","_Extent":"lively.pt(100.0,20.0)","_Padding":"lively.rect(0,0,0,0)","_BorderColor":"Color.rgb(189,190,192)"},"8":{"morph":{"__isSmartRef__":true,"id":1},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"9":{"sourceObj":{"__isSmartRef__":true,"id":1},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":1},"targetMethodName":"doAction","varMapping":{"__isSmartRef__":true,"id":10},"__LivelyClassName__":"AttributeConnection","__SourceModuleName__":"Global.lively.bindings.Core"},"10":{"source":{"__isSmartRef__":true,"id":1},"target":{"__isSmartRef__":true,"id":1}},"11":{"partName":"SelfieVideoButton","requiredModules":[],"partsSpaceName":"PartsBin/Demo/","comment":"A simple button that calls a method #doAction when pressed.","changes":[{"__isSmartRef__":true,"id":12},{"__isSmartRef__":true,"id":13},{"__isSmartRef__":true,"id":14},{"__isSmartRef__":true,"id":15},{"__isSmartRef__":true,"id":16},{"__isSmartRef__":true,"id":17},{"__isSmartRef__":true,"id":18},{"__isSmartRef__":true,"id":19},{"__isSmartRef__":true,"id":20},{"__isSmartRef__":true,"id":21},{"__isSmartRef__":true,"id":22}],"migrationLevel":9,"__serializedExpressions__":["lastModifiedDate"],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo","__SourceModuleName__":"Global.lively.PartsBin","lastModifiedDate":"new Date(\"Tue Jan 06 2015 17:26:10 GMT+0100 (Central Europe Standard Time)\")"},"12":{"author":null,"message":"no comment","id":"F8B70225-5143-4A51-ABB4-344B488B3811","__serializedExpressions__":["date"],"date":"new Date(\"Tue Dec 11 2012 22:15:42 GMT+0100 (Central Europe Standard Time)\")"},"13":{"author":"robertkrahn","message":"no comment","id":"9B8B6BE4-4519-4A6C-8F47-70DE61BBB0FB","__serializedExpressions__":["date"],"date":"new Date(\"Tue Dec 11 2012 22:53:16 GMT+0100 (Central Europe Standard Time)\")"},"14":{"author":"robertkrahn","message":"test","id":"ACA617B4-0416-4E3C-9F4D-171A40F44F0F","__serializedExpressions__":["date"],"date":"new Date(\"Wed May 01 2013 05:34:25 GMT+0200 (Central Europe Daylight Time)\")"},"15":{"author":"robertkrahn","message":"no comment","id":"811BDE87-D8DD-48BB-97B2-7A3C3F3FAE32","__serializedExpressions__":["date"],"date":"new Date(\"Wed May 01 2013 05:35:59 GMT+0200 (Central Europe Daylight Time)\")"},"16":{"author":"robertkrahn","message":"no comment","id":"BB2EA501-D9AF-414B-A035-E1487DA6F0FD","__serializedExpressions__":["date"],"date":"new Date(\"Wed May 01 2013 05:36:30 GMT+0200 (Central Europe Daylight Time)\")"},"17":{"author":"Dan","message":"no comment","id":"A594459F-DA9B-49DD-A105-547B3F613CC5","__serializedExpressions__":["date"],"date":"new Date(\"Mon Jun 17 2013 19:22:38 GMT+0200 (Central Europe Daylight Time)\")"},"18":{"author":"Dan","message":"no comment","id":"CFEC4071-14FF-4AEB-A399-197884CD18BF","__serializedExpressions__":["date"],"date":"new Date(\"Mon Jun 17 2013 19:24:50 GMT+0200 (Central Europe Daylight Time)\")"},"19":{"author":"Jens_Lincke","message":"no comment","id":"3E88407B-5E56-4A3F-A397-36784ED83A20","__serializedExpressions__":["date"],"date":"new Date(\"Tue Jan 06 2015 14:57:47 GMT+0100 (Central Europe Standard Time)\")"},"20":{"author":"timfelgentreff","message":"no comment","id":"65AFAC67-6AA1-4824-A6A8-2272BD6458B0","__serializedExpressions__":["date"],"date":"new Date(\"Tue Jan 06 2015 17:26:10 GMT+0100 (Central Europe Standard Time)\")"},"21":{"author":"timfelgentreff","message":"no comment","id":"C1013DF5-95FB-4E4E-A160-EFC2579EDB5D","__serializedExpressions__":["date"],"date":"new Date(\"Tue Jan 06 2015 17:28:01 GMT+0100 (Central Europe Standard Time)\")"},"22":{"author":"timfelgentreff","message":"no comment","id":"6AAFAEEC-EE0D-4354-9E4C-84C97E14ECE2","__serializedExpressions__":["date"],"date":"new Date(\"Tue Jan 06 2015 18:03:48 GMT+0100 (Central Europe Standard Time)\")"},"23":{"pinName":"fire","modality":"output","type":"Boolean","accessor":"fire","location":1.5},"24":{"blob":null,"bufferSize":0,"sampleRate":0,"buffer":null,"view":null},"25":{"onremovetrack":null,"onaddtrack":null,"onended":null,"ended":true,"id":"dQmiSZ0t1LyXcQvJ3QbuK23rl83LjBqPkZss","label":"dQmiSZ0t1LyXcQvJ3QbuK23rl83LjBqPkZss"},"26":{"onremovetrack":null,"onaddtrack":null,"onended":null,"ended":true,"id":"bb61yiJWG6B2uRTnGOhvMUrYrjNppujN5ajf","label":"bb61yiJWG6B2uRTnGOhvMUrYrjNppujN5ajf"},"27":{"onremovetrack":null,"onaddtrack":null,"onended":null,"ended":true,"id":"WRbuvXPHWpgdYqbstx3lhInI8zcDg6WVSX3n","label":"WRbuvXPHWpgdYqbstx3lhInI8zcDg6WVSX3n"},"28":{"blob":{"__isSmartRef__":true,"id":29},"bufferSize":16384,"sampleRate":44100,"buffer":{"__isSmartRef__":true,"id":30},"view":{"__isSmartRef__":true,"id":31},"type":"audio","length":327680},"29":{"type":"audio/wav","size":1310764},"30":{},"31":{},"32":{"blob":{"__isSmartRef__":true,"id":33},"bufferSize":0,"sampleRate":0,"buffer":null,"view":null,"type":"video","video":{"__isSmartRef__":true,"id":34},"canvas":{"__isSmartRef__":true,"id":35},"width":320,"height":240},"33":{"type":"video/webm","size":2134990},"34":{"width":1280,"height":720},"35":{"width":1280,"height":720},"36":{"onrestore":{"__isSmartRef__":true,"id":37},"doAction":{"__isSmartRef__":true,"id":44},"stopAndSave":{"__isSmartRef__":true,"id":47},"displayWebcam":{"__isSmartRef__":true,"id":50},"XXXopenWebcam":{"__isSmartRef__":true,"id":53},"XXXrecordFrom":{"__isSmartRef__":true,"id":56},"XXXselectSource":{"__isSmartRef__":true,"id":59},"recordScreencastAudio":{"__isSmartRef__":true,"id":62},"recordScreencastVideo":{"__isSmartRef__":true,"id":65},"start":{"__isSmartRef__":true,"id":68},"prepareScreencast":{"__isSmartRef__":true,"id":71},"upload":{"__isSmartRef__":true,"id":74},"videoWindow":{"__isSmartRef__":true,"id":77},"myVideo":{"__isSmartRef__":true,"id":80},"onLoad":{"__isSmartRef__":true,"id":83}},"37":{"varMapping":{"__isSmartRef__":true,"id":38},"source":"function onrestore() {\n    Global.JSLoader.loadJs(\"//cdn.WebRTC-Experiment.com/RecordRTC.js\")\n    Global.JSLoader.loadJs(\"//cdn.WebRTC-Experiment.com/getScreenId.js\")\n    delete this._videoWindow\n    delete this._myVideo\n}","funcProperties":{"__isSmartRef__":true,"id":43},"__LivelyClassName__":"lively.Closure"},"38":{"this":{"__isSmartRef__":true,"id":1},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":39}},"39":{"$super":{"__isSmartRef__":true,"id":40}},"40":{"varMapping":{"__isSmartRef__":true,"id":41},"source":"function () {\n                try {\n                    // FIXME super is supposed to be static\n                    return Object.getPrototypeOf(obj)[name].apply(obj, arguments);\n                } catch (e) {\n                    if ($world)\n                        $world.logError(e, 'Error in $super call')\n                    else\n                        alert('Error in $super call: ' + e + '\\n' + e.stack);\n                    return null;\n                }\n            }","funcProperties":{"__isSmartRef__":true,"id":42},"__LivelyClassName__":"lively.Closure"},"41":{"obj":{"__isSmartRef__":true,"id":1},"name":"onrestore"},"42":{},"43":{"user":"timfelgentreff","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Jan 08 2015 17:12:11 GMT+0100 (Central Europe Standard Time)\")"},"44":{"varMapping":{"__isSmartRef__":true,"id":45},"source":"function doAction() {\n    if (this.state == \"recording\") {\n        this.stopAndSave()\n        delete this.state\n        this.setFill(null)\n    } else {\n        this.displayWebcam();\n        this.prepareScreencast();\n    }\n}","funcProperties":{"__isSmartRef__":true,"id":46},"__LivelyClassName__":"lively.Closure"},"45":{"this":{"__isSmartRef__":true,"id":1}},"46":{"user":"timfelgentreff","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Jan 07 2015 17:46:01 GMT+0100 (Central Europe Standard Time)\")"},"47":{"varMapping":{"__isSmartRef__":true,"id":48},"source":"function stopAndSave() {\n    this.audioRecorder.stopRecording(function () {\n        this.audioStream.stop()\n        this.upload(this.audioRecorder.blob);\n        // this.audioRecorder.save(\"audio\")\n    }.bind(this));\n    this.videoRecorder.stopRecording(function () {\n        this.webcam.stop()\n        this.screen.stop()\n        this.videoWindow().remove()\n        //this.videoRecorder.save(\"video\")\n        this.upload(this.videoRecorder.blob);\n        }.bind(this));\n}","funcProperties":{"__isSmartRef__":true,"id":49},"__LivelyClassName__":"lively.Closure"},"48":{"this":{"__isSmartRef__":true,"id":1}},"49":{"user":"timfelgentreff","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Jan 08 2015 17:12:11 GMT+0100 (Central Europe Standard Time)\")"},"50":{"varMapping":{"__isSmartRef__":true,"id":51},"source":"function displayWebcam() {\n    this.videoWindow().openInWorld()\n    this.myVideo().onrestore()\n    \n    var self = this;\n    var constraints = {\n        video: {\n            mandatory: {\n                maxWidth: 640,\n                maxHeight: 480\n            },\n            optional: [\n                { frameRate: 10 },\n                { facingMode: \"user\" }\n            ]\n        }\n    };\n    var video = this.myVideo()\n    navigator.getUserMedia(constraints, function(stream) {\n        self.webcam = stream;\n        var url = window.URL.createObjectURL(stream)\n        video.setVideoURL(url);\n        video.play();\n    }, function(error) {\n        alert( JSON.stringify(error) );\n    });\n}","funcProperties":{"__isSmartRef__":true,"id":52},"__LivelyClassName__":"lively.Closure"},"51":{"this":{"__isSmartRef__":true,"id":1}},"52":{"user":"timfelgentreff","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Jan 08 2015 17:33:06 GMT+0100 (Central Europe Standard Time)\")"},"53":{"varMapping":{"__isSmartRef__":true,"id":54},"source":"function XXXopenWebcam() {\n    MediaStreamTrack.getSources(this.selectSource.bind(this));\n}","funcProperties":{"__isSmartRef__":true,"id":55},"__LivelyClassName__":"lively.Closure"},"54":{"this":{"__isSmartRef__":true,"id":1}},"55":{"user":"undefined","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Jan 07 2015 14:19:35 GMT+0100 (Central Europe Standard Time)\")"},"56":{"varMapping":{"__isSmartRef__":true,"id":57},"source":"function XXXrecordFrom(videoSource, audioSource) {\n    var self = this;\n    var constraints = {\n        // audio: {\n        //     optional: [{sourceId: audioSource}]\n        // },\n        // video: {\n        //     optional: [{sourceId: videoSource}]\n        // }\n        video: true\n    };\n    var video = this.myVideo()\n    navigator.getUserMedia(constraints, function(stream) {\n        self.webcam = stream;\n        var url = window.URL.createObjectURL(stream)\n        video.setVideoURL(url);\n        video.play();\n        \n        // recorder.addStream(stream);\n        // recorder.mediaType = {\n        //     audio: false,\n        //     video: true,\n        //     gif: true\n        // };\n        // recorder.startRecording();\n    }, function(error) {\n        alert( JSON.stringify(error) );\n    });\n}","funcProperties":{"__isSmartRef__":true,"id":58},"__LivelyClassName__":"lively.Closure"},"57":{"this":{"__isSmartRef__":true,"id":1}},"58":{"user":"timfelgentreff","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Jan 08 2015 17:12:11 GMT+0100 (Central Europe Standard Time)\")"},"59":{"varMapping":{"__isSmartRef__":true,"id":60},"source":"function XXXselectSource(sourceInfos) {\n    var audioSource = null;\n    var videoSource = null;\n    \n    for (var i = 0; i != sourceInfos.length; ++i) {\n        var sourceInfo = sourceInfos[i];\n        if (sourceInfo.kind === 'audio') {\n            audioSource = sourceInfo.id;\n        } else if (sourceInfo.kind === 'video') {\n            videoSource = sourceInfo.id;\n        } else {\n          console.log('Some other kind of source: ', sourceInfo);\n        }\n    }\n    this.recordFrom(videoSource, audioSource);\n}","funcProperties":{"__isSmartRef__":true,"id":61},"__LivelyClassName__":"lively.Closure"},"60":{"this":{"__isSmartRef__":true,"id":1}},"61":{"user":"undefined","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Jan 07 2015 14:19:56 GMT+0100 (Central Europe Standard Time)\")"},"62":{"varMapping":{"__isSmartRef__":true,"id":63},"source":"function recordScreencastAudio() {\n    navigator.getUserMedia({audio: true}, function(stream) {\n        this.audioStream = stream\n        this.audioRecorder = new RecordRTC(stream, {\n            type: 'audio',\n            \"sample-rate\": 44100,\n            \"buffer-size\": 8192 * 2\n        })\n    }.bind(this), function(error) {\n        alert( JSON.stringify(error) );\n    });\n}","funcProperties":{"__isSmartRef__":true,"id":64},"__LivelyClassName__":"lively.Closure"},"63":{"this":{"__isSmartRef__":true,"id":1}},"64":{"user":"timfelgentreff","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Jan 07 2015 17:30:16 GMT+0100 (Central Europe Standard Time)\")"},"65":{"varMapping":{"__isSmartRef__":true,"id":66},"source":"function recordScreencastVideo() {\n    var self = this;\n    getScreenId(function (error, sourceId, screen_constraints) {\n        // error    == null || 'permission-denied' || 'not-installed' || 'installed-disabled' || 'not-chrome'\n        // sourceId == null || 'string' || 'firefox'\n        screen_constraints = {\n            video: {\n                mandatory: {\n                    chromeMediaSource: 'screen',\n                    // height: 1024,\n                    // width: 768,\n                    maxWidth: 1280,\n                    maxHeight: 720,\n                    minWidth: 1280,\n                    minHeight: 720,\n                    // minAspectRatio: 1024/768\n                    // width: { min: 800, max: 1200 }, height: { min: 600 }\n                },\n            },\n        };\n        if(sourceId && sourceId != 'firefox') {\n            if (error === 'permission-denied') return alert('Permission is denied.');\n            if (error === 'not-chrome') return alert('Please use chrome.');\n    \n            if (!error && sourceId) {\n                screen_constraints.video.mandatory.chromeMediaSource = 'desktop';\n                screen_constraints.video.mandatory.chromeMediaSourceId = sourceId;\n            }\n        }\n        navigator.getUserMedia = navigator.mozGetUserMedia || navigator.webkitGetUserMedia;\n        navigator.getUserMedia(screen_constraints, function (stream) {debugger\n            self.screen = stream;\n            self.videoRecorder = new RecordRTC(stream, {\n               type: 'video',\n              video: {\n                  width: 1280,\n                  height: 720\n              },\n              canvas: {\n                  width: 1280,\n                  height: 720\n              }\n            })\n            \n            // XXX Wrong place\n            self.state = \"recording\"\n            self.setFill(Color.red)\n            self.start()\n        }, function (error) {\n            alert(error);\n        });\n    });\n}","funcProperties":{"__isSmartRef__":true,"id":67},"__LivelyClassName__":"lively.Closure"},"66":{"this":{"__isSmartRef__":true,"id":1}},"67":{"user":"timfelgentreff","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Jan 07 2015 16:33:31 GMT+0100 (Central Europe Standard Time)\")"},"68":{"varMapping":{"__isSmartRef__":true,"id":69},"source":"function start() {\n    this.audioRecorder.startRecording();\n    this.videoRecorder.startRecording();\n}","funcProperties":{"__isSmartRef__":true,"id":70},"__LivelyClassName__":"lively.Closure"},"69":{"this":{"__isSmartRef__":true,"id":1}},"70":{"user":"undefined","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Jan 07 2015 16:06:39 GMT+0100 (Central Europe Standard Time)\")"},"71":{"varMapping":{"__isSmartRef__":true,"id":72},"source":"function prepareScreencast() {\n    this.recordScreencastAudio();\n    this.recordScreencastVideo();\n}","funcProperties":{"__isSmartRef__":true,"id":73},"__LivelyClassName__":"lively.Closure"},"72":{"this":{"__isSmartRef__":true,"id":1}},"73":{"user":"undefined","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Wed Jan 07 2015 16:09:04 GMT+0100 (Central Europe Standard Time)\")"},"74":{"varMapping":{"__isSmartRef__":true,"id":75},"source":"function upload(blob) {\n    $.ajax(URL.source.toString().replace(/.html$/, \".\" + blob.type.split(\"/\")[1]), {\n        data: blob,\n        processData: false,\n        type: 'PUT',\n        contentType: blob.type,\n        complete: function(req, status) {\n            alert(\"finished \" + status + \" \" + blob.type)\n        }\n    })\n}","funcProperties":{"__isSmartRef__":true,"id":76},"__LivelyClassName__":"lively.Closure"},"75":{"this":{"__isSmartRef__":true,"id":1}},"76":{"user":"timfelgentreff","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Jan 08 2015 16:54:12 GMT+0100 (Central Europe Standard Time)\")"},"77":{"varMapping":{"__isSmartRef__":true,"id":78},"source":"function videoWindow() {\n    if (this._videoWindow) return this._videoWindow;\n\n    this._videoWindow = $world.loadPartItem(\"VideoMorph\", \"PartsBin/HTML\")\n    if (!this._videoWindow) {\n        this._videoWindow = $world.loadPartItem(\"VideoMorph\", \"https://lively-kernel.org/web/PartsBin/HTML\")\n    }\n    return this._videoWindow\n}","funcProperties":{"__isSmartRef__":true,"id":79},"__LivelyClassName__":"lively.Closure"},"78":{"this":{"__isSmartRef__":true,"id":1}},"79":{"user":"timfelgentreff","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Jan 08 2015 17:12:11 GMT+0100 (Central Europe Standard Time)\")"},"80":{"varMapping":{"__isSmartRef__":true,"id":81},"source":"function myVideo() {\n    if (this._myVideo) return this._myVideo;\n    this._myVideo = this.videoWindow().targetMorph\n}","funcProperties":{"__isSmartRef__":true,"id":82},"__LivelyClassName__":"lively.Closure"},"81":{"this":{"__isSmartRef__":true,"id":1}},"82":{"user":"timfelgentreff","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Jan 08 2015 17:12:11 GMT+0100 (Central Europe Standard Time)\")"},"83":{"varMapping":{"__isSmartRef__":true,"id":84},"source":"function onLoad() {\n    this.onrestore()\n}","funcProperties":{"__isSmartRef__":true,"id":85},"__LivelyClassName__":"lively.Closure"},"84":{"this":{"__isSmartRef__":true,"id":1}},"85":{"user":"timfelgentreff","tags":[],"__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Thu Jan 08 2015 17:18:05 GMT+0100 (Central Europe Standard Time)\")"},"86":{"_BorderWidth":1,"_ClipMode":"visible","_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","__serializedExpressions__":["position","_Extent","_BorderColor","_Fill","_Padding"],"__LivelyClassName__":"lively.morphic.Shapes.Rectangle","__SourceModuleName__":"Global.lively.morphic.Shapes","position":"lively.pt(0.0,0.0)","_Extent":"lively.pt(348.0,32.0)","_BorderColor":"Color.rgb(0,0,0)","_Fill":"Color.rgb(255,255,255)","_Padding":"lively.rect(0,0,0,0)"},"87":{"partsSpaceName":"Demo/","comment":"A screencast recorder using WebRT and google chrome   https://chrome.google.com/webstore/detail/screen-capturing ","migrationLevel":9,"partName":"ScreenCastRecorder","changes":[{"__isSmartRef__":true,"id":88},{"__isSmartRef__":true,"id":89},{"__isSmartRef__":true,"id":90},{"__isSmartRef__":true,"id":91},{"__isSmartRef__":true,"id":92},{"__isSmartRef__":true,"id":93},{"__isSmartRef__":true,"id":94},{"__isSmartRef__":true,"id":95},{"__isSmartRef__":true,"id":96},{"__isSmartRef__":true,"id":97},{"__isSmartRef__":true,"id":98},{"__isSmartRef__":true,"id":99},{"__isSmartRef__":true,"id":100},{"__isSmartRef__":true,"id":101},{"__isSmartRef__":true,"id":102},{"__isSmartRef__":true,"id":103},{"__isSmartRef__":true,"id":104},{"__isSmartRef__":true,"id":105},{"__isSmartRef__":true,"id":106},{"__isSmartRef__":true,"id":107},{"__isSmartRef__":true,"id":108},{"__isSmartRef__":true,"id":109},{"__isSmartRef__":true,"id":110}],"__serializedExpressions__":["lastModifiedDate"],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo","__SourceModuleName__":"Global.lively.PartsBin","lastModifiedDate":"new Date(\"Fri Jan 09 2015 17:10:01 GMT+0100 (Central Europe Standard Time)\")"},"88":{"author":"timfelgentreff","message":"no comment","id":"B765AA6D-CCFF-449A-9C6A-C375BDAE2840","__serializedExpressions__":["date"],"date":"new Date(\"Wed Jan 07 2015 17:11:16 GMT+0100 (Central Europe Standard Time)\")"},"89":{"author":"robertkrahn","message":"no comment","id":"A452871F-4EB9-45D1-94B8-6065CBA7B8FD","__serializedExpressions__":["date"],"date":"new Date(\"Tue Jul 30 2013 08:20:51 GMT+0200 (Central Europe Daylight Time)\")"},"90":{"author":"SAPLivelyScreen","message":"no comment","id":"7A44D8CA-6D5F-42A3-A4B4-4D7F51EECA52","__serializedExpressions__":["date"],"date":"new Date(\"Tue Jun 18 2013 20:49:27 GMT+0200 (Central Europe Daylight Time)\")"},"91":{"author":"SAPLivelyScreen","message":"no comment","id":"EF145198-0649-41BD-A92E-521D98FEC49D","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 30 2013 00:36:50 GMT+0200 (Central Europe Daylight Time)\")"},"92":{"author":"jenslincke","message":"added legend","id":"7ADA3049-56C1-4D32-874B-F664A79DDB20","__serializedExpressions__":["date"],"date":"new Date(\"Fri Jan 18 2013 16:47:05 GMT+0100 (Central Europe Standard Time)\")"},"93":{"author":"jenslincke","message":"no comment","id":"A4B86A7E-A398-4C29-BEE0-4AA045ABABD2","__serializedExpressions__":["date"],"date":"new Date(\"Fri Jan 18 2013 16:42:31 GMT+0100 (Central Europe Standard Time)\")"},"94":{"author":"jenslincke","message":"I want my blue rectangle back!","id":"5AA9291A-869F-4D36-8095-4721B5A5B205","__serializedExpressions__":["date"],"date":"new Date(\"Thu Nov 22 2012 10:35:51 GMT+0100 (Central Europe Standard Time)\")"},"95":{"author":"bgnauk","message":"no comment","id":"0124E570-50B7-4CE3-83A1-6E7BA89B5CD8","__serializedExpressions__":["date"],"date":"new Date(\"Mon Jun 18 2012 19:35:08 GMT+0200 (Central Europe Daylight Time)\")"},"96":{"author":"undefined","message":"suddenly, the rectangle became a CarDemo","id":"B5083AA8-9BAE-48DD-A6B4-FD7DB3998350","__serializedExpressions__":["date"],"date":"new Date(\"Mon Apr 09 2012 13:42:07 GMT+0200 (Central Europe Daylight Time)\")"},"97":{"author":"undefined","message":"css transitions","id":"1004E0FC-D96B-4F40-B3E0-F514A3FCFFD7","__serializedExpressions__":["date"],"date":"new Date(\"Wed Mar 14 2012 10:42:26 GMT+0100 (Central Europe Standard Time)\")"},"98":{"author":"fbo","message":"","id":"BD1C654D-9100-4B66-BC62-B15FF2498B2B","__serializedExpressions__":["date"],"date":"new Date(\"Sat Feb 25 2012 02:59:09 GMT+0100 (Central Europe Standard Time)\")"},"99":{"author":"undefined","message":"sorry","id":"44B56D2E-9B59-4C67-A305-49A6E10E66C2","__serializedExpressions__":["date"],"date":"new Date(\"Wed Mar 14 2012 10:53:45 GMT+0100 (Central Europe Standard Time)\")"},"100":{"author":"undefined","message":"whoopsie","id":"CEA5DCD5-2DB7-40AD-A776-262A7A0666FC","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 03 2012 15:51:30 GMT+0200 (Central Europe Daylight Time)\")"},"101":{"author":"undefined","message":"whoopsie","id":"3F17A2D2-3C24-424B-B0FA-E43112267D23","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 03 2012 15:51:36 GMT+0200 (Central Europe Daylight Time)\")"},"102":{"author":"jenslincke","message":"no comment","id":"AEB2F41B-2C88-4BBA-8875-93CD17CBA1C8","__serializedExpressions__":["date"],"date":"new Date(\"Wed Jan 23 2013 12:57:18 GMT+0100 (Central Europe Standard Time)\")"},"103":{"author":"robertkrahn","message":"no comment","id":"67FD74CD-7AE4-4050-ADC7-4DF73804258D","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 30 2013 09:18:06 GMT+0200 (Central Europe Daylight Time)\")"},"104":{"author":"robertkrahn","message":"no comment","id":"FBBB9C99-B61C-4D5F-8750-6E2987DF0C9C","__serializedExpressions__":["date"],"date":"new Date(\"Fri Jun 21 2013 00:16:24 GMT+0200 (Central Europe Daylight Time)\")"},"105":{"author":"timfelgentreff","message":"no comment","id":"097BEA6B-BC82-455D-8553-55A35420F445","__serializedExpressions__":["date"],"date":"new Date(\"Wed Jan 07 2015 17:31:03 GMT+0100 (Central Europe Standard Time)\")"},"106":{"author":"timfelgentreff","message":"no comment","id":"C708FE06-31EB-4623-801E-6D6875E5216B","__serializedExpressions__":["date"],"date":"new Date(\"Thu Jan 08 2015 16:54:39 GMT+0100 (Central Europe Standard Time)\")"},"107":{"author":"timfelgentreff","message":"no comment","id":"92A7A3A3-2C7B-4391-B153-8AF9F37D310B","__serializedExpressions__":["date"],"date":"new Date(\"Thu Jan 08 2015 17:12:44 GMT+0100 (Central Europe Standard Time)\")"},"108":{"author":"timfelgentreff","message":"no comment","id":"B919BCCE-9D04-44C4-981A-1FAC7BD62747","__serializedExpressions__":["date"],"date":"new Date(\"Thu Jan 08 2015 17:20:54 GMT+0100 (Central Europe Standard Time)\")"},"109":{"author":"jenslincke","message":"no comment","id":"696E52D8-4859-4C4B-AA38-E06C6F6A76BB","__serializedExpressions__":["date"],"date":"new Date(\"Fri Jan 09 2015 17:11:43 GMT+0100 (Central Europe Standard Time)\")"},"110":{"__serializedExpressions__":["date"],"author":"jenslincke","message":"no comment","id":"F77ECCA6-AC86-424B-9529-16EB0D89EE69","date":"new Date(\"Thu Jan 29 2015 10:36:01 GMT+0100 (Central Europe Standard Time)\")"},"111":{"morph":{"__isSmartRef__":true,"id":0},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"112":{"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":113}},"113":{"test01IsMorph":{"__isSmartRef__":true,"id":114}},"114":{"varMapping":{"__isSmartRef__":true,"id":115},"source":"function test01IsMorph(aPart) {\n    this.assert(aPart.isMorph, 'rectangle should be a morph');\n}","funcProperties":{"__isSmartRef__":true,"id":116},"__LivelyClassName__":"lively.Closure"},"115":{"this":{"__isSmartRef__":true,"id":112}},"116":{},"isSimplifiedRegistry":true}}