Update examples

TestNonFatalRead now has an timeout.
Examples now use Mime types, instead of raw strings.

Fixes #839
This commit is contained in:
Antoine Baché
2021-06-28 22:39:11 +02:00
committed by Sean DuBois
parent 8a0df90831
commit 7e049ec5ec
21 changed files with 436 additions and 63 deletions

View File

@@ -133,19 +133,22 @@ func main() {
if connectionState == webrtc.ICEConnectionStateConnected {
fmt.Println("Ctrl+C the remote client to stop the demo")
} else if connectionState == webrtc.ICEConnectionStateFailed ||
connectionState == webrtc.ICEConnectionStateDisconnected {
closeErr := oggFile.Close()
if closeErr != nil {
} else if connectionState == webrtc.ICEConnectionStateFailed {
if closeErr := oggFile.Close(); closeErr != nil {
panic(closeErr)
}
closeErr = ivfFile.Close()
if closeErr != nil {
if closeErr := ivfFile.Close(); closeErr != nil {
panic(closeErr)
}
fmt.Println("Done writing media files")
// Gracefully shutdown the peer connection
if closeErr := peerConnection.Close(); closeErr != nil {
panic(closeErr)
}
os.Exit(0)
}
})