Video/Screen Recorder for web application

拥有回忆 提交于 2019-12-05 06:17:42

问题


I am working on Virtual Classroom project (which is developed in flex) in which we have to add a recording function so that end user can get recorded video file of the session at the end. which technology should I use for the same?


回答1:


try this :

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               width="955" height="600"
               addedToStage="onInit();"
               frameRate="24" >
    <fx:Script>
        <![CDATA[
            import com.dd.screencapture.ScreenCapture;
            import com.dd.screencapture.SimpleFlvWriter;

            private var screenCapture:ScreenCapture;

            private function onInit():void
            {
                screenCapture = ScreenCapture.getInstance();
                screenCapture.source = stage;
                screenCapture.fps = 12;
                screenCapture.size( 400, 300 );
                screenCapture.x = 400;
                screenCapture.y = 250;
                stage.addChild( screenCapture );
            }

            private function startRecord( event:MouseEvent ):void
            {
                screenCapture.record();
            }

            private function stopRecord( event:MouseEvent ):void
            {
                screenCapture.stop();
            }

            private function playVideo( event:MouseEvent ):void
            {
                screenCapture.play();
            }

            private function saveVideo( event:MouseEvent ):void
            {
                var saveFile:FileReference = new FileReference();
                saveFile.save( screenCapture.data, "record.flv" );
            }
        ]]>
    </fx:Script>
    <s:VideoDisplay width="400" height="300" source="assets/myVideo.flv" />

    <mx:HBox >
        <s:Button label="Record" click="startRecord( event );" />
        <s:Button label="Stop" click="stopRecord( event );" />
        <s:Button label="Play" click="playVideo( event );" />
        <s:Button label="Save" click="saveVideo( event );" />
    </mx:HBox>
</s:Application>

download and add this swc liberary to your project build path :

ScreenRecorder.swc



来源:https://stackoverflow.com/questions/29744874/video-screen-recorder-for-web-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!