Problem with webrtc in Chrome and in Safari

I’m trying to integrate webrtc into my project. I need to play live streams in browsers. If the source stream is published using webrtc everything works fine. But if I publish a stream using rtmp it is not played in chrome and Safari.