Intel® Collaboration Suite for WebRTC
Community support and discussions on the Intel® Collaboration Suite for WebRTC (Intel® CS for WebRTC).
1146 Discussions

请问有实现P2P远程视频播放的样例吗?

Liu__David
Beginner
1,806 Views

您好,请问有实现P2P远程视频播放的样例吗?

Signaling server采用了PeerServer-Release-4.2.1,通过node peerserver.js命令已经运行起来。

但有在Peer A和Peer B上运行的样例代码吗? 谢谢!

   

 

系统框图.png

0 Kudos
11 Replies
dandy__kiven
Beginner
1,811 Views

i do it ok and run success ,please add me email :1213126651@qq.com

0 Kudos
Chunbo_H_Intel1
Employee
1,811 Views

Please look at the source code from CS_WebRTC_Client_SDK_JavaScript.v4.3\samples\p2p.

0 Kudos
Liu__David
Beginner
1,811 Views

Chunbo H. (Intel) wrote:

Please look at the source code from CS_WebRTC_Client_SDK_JavaScript.v4.3\samples\p2p.

The source code in the p2p example can capture stream from webcam in the local machine.

It uses MediaStreamFactory.createMediaStream() to create a video stream( call getDisplayMedia() for srceen and getUserMedia() for webcam).

I want to capture stream from a IPcamera which provides RTSP or RTMP stream, not webcam or screen。

How can I capture the stream from a RTMP url? For example :  rtmp://127.0.0.1/live/  (It can played in VLC player)

Below is my code:

      <video width="640px" height="480px" id="localVideo" controls playsinline muted>
        <source src="rtmp://127.0.0.1/live/" type="rtmp/flv">
        <!-- source src="rtmp://media3.sinovision.net:1935/live/livestream" type="rtmp/flv" -->
      </video>

       ... ...

            var video_element = document.getElementById("localVideo");
            mediaStream = video_element.captureStream();
            video_element.play();
When I run the code, an error prompted :  "Error: All tracks are ended."

Can you tell me what is wrong with the code above? Thanks.

0 Kudos
Liu__David
Beginner
1,811 Views

When the <video> source is a mp4 file, such as :<source src="js/array.mp4" type="video/mp4">, the video_element.captureStream() works OK. Mp4 stream can be transported to the remote peer and played OK.

 

0 Kudos
Liu__David
Beginner
1,811 Views

The source code I used has change from v4.2.1 to v4.3 

0 Kudos
Chunbo_H_Intel1
Employee
1,811 Views

Did this local video element with RTMP play as expected?

0 Kudos
Liu__David
Beginner
1,811 Views

Yes, it can be played with VLC player, or played with video.js inside the webpage:

var vsplayer = videojs("localVideo");
      vsplayer.play();

0 Kudos
Liu__David
Beginner
1,811 Views

I want :

    Peer B capture RTMP stream and publish to Peer A.

Peer B can play the locally with videojs, but can not publish to Peer A. It prompted :  "Error: All tracks are ended."

0 Kudos
Liu__David
Beginner
1,811 Views

Chunbo H. (Intel) wrote:

Did this local video element with RTMP play as expected?

Can you tell me your email? I can send the complete code to you.

0 Kudos
Liu__David
Beginner
1,811 Views
Is there any other method to capture stream from an video object besides of captureStream()?
0 Kudos
Chunbo_H_Intel1
Employee
1,811 Views

According to the feedback from our feature owner, we don’t support RTSP/RTMP at client side currently.

0 Kudos
Reply