Skip to content
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

Stream interruption on connection changes and front camera switch #489

Closed
arkadiyo opened this issue Dec 19, 2018 · 1 comment
Closed

Stream interruption on connection changes and front camera switch #489

arkadiyo opened this issue Dec 19, 2018 · 1 comment

Comments

@arkadiyo
Copy link

Hello.
We had the following problem when using the library.
We broadcast from the iOS application to the nginx-rtmp server. In most cases, it have no problems. However, we are faced with two issues that we cannot resolve yet:

  1. If during a broadcast via Wifi, switch the phone to a mobile network (turn off WiFi), the video stream is interrupted in wrong way (rmtp-server does not raise the necessary events for the correct completion of the broadcast).
    Is it possible to continue an interrupted broadcast or, for example, use a buffer which can help do stream more stable on connection problems?

  2. On some old devices, such as the iPhone 5s, if we are trying to switch to front camera, the video stream is also interrupted incorrectly. The audio continues to be transmitted but have no video. Sometimes it can "slow down" stream (and device i think) for a few seconds, but then it is also interrupted. On more modern devices (iPhone SE and above), switching the camera does not cause problems.
    Can you help us to solve this issue? Or give some advice what we should try?

Thank you.

@shogo4405
Copy link
Owner

  1. If during a broadcast via Wifi,

You can get "NetConnection.Connect.Closed" event.

rtmpConneciton.addEventListener(Event.RTMP_STATUS, selector: #selector(rtmpStatusEvent), observer: self)

    @objc func rtmpStatusEvent(_ status: Notification) {
        let e: Event = Event.from(status)
        guard
            let data: ASObject = e.data as? ASObject,
            let code: String = data["code"] as? String,
            let streamName: String = streamName else {
            return
        }
        switch code {
        case RTMPConnection.Code.connectClosed.rawValue:
            stream.publish(streamName)
        default:
            break
        }
    }
  1. On some old devices, such as the iPhone 5s

I have no iPhone5s. I can't help you.

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants