How to do one-to-many video broadcast?
2012-12-20 22:19
417 查看
VideoIO Flash-based
audio and video communication
Home › Flash-VideoIO Tutorial
How to do one-to-many video broadcast?
You can do one-to-many live video broadcast by having the broadcaster user publish live camera view and microphone to a media stream, and all other listeners play that media stream from the media server. Please see Howto work with media server? on details of installing and configuring a media server. For illustrations in this section we assume that you have a media server running on 192.1.2.3 and that has an application called myapp which allows you
to record a media stream. Thus, your media server application should be reachable at "rtmp://192.1.2.3/myapp". In real deployment you will use the real host name or IP address of your media server.
The one-to-many video broadcast requires all the listeners to know the media server URL to connect to and the stream name to listen and play. The broadcaster user picks a stream name, say, "myrant", and sets the src property of his VideoIO application
to enable publish as "rtmp://192.1.2.3/myapp?publish=myrant". The broadcaster informs the listeners about the src URL. A listener who wants to listen to this broadcast, replaces the publish with play and assigns the src property
of her VideoIO to "rtmp://192.1.2.3/myapp?play=myrant". The broadcaster can stop the stream by setting src to null or "". Similarly a listener can stop by setting src to null or "".
In a broadcast session, the broadcaster user is publishing his stream whereas other listeners are playing his stream. Thus the remaining challenge is to convey the desired stream URL to the listeners. In practice, people use variety of methods ranging from
CGI web service or static web sites to list all the broadcast URLs, or announcing via email or Jabber service. Whatever mechanism you decide will become the broadcast announcement service of your system. In our tutorial we will assume that these information
is sent out-of-band to the individuals, e.g., over instant messenging or email.
Information: Typically a media server allows any number of play instances for a stream name, but only one publish instance within a URL scope. Hence, the stream name must be chosen carefully by the broadcaster user to avoid
conflict with other broadcasters.
The user interface for broadcaster will typically be different than that of the listener. A broadcaster will typically have a VideoIO instance and perhaps a text-based feedback from the listeners. A listener will typically have a listing of all the broadcast
sessions, an ability to join a session, and a VideoIO instance when he joins a session. Additionally, there may be a text-based input box to allow sending questions or feedback to the broadcaster.
The following user interface embeds a VideoIO instance which can be used by broadcaster as well as listener. To try the demonstration, open this page in multiple browser instances. You can try on different machines or the same machine. On the first browser
instance, select "publish" in the drop-down box to act as a broadcaster, before clicking on the set button. On other browser instances, keep the default "play" in the drop-down box and click on the setbutton to act as listeners. If you are
running media server on a different host than 192.1.2.3, change the URL's IP address in all text input boxes.
?
publishplay =
The source code for this is similar to earlier examples. You can also right-click and select "View Page Source" or equivalent menu option to see the source code.
Summary
In summary, you can use the src property with URL parameter containing publish for broadcast user's stream and playfor listener user's stream. The recording and playing properties control the current state of whetheryour video is transmitted or whether remote video is played.
This tutorial is just the begining of how to do one-to-many video broadcast. The VideoIO API is so simple that just setting the src property allows you to accomplish several use cases. There are several other properties that affect behavior of a call,
e.g., you can control the camera quality or sound mute. Additionally, you can build other advanced user interface controls in JavaScript similar to how VideoIO's control panel shows in Flash.
相关文章推荐
- How to do video broadcast using multicast group?
- Compute how many bits to require convert one integer to another
- Beginning MyBatis 3 Part 2 : How to Handle One-to-Many and One-to-One Selects
- 一个对自己负责的软件开发人员该怎么做(How to do for one qualified developer)
- How to do two-party video call?
- How to do multi-party video conference?
- How to define One-Many and One-One relationships
- Compute how many bits to require convert one integer to another
- How to do peer-to-peer video call?
- How do I download or save a YouTube video to my computer?
- (Django) How do I set limit_choices_to another class from where the ManyToManyField points to? - django, django-models - TechQues.com
- How to use Hibernate annotations @ManyToOne and @OneToMany for associations
- Beginning MyBatis 3 Part 2 : How to Handle One-to-Many and One-to-One Selects
- Beginning MyBatis 3 Part 2 : How to Handle One-to-Many and One-to-One Selects
- Beginning MyBatis 3 Part 2 : How to Handle One-to-Many and One-to-One Selects
- Attention to How Do Thought Work One
- Beginning MyBatis 3 Part 2 : How to Handle One-to-Many and One-to-One Selects
- JPA 的 @OneToMany 注解
- @OneToMany、@ManyToOne以及@ManyToMany讲解(五)
- django+python+操作数据库多表关联-增删改查-many-to-many-many-to-one