AutoVideoPlayer icon indicating copy to clipboard operation
AutoVideoPlayer copied to clipboard

Video Still Playing when screen is disappear.

Open YogeshPateliOS opened this issue 4 years ago • 3 comments

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

YogeshPateliOS avatar Mar 23 '20 07:03 YogeshPateliOS

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)
        }
    }

YogeshPateliOS avatar Mar 23 '20 07:03 YogeshPateliOS

@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.

JolChrSA avatar Jun 12 '20 06:06 JolChrSA

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

pratikgajbhiye222 avatar Jul 10 '20 21:07 pratikgajbhiye222