Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3722

Youtube WkWebView blank space issue

$
0
0

At first, YouTube videos run well. However, when the app enters the background thread, an empty screen appears. Even if the tableview is refreshed, the video screen does not return to normal, and the app must be restarted.

class HomeTableViewCell: UITableViewCell {    var disposeBag = DisposeBag()    var data = PublishRelay<ViewPost>()    var isLoaded = false    func bind() {        data.asDriver() { _ in .never() }            .drive(onNext: { [weak self] currentPost in                guard let self = self else { return }                if self.isLoaded == true {                    self.videoContainerView.cueVideo(byId: currentPost.url, startSeconds: 0, suggestedQuality: .default)                }                else {                    self.videoContainerView.load(withVideoId: currentPost.url)                    self.isLoaded = true                }                ......            } )            .disposed(by: disposeBag)    let videoContainerView: WKYTPlayerView = {            let videoContainerView = WKYTPlayerView()            videoContainerView.translatesAutoresizingMaskIntoConstraints = false            videoContainerView.clipsToBounds = true            videoContainerView.layer.cornerRadius = 15            return videoContainerView    }()}

Viewing all articles
Browse latest Browse all 3722

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>