For playing media from disk you have https://github.com/pion/webrtc/tree/master/examples/play-fro...
To see how to accept and process RTCP see https://github.com/pion/webrtc/tree/master/examples/rtcp-pro...
The example-webrtc-applications repo also shows how you could get media from GStreamer.
Pion doesn't have a way to exactly implement your business logic. You have two choices (and they both can be implemented with Pion)
* Store everything since the last keyframe and RTX to the user. You have access to PLIs and NACKs so you can do that.
* Request a new keyframe from the encoder.
I would love to ship something that exactly meets your need, but I don't think I can.
I understand that pion is a transport library, I was mostly wondering if you've seen anyone solve this issue. To give you a little background, we built an app that allowed a movie containing a children's story to be read aloud with the participants.The movie streamed from our servers of WebRTC. It worked well, but we found that users in Europe often have DSL and using a keyframe interval of 3 seconds was too much for their connections to handle. Increasing the keyframe interval lead to situations where users saw nothing when they first connected. We eventually switched to synchronized local playback for media, but it's much more difficult to time perfectly and people have noticed it's more out-of-sync than before.
But people are successfully streaming pre-recorded media. You have to do out of band communication, and that will just have to be custom afaik :/
But keep looking! Just make sure to mention that you’re targeting DSL so people know not to recommend things you’ve already ruled out.