You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been struggling with this for a few days now. I'm playing Youtube videos in full screen but, randomly, some videos are just playing the sound with no image (not a black screen either). I think what happens is that they are playing in the background. This happens in all versions and devices.
I'm creating a view of the video with the size of the screen but, in fact, I don't add it to the view since it is always shown in full screen and the library really seems to create another view on its own to play in full screen and doesn't use the one I created. Anyway, when I add the video window to the view it keeps happens the same.
This is the code I use to configure my video:
self.viewVideo = YouTubePlayerView(frame: (UIApplication.shared.delegate as! AppDelegate).window!.bounds)
self.viewVideo.delegate = self
self.viewVideo.playerVars = [
"playsinline":"0" as AnyObject,
"controls":"1" as AnyObject,
"fs":"1" as AnyObject,
"iv_load_policy":"3" as AnyObject,
"modestbranding":"1" as AnyObject,
"rel":"0" as AnyObject,
"showinfo":"0" as AnyObject
]
if button.url.count == 11
{
self.viewVideo.loadVideoID(button.url)
}
else if let videoURL = URL(string: button.url)
{
self.viewVideo.loadVideoURL(videoURL)
}
On "playerReady" delegate method, I only have a "self.viewVideo.play()"
I've tried to "catch" the player subview on playerReady method to bring it to front but I can't identify the "real" one (I guess is a UIWebView)
Is anybody having the same issue?
The text was updated successfully, but these errors were encountered:
rmvz3
changed the title
Video is randomly played under other views
Sometimes only sound is played. Video is played under other views?
Jan 8, 2019
rmvz3
changed the title
Sometimes only sound is played. Video is played under other views?
Sometimes only sound is played. Is video played under other views?
Jan 8, 2019
I've also had this issue in our app. Sometimes we could see the video and sometimes not. What I can suggest you to do is to add your youtubeView to your view hierarchy and anchor it there (meaning: use autolayout and drop the frame approach). That's what solved our issue.
Hi there.
I've been struggling with this for a few days now. I'm playing Youtube videos in full screen but, randomly, some videos are just playing the sound with no image (not a black screen either). I think what happens is that they are playing in the background. This happens in all versions and devices.
I'm creating a view of the video with the size of the screen but, in fact, I don't add it to the view since it is always shown in full screen and the library really seems to create another view on its own to play in full screen and doesn't use the one I created. Anyway, when I add the video window to the view it keeps happens the same.
This is the code I use to configure my video:
On "playerReady" delegate method, I only have a "self.viewVideo.play()"
I've tried to "catch" the player subview on playerReady method to bring it to front but I can't identify the "real" one (I guess is a UIWebView)
Is anybody having the same issue?
The text was updated successfully, but these errors were encountered: