Skip to content
This repository has been archived by the owner on Dec 27, 2020. It is now read-only.

add example #18

Merged
merged 0 commits into from
Sep 6, 2020
Merged

add example #18

merged 0 commits into from
Sep 6, 2020

Conversation

adwpc
Copy link
Member

@adwpc adwpc commented Aug 8, 2020

Description

just a simple replace now
using //FIXED-TO-V3 to mark

  • Play Files from Disk
  • Save files to Disk
  • Broadcast
  • Simulcast

how about merge broadcat+simulcat=mini-sfu in the future
this can show all feature.

@adwpc adwpc requested review from at-wat and Sean-Der August 8, 2020 05:16
Copy link
Member

@at-wat at-wat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments to broadcast example

examples/broadcast/main.go Outdated Show resolved Hide resolved
examples/broadcast/main.go Outdated Show resolved Hide resolved
}()

// Create a local track, all our SFU clients will be fed via this track
localTrack, newTrackErr := peerConnection.NewTrack(remoteTrack.PayloadType(), remoteTrack.SSRC(), "video", "pion")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Payload type and SSRC should be automatically set on v3, but new interface is not yet designed)

Comment on lines 83 to 91
i, readErr := remoteTrack.Read(rtpBuf)
if readErr != nil {
panic(readErr)
}

// ErrClosedPipe means we don't have any subscribers, this is ok if no peers have connected yet
if _, err = localTrack.Write(rtpBuf[:i]); err != nil && err != io.ErrClosedPipe {
panic(err)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref: #13

examples/broadcast/main.go Outdated Show resolved Hide resolved
@Sean-Der Sean-Der force-pushed the example branch 3 times, most recently from f9c4ad1 to 1b91c75 Compare September 6, 2020 06:01
@Sean-Der Sean-Der merged commit 1b91c75 into master Sep 6, 2020
@Sean-Der Sean-Der deleted the example branch September 6, 2020 06:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants