Skip to content

Change play url from whip-play to whep #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 00121d141058d4dcf8ab52e9a3819bbc, type: 3}
m_Name:
m_EditorClassIdentifier:
url: http://localhost:1985/rtc/v1/whip-play/?app=live&stream=livestream
url: http://localhost:1985/rtc/v1/whep/?app=live&stream=livestream
receiveImage: {fileID: 1619817302}
receiveAudio: {fileID: 1676004071}
--- !u!1 &1511799723
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
public class SrsPlayer : MonoBehaviour
{
// The WHIP stream url, to pull WebRTC stream from SRS or other media
// servers. Please note that SRS uses `/rtc/v1/whip-play/` as a WebRTC
// servers. Please note that SRS uses `/rtc/v1/whep/` as a WebRTC
// player, or parameter `action=play` in query string.
public string url = "http://localhost:1985/rtc/v1/whip-play/?app=live&stream=livestream";
public string url = "http://localhost:1985/rtc/v1/whep/?app=live&stream=livestream";
// The RAW image to render the received WebRTC video stream. Generally, it
// should be in a Canvas object. Please note that we will scale the image
// size according to the video stream resolution.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SRS WebRTC Samples for Unity.

Unity supports WebRTC, see [com.unity.webrtc](https://docs.unity3d.com/Packages/[email protected]/manual/index.html) or [github](https://github.com/Unity-Technologies/com.unity.webrtc). However, the demos only work in P2P mode, not with remote SFU or SRS.

To work with SFU or WebRTC server, the best practice is to use [WHIP](https://datatracker.ietf.org/doc/draft-ietf-wish-whip/) for Unity to publish to SFU, such as SRS. Actually, you're also able to play stream by WHIP.
To work with SFU or WebRTC server, the best practice is to use [WHIP](https://datatracker.ietf.org/doc/draft-ietf-wish-whip/) for Unity to publish to SFU, such as SRS. Actually, you're also able to play stream by [WHEP](https://datatracker.ietf.org/doc/draft-murillo-whep/).

The most common use scenaio for publishing stream, is to covert video game as live streaming. However you can use OBS to capture the window and audio, but it enable you to capture from Unity inside, cool! It works like this:

Expand Down Expand Up @@ -160,7 +160,7 @@ Please follow [Setting up project](#setting-up-project), then work with `Player`

1. Publish the WebRTC stream by [H5](http://localhost:8080/players/rtc_publisher.html?autostart=true).
1. From `Project` panel, open `Asserts > ossrs.io > SRS WebRTC Samples > Player`, then open the `Scene`.
1. Open Main camera object in the editor and under the SRS player script, change the ip address and stream key to your e.g. `http://localhost:1985/rtc/v1/whip-play/?app=live&stream=livestream`
1. Open Main camera object in the editor and under the SRS player script, change the ip address and stream key to your e.g. `http://localhost:1985/rtc/v1/whep/?app=live&stream=livestream`
1. Click `Edit > Play` to play Unity scene, which publish WebRTC stream to SRS.

> Note: You're also able to publish a live stream and play it in Unity using WebRTC, see [WebRTC for Live Streaming](https://ossrs.io/lts/en-us/docs/v5/doc/getting-started#webrtc-for-live-streaming).
Expand Down