gilesvangruisen/Swift-YouTube-Player

Not playing video and audio.

Opened this issue · 9 comments

Please check for Xr4H_bV8Raw, It is not playing. Working fine with later UIWebview version, but not working with current Wkwebview version. Please check and resolve issue soon.

+1
The actual issue is that the player opens but the audio and video are not coming while the timer proceeds normally.

@gilesvangruisen any updates on this as it is coming on more videos now.

@gilesvangruisen any updates on this as it is coming on more videos now.

Hi @ShubhGar thanks for reporting this. I can’t quite see what might be unique about that video, and my only guess is that YouTube has been locking down uses of the Iframe API. Are you able to play them in mobile Safari?

It might be helpful to see more of the videos that you say are not playing properly to try and determine if there is something unique about all of them that might be causing this. Otherwise, I’d recommend searching around for others having the same issue with the Iframe API in WebKit. This library is only a simple wrapper around a web view, so I’m unsure what would be causing the issue here.

@gilesvangruisen Thanks for reply, yes, video work fine in safari.I will share some more video too.

Hi @gilesvangruisen its not working for lots of video now. check videoid aDmywEFC_YE

Hi @ShubhGar those videos you shared playing my side.
@gilesvangruisen Id with "5geiimgNBCQ" not playing.

htmlString:

<!--\n Copyright 2014 Google Inc. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n -->\n<!DOCTYPE html>\n<html>\n <head>\n <style>\n * { margin: 0; padding: 0; }\n html, body { width: 100%; height: 100%; }\n </style>\n </head>\n <body>\n <div id=\"player\"></div>\n <script src=\"https://www.youtube.com/iframe_api\"></script>\n <script>\n var player;\n YT.ready(function() {\n player = new YT.Player(\'player\', {\n \"width\" : \"100%\",\n \"playerVars\" : {\n \"playsinline\" : 1\n },\n \"events\" : {\n \"onReady\" : \"onReady\",\n \"onStateChange\" : \"onStateChange\",\n \"onPlaybackQualityChange\" : \"onPlaybackQualityChange\",\n \"onError\" : \"onPlayerError\"\n },\n \"height\" : \"100%\",\n \"videoId\" : \"5geiimgNBCQ\"\n});\n window.location.href = \'ytplayer://onYouTubeIframeAPIReady\';\n });\n function onReady(event) {\n window.location.href = \'ytplayer://onReady?data=\' + event.data;\n }\n\n function onStateChange(event) {\n window.location.href = \'ytplayer://onStateChange?data=\' + event.data;\n }\n\n function onPlaybackQualityChange(event) {\n window.location.href = \'ytplayer://onPlaybackQualityChange?data=\' + event.data;\n }\n function onPlayerError(event) {\n window.location.href = \'ytplayer://onError?data=\' + event.data;\n }\n </script>\n </body>\n</html>

#162 (comment)

this fixed my problem