我知道我们可以使用这段代码发布flash rtmfp流:
private const CirrusAddress:String = "rtmfp://p2p.rtmfp.net";
private const DeveloperKey:String = "your-developer-key";
private var netConnection:NetConnection;
netConnection = new NetConnection();
netConnection.addEventListener(NetStatusEvent.NET_STATUS,
netConnectionHandler);
netConnection.connect(CirrusAddress + "/" + DeveloperKey);
private var sendStream:NetStream;
sendStream = new NetStream(netConnection, NetStream.DIRECT_CONNECTIONS);
sendStream.addEventListener(NetStatusEvent.NET_STATUS,
netStreamHandler);
sendStream.publish("media");
sendStream.attachAudio(Microphone.getMicrophone());
sendStream.attachCamera(Camera.getCamera());
因此,使用此代码,接收者可以使用此代码(sendStream.publish("media")
)读取已发布的流(recvStream.play("media")
):
private var recvStream:NetStream;
recvStream = new NetStream(netConnection, id_of_publishing_client);
recvStream.addEventListener(NetStatusEvent.NET_STATUS, netStreamHandler);
recvStream.play("media");
但是,我的问题是:HTML5中是否有相当于上面的代码?换句话说,如何使用HTML5阅读已发布的流?
谢谢,
问候。
答案 0 :(得分:0)
为了能够将其与HTML5s视频支持一起使用,您必须将其发布为可通过HTTP访问的文件,例如,以webm格式发布。