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

Video Still Playing when screen is disappear. #8

Open
YogeshPateliOS opened this issue Mar 23, 2020 · 3 comments
Open

Video Still Playing when screen is disappear. #8

YogeshPateliOS opened this issue Mar 23, 2020 · 3 comments

Comments

@YogeshPateliOS
Copy link

Hello pausePlayeVideos method not working. I check with DisAppear Method as well.

@YogeshPateliOS
Copy link
Author

YogeshPateliOS commented Mar 23, 2020

For remove player add this code ASVideoPlayerController class. hope it's helpful for you.

    func removePlayer(tableView: UITableView){
        let visisbleCells = tableView.visibleCells
        var maxHeight: CGFloat = 0.0
        for cellView in visisbleCells {
            guard let containerCell = cellView as? ASAutoPlayVideoLayerContainer,
                let videoCellURL = containerCell.videoURL else {
                    continue
            }
            let height = containerCell.visibleVideoHeight()
            if maxHeight < height {
                maxHeight = height
            }
            pauseRemoveLayer(layer: containerCell.videoLayer, url: videoCellURL, layerHeight: height)
        }
    }

@JolChrSA
Copy link

@YogeshPateliOS Can you give a solution for Video in the First cell is not playing when it appears the first time, we have to drag its bottom slightly to play the video.

Plz, help me with that. Thanks in advance.

@pratikgajbhiye222
Copy link

For remove player add this code ASVideoPlayerController class. hope it's helpful for you.

    func removePlayer(tableView: UITableView){
        let visisbleCells = tableView.visibleCells
        var maxHeight: CGFloat = 0.0
        for cellView in visisbleCells {
            guard let containerCell = cellView as? ASAutoPlayVideoLayerContainer,
                let videoCellURL = containerCell.videoURL else {
                    continue
            }
            let height = containerCell.visibleVideoHeight()
            if maxHeight < height {
                maxHeight = height
            }
            pauseRemoveLayer(layer: containerCell.videoLayer, url: videoCellURL, layerHeight: height)
        }
    }

ty

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

No branches or pull requests

3 participants