MJPEGStreamLib icon indicating copy to clipboard operation
MJPEGStreamLib copied to clipboard

"stream.stop()" not Stoping Stream.

Open Token-Thinker opened this issue 5 years ago • 2 comments

Hello,

Thank you for creating this library, having a bit of trouble understanding why the Stream isn't stopping on "stream.stop()"

I've tried switching the status to false as well as making the ViewController hidden.

Both still have the stream working in the background.

Thank you in Advance, TK

    func videoStream(streamStatus: Bool ){
        var stream: MJPEGStreamLib!
        stream = MJPEGStreamLib(imageView: streamView)
        
        if streamStatus == true {

        // Your stream url should be here !
        let url = URL(string: "http://testStream.local:81/stream")
        stream.contentURL = url
            stream.play()
        print("Stream Enabled")

        } else if streamStatus == false{
            print("Stream Disabled")
            stream.stop()

        }
    }

Token-Thinker avatar Nov 19 '20 19:11 Token-Thinker

Hello @Token-Thinker, Thank you for your kind words and using this library :) It's been awhile making this library. I guess I need to upgrade to the latest Swift version and practises. I will work on it this weekend. Of course, PR's are welcomed if you want to contribute the library :)

WrathChaos avatar Nov 20 '20 07:11 WrathChaos

I would love to contribute, to help develop my skills as well.

Let me know where I can help (Still junior/mid-level coder)

Token-Thinker avatar Nov 21 '20 02:11 Token-Thinker