Flex vs. NET Interop (13): Fluorinefx.net realizes video recording and video playback

Source: Internet
Author: User
Tags bool

This article mainly introduces the use of fluorinefx.net to achieve video recording and video playback, FluorineFX like FMS, in addition to the AMF Communication, rtmp protocol, RPC and remote sharing objects, it also has the function of video streaming services. It is very convenient for us to realize the development of similar applications such as online video recording, live video, video chatting and video conferencing.

In the FMS3 series (four): Online video recording, video playback in this article I wrote the implementation of online video recording and video playback through the FMS function, the client development and this article is the same, the difference is that this article will use Flex to develop.

First we take a look at how to use the FLUORINEFX server is developed, the establishment of applicationadapter is inevitable, here we have for the sample program in this article established Applicationadapter for Videoapplication, and add Remotingserviceattribute to the following code block:

namespace Fx.Adapter
{
    /// <summary>
    /// 视频应用
    /// </summary>
     [RemotingService]
    public class VideoApplication : ApplicationAdapter
    {
         public override bool AppStart(IScope application)
        {
            return  base.AppStart(application);
        }

        public override bool AppConnect(IConnection  connection, object[] parameters)
        {
            return base.AppConnect(connection,  parameters);
        }
    }
}

The method provided by the Applicationadapter template is rewritten in the actual project development according to its own requirements, and is not introduced here. This is still unable to achieve the video recording and playback functions, this is only to achieve the basic starting application and client connection, and other basic functions, to achieve video recording and playback, we have to let videoapplication implement Istreamservice interface, This interface provides the appropriate functionality to implement video publishing and playback, defined as follows:

Namespace FluorineFx.Messaging.Api.Stream
{
[CLSCompliant (False)]
Public interface Istreamservice:iscopeservice, IService
{
void Closestream ();
int CreateStream ();
void Deletestream (int streamid);
void Deletestream (istreamcapableconnection connection, int streamid);
void Pause (bool pauseplayback, double position);
void Play (bool dontstop);
void Play (string name);
void Play (string name, double start);
void Play (string name, double start, double length);
void Play (string name, double start, double length, bool flushplaylist);
void publish (bool dontstop);
void Publish (string name);
void Publish (string name, string mode);
void Receiveaudio (bool receive);
void Receivevideo (bool receive);
void Releasestream (string streamname);
void seek (double position);
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.