Fixed
Status Update
Comments
je...@google.com <je...@google.com> #2
Thanks for reporting; I've escalated that to our engineering team and they'll investigate further.
ce...@felixholler.com <ce...@felixholler.com> #3
Having the same issue under ios7. Embeded video in iframe is not playing by calling player.playVideo(). It remains on state 3 (buffering). Only after hitting the ios controls play button twice the clip starts playing. My code works fine under ios6 and in all desktop browsers.
av...@gmail.com <av...@gmail.com> #4
Just wanted to chime in with a few comments.
I'm seeing the same issue with my code on iOS 7 (simulator, iPad). The code works without issues on iOS 6 (simulator, iPhone, iPad). It is almost as if iOS 7 ignores 'mediaPlaybackRequiresUserAction' for
inline playback.
A few observations with reference to YoutubeAutoplayTest.zip above:
- The video does play if you drag the player up. In my app, the playback controls are visible, and tapping the 'play' button twice gets the player to play.
- If you set 'playsinline' to 0 in youtube.html, the video plays automatically when the app launches.
- If you set 'webView.mediaPlaybackRequiresUserAction' to YES in ViewController.m in any of the above two cases (inline playback or otherwise), the player is unusable -- it just presents a black area.
I imagine this behavior breaks a few existing apps -- it certainly is a big issue for my upcoming app. A fix/workaround would be much appreciated!
I'm seeing the same issue with my code on iOS 7 (simulator, iPad). The code works without issues on iOS 6 (simulator, iPhone, iPad). It is almost as if iOS 7 ignores 'mediaPlaybackRequiresUserAction' for
inline playback.
A few observations with reference to YoutubeAutoplayTest.zip above:
- The video does play if you drag the player up. In my app, the playback controls are visible, and tapping the 'play' button twice gets the player to play.
- If you set 'playsinline' to 0 in youtube.html, the video plays automatically when the app launches.
- If you set 'webView.mediaPlaybackRequiresUserAction' to YES in ViewController.m in any of the above two cases (inline playback or otherwise), the player is unusable -- it just presents a black area.
I imagine this behavior breaks a few existing apps -- it certainly is a big issue for my upcoming app. A fix/workaround would be much appreciated!
mp...@gmail.com <mp...@gmail.com> #5
Has there been any progress made on this? I just noticed the same exact behavior in my application and it's been 10 days since this was posted. This is a pretty big issue for existing applications that utilize the YouTube iFrame API considering the number of people who have updated to iOS 7.
ma...@gmail.com <ma...@gmail.com> #6
We are seeing the exact same behavior (as noted by the initial poster) in our application. Any help on this is greatly appreciated. Thanks!
st...@gmail.com <st...@gmail.com> #7
I've got this test file (attached). Auto-play plays inline about 10% of the time. If I remove "&playsinline=1" the movie auto-plays fullscreen, if I keep it in the movie does not play and I get the spinning wheel and have to touch the play button to play the video (same as above).
st...@gmail.com <st...@gmail.com> #8
[Comment deleted]
z5...@gmail.com <z5...@gmail.com> #9
same issue on my side, i have Thousands of users complaining about this issue on ios7 :(
an...@gmail.com <an...@gmail.com> #10
I can confirm that the same issue still exists (ios7)
ms...@gmail.com <ms...@gmail.com> #11
I don't even get pauseVideo() or stopVideo() on iOS 7 to work! Anyone can confirm this?
st...@gmail.com <st...@gmail.com> #12
Pause works with api call: ytplayer.pauseVideo()
You can send this to your UIWebView [_youTubeWebView stringByEvaluatingJavaScriptFromString:@"ytplayer.pauseVideo()"];
Hope that helps.
You can send this to your UIWebView [_youTubeWebView stringByEvaluatingJavaScriptFromString:@"ytplayer.pauseVideo()"];
Hope that helps.
ms...@gmail.com <ms...@gmail.com> #13
hi steve, i did that, but didnt work...
here is my code:
NSString *htmlString = [NSString stringWithFormat:@"<html><head></head><body style=\"margin:0\"><div id=\"player\"></div><script>var tag = document.createElement('script');tag.src = \"https://www.youtube.com/iframe_api\ "; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var player; function onYouTubeIframeAPIReady() { player = new YT.Player('player', { height: '%d', width: '320', videoId: '%@', playerVars: { 'playsinline' : 1, 'showinfo' : 0, 'controls' : 1, 'enablejsapi' : 1, 'modestbranding' : 1, 'color' : 'white', 'iv_load_policy' : 3, 'rel' : 0, 'theme' : 'light' } }); } function pauseVideo(){ if (player) { player.pauseVideo(); } }</script></body></html>", heightVideoView, videoId];
[self.webView loadHTMLString:htmlString baseURL:nil];
then i call:
[self.webView stringByEvaluatingJavaScriptFromString:@"pauseVideo()"]
when i replace "player.pauseVideo();" with "return 'hello';" and log the return value, console output is as expected, so i can verify that the function is called correctly and also "player" var is set up correctly. The video is also working as expected, but currently, only user initiated actions are executed...
here is my code:
NSString *htmlString = [NSString stringWithFormat:@"<html><head></head><body style=\"margin:0\"><div id=\"player\"></div><script>var tag = document.createElement('script');tag.src = \"
[self.webView loadHTMLString:htmlString baseURL:nil];
then i call:
[self.webView stringByEvaluatingJavaScriptFromString:@"pauseVideo()"]
when i replace "player.pauseVideo();" with "return 'hello';" and log the return value, console output is as expected, so i can verify that the function is called correctly and also "player" var is set up correctly. The video is also working as expected, but currently, only user initiated actions are executed...
st...@gmail.com <st...@gmail.com> #14
This works for pausing the video.
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
_webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 350)];
_webView.allowsInlineMediaPlayback = YES;
_webView.mediaPlaybackRequiresUserAction = NO;
[self.view addSubview:_webView];
NSString* embedHTML = [NSString stringWithFormat:@"<html><body style='margin:0px;padding:0px;'><script type='text/javascript' src='http://www.youtube.com/iframe_api '></script><script type='text/javascript'>function onYouTubeIframeAPIReady(){ytplayer=new YT.Player('playerId',{events:{onReady:onPlayerReady}})}function onPlayerReady(a){ a.target.playVideo(); }</script><iframe id='playerId' type='text/html' width='320' height='350' src='http://www.youtube.com/embed/%@?enablejsapi=1&rel=0&playsinline=1&autoplay=1 ' frameborder='0'></body></html>", @"SbPFDcspRBA"];
[_webView loadHTMLString:embedHTML baseURL:[[NSBundle mainBundle] resourceURL]];
UIButton* pauseButton = [[UIButton alloc] initWithFrame:CGRectMake(10, 375, 100, 50)];
[pauseButton setTitle:@"Pause" forState:UIControlStateNormal];
[pauseButton addTarget:self action:@selector(pauseVideo:) forControlEvents:UIControlEventTouchUpInside];
pauseButton.backgroundColor = [UIColor redColor];
[self.view addSubview:pauseButton];
}
-(IBAction)pauseVideo:(id)sender{
[_webView stringByEvaluatingJavaScriptFromString:@"ytplayer.pauseVideo()"];
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
_webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 350)];
_webView.allowsInlineMediaPlayback = YES;
_webView.mediaPlaybackRequiresUserAction = NO;
[self.view addSubview:_webView];
NSString* embedHTML = [NSString stringWithFormat:@"<html><body style='margin:0px;padding:0px;'><script type='text/javascript' src='
[_webView loadHTMLString:embedHTML baseURL:[[NSBundle mainBundle] resourceURL]];
UIButton* pauseButton = [[UIButton alloc] initWithFrame:CGRectMake(10, 375, 100, 50)];
[pauseButton setTitle:@"Pause" forState:UIControlStateNormal];
[pauseButton addTarget:self action:@selector(pauseVideo:) forControlEvents:UIControlEventTouchUpInside];
pauseButton.backgroundColor = [UIColor redColor];
[self.view addSubview:pauseButton];
}
-(IBAction)pauseVideo:(id)sender{
[_webView stringByEvaluatingJavaScriptFromString:@"ytplayer.pauseVideo()"];
}
ms...@gmail.com <ms...@gmail.com> #15
thanks steve, awesome, your code works for me too, haven't yet figured out what made the difference, but both pauseVideo() as well as autoplay works...
fr...@gmail.com <fr...@gmail.com> #16
a lot of problems today with ipad, ios7 and live streaming channel on youtube
ke...@gmail.com <ke...@gmail.com> #17
@Steve. This is amazing.. works like a charm and its very simple too :)
av...@gmail.com <av...@gmail.com> #18
Apologies for the spam, but I'm wondering if we could get some more
information from YouTube on this issue.
This bug has been open for 37 days. It seems to be pretty high
priority to me:
- It impacts an important platform.
- It breaks existing apps.
- If it is not fixed, some apps will require a redesign, while
others may no longer be viable.
With this in mind, it would be very useful to get answers to any of
the following questions:
- What is YouTube's priority for this bug?
- Has the root cause been identified?
- Can the problem be fixed in YouTube's code, or does it require
Apple to make some changes?
- If Apple would have to make some changes, has this been brought to
their attention?
- If the problem can be fixed in YouTube's code, would it be
possible to get an ETA for a fix?
If not, can we get an ETA for an ETA, please? :)
We understand that YouTube has its own priorities and that
everything takes time, but some more visibility into the process would
be greatly appreciated...
Thanks in advance.
information from YouTube on this issue.
This bug has been open for 37 days. It seems to be pretty high
priority to me:
- It impacts an important platform.
- It breaks existing apps.
- If it is not fixed, some apps will require a redesign, while
others may no longer be viable.
With this in mind, it would be very useful to get answers to any of
the following questions:
- What is YouTube's priority for this bug?
- Has the root cause been identified?
- Can the problem be fixed in YouTube's code, or does it require
Apple to make some changes?
- If Apple would have to make some changes, has this been brought to
their attention?
- If the problem can be fixed in YouTube's code, would it be
possible to get an ETA for a fix?
If not, can we get an ETA for an ETA, please? :)
We understand that YouTube has its own priorities and that
everything takes time, but some more visibility into the process would
be greatly appreciated...
Thanks in advance.
je...@google.com <je...@google.com> #19
Sorry for the lack of public updates—the engineering team has been experimenting to figure out what can be done to the iframe player's code to improve iOS 7 compatibility. This includes fixing autoplay functionality (assuming mediaPlaybackRequiresUserAction = NO) and reducing the number of taps it takes to start non-autoplays.
I unfortunately still don't have any specific progress to report.
I unfortunately still don't have any specific progress to report.
av...@gmail.com <av...@gmail.com> #20
Thanks for the update. Please keep us posted!
do...@gmail.com <do...@gmail.com> #21
Similar issue with iOS7. This is critical for my application. Hope youtube team would respond soon.
jj...@gmail.com <jj...@gmail.com> #22
Hi,
Just figured out that you can force the player to start if you wrap your playVideo() call in an interval...
var playerReadyInterval;
var disablePlayerReadyInterval;
// 4. The API will call this function when the video player is ready.
function onPlayerReady(event) {
playerReadyInterval = window.setInterval(function(){
player.playVideo();
}, 1000);
disablePlayerReadyInterval = window.setInterval(function(){
if (player.getCurrentTime() < 1.0) {
return;
}
// Video started...
window.clearInterval(playerReadyInterval);
window.clearInterval(disablePlayerReadyInterval);
}, 1000);
}
Not very clean, but doesn't matter.. it just work
Just figured out that you can force the player to start if you wrap your playVideo() call in an interval...
var playerReadyInterval;
var disablePlayerReadyInterval;
// 4. The API will call this function when the video player is ready.
function onPlayerReady(event) {
playerReadyInterval = window.setInterval(function(){
player.playVideo();
}, 1000);
disablePlayerReadyInterval = window.setInterval(function(){
if (player.getCurrentTime() < 1.0) {
return;
}
// Video started...
window.clearInterval(playerReadyInterval);
window.clearInterval(disablePlayerReadyInterval);
}, 1000);
}
Not very clean, but doesn't matter.. it just work
hu...@gmail.com <hu...@gmail.com> #23
Any updates on this issue?
- there are thousands of developers tearing their hair out over this
- there are thousands of developers tearing their hair out over this
av...@gmail.com <av...@gmail.com> #24
Jeremy, thanks for sharing your findings! I hope YouTube can use the information to roll out a fix/workaround.
z5...@gmail.com <z5...@gmail.com> #25
Jeremy thank you so much!!! your code is working well on ios7 :)
ya...@gmail.com <ya...@gmail.com> #26
It works but player stays black....
th...@gmail.com <th...@gmail.com> #27
an...@gmail.com <an...@gmail.com> #28
#26
this thread is partially correct about the issue on IOS7.
Yes, autoplay never worked, thats fine, but the problem on IOS 7 is what #1 describes:
Under iOS 7, the video momentarily transitions to a playing state, then back to buffering, then to playing, then back to buffering.
Open this link below on IOS7 and try, video will not start after you click play:
https://developers.google.com/youtube/youtube_player_demo
you need to either click multiple times (like 3 ?) or swap the screen after you click play.
this is broken and it needs to be fixed.
on IOS6 video started playing just fine after you clicked play fort he first time.
this thread is partially correct about the issue on IOS7.
Yes, autoplay never worked, thats fine, but the problem on IOS 7 is what #1 describes:
Under iOS 7, the video momentarily transitions to a playing state, then back to buffering, then to playing, then back to buffering.
Open this link below on IOS7 and try, video will not start after you click play:
you need to either click multiple times (like 3 ?) or swap the screen after you click play.
this is broken and it needs to be fixed.
on IOS6 video started playing just fine after you clicked play fort he first time.
je...@google.com <je...@google.com> #29
Hello Folks—A brief update. Some changes recently rolled out that should at the minimum reduce the number of taps needed to start a video, and should also address some of the other issues related to starting playback on iOS 7.
It would be much appreciated if folks could give their applications another test and report back whether there are still specific problems that need to be resolved (just point me to the update # on this bug if it's something you've previously reported and are still seeing).
Thanks!
It would be much appreciated if folks could give their applications another test and report back whether there are still specific problems that need to be resolved (just point me to the update # on this bug if it's something you've previously reported and are still seeing).
Thanks!
do...@gmail.com <do...@gmail.com> #30
[self.videoWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.youtube.com/embed/%@?enablejsapi=1&rel=0&playsinline=1&autoplay=1 ",self.detailLabelContents.videoId]]]];
Tried this and the video didn't play automatically. Am I doing some thing wrong?
Tried this and the video didn't play automatically. Am I doing some thing wrong?
cy...@gmail.com <cy...@gmail.com> #31
Now, autoplay works in ios7, thank you!
But other issue.
When video is stopped (because of no buffer), and resume playback,
player.getPlayerState() return "paused (2)" for a while in spite of video is playing.
I hope this issue will be fixed.
#29
please try #13. It's works.
But other issue.
When video is stopped (because of no buffer), and resume playback,
player.getPlayerState() return "paused (2)" for a while in spite of video is playing.
I hope this issue will be fixed.
#29
please try #13. It's works.
je...@google.com <je...@google.com> #32
Re: #29, you're not supposed to be able to load an iframe embed URL directly into a UIWebView and have it behave properly. The iframe embed URL is meant to be the src= of an iframe element.
Additionally, as mentioned in #13, you need to use webView.mediaPlaybackRequiresUserAction = NO; in order to get automatic playback to function—this is a requirement that dates back to before iOS 7.
Re: #30, could you please file a separate bug (or point us to an existing bug) regarding the getPlayerState() behavior you describe? I'd like to close out this bug once I can confirm that the bugs related to starting playback are resolved.
Additionally, as mentioned in #13, you need to use webView.mediaPlaybackRequiresUserAction = NO; in order to get automatic playback to function—this is a requirement that dates back to before iOS 7.
Re: #30, could you please file a separate bug (or point us to an existing bug) regarding the getPlayerState() behavior you describe? I'd like to close out this bug once I can confirm that the bugs related to starting playback are resolved.
cy...@gmail.com <cy...@gmail.com> #33
#31
OK, Thank you for fixing autoplay!
OK, Thank you for fixing autoplay!
st...@gmail.com <st...@gmail.com> #34
Autoplay working for me. I have an issue when I rotate the video, the player starts buffering. There's no image, just quicktime logo. Strange thing is this only happens with iPhone 5 and not iPhone 4. Any ideas why?
ji...@gmail.com <ji...@gmail.com> #35
[Comment deleted]
je...@google.com <je...@google.com>
ad...@gmail.com <ad...@gmail.com> #36
I still seem to be experiencing this issue. When I call the playVideo function the video will initially buffer for about half a second and then go to a black youtube window. If I click the video it will show the video title and youtube share/info bar at the top. But will never start, no matter how many clicks are performed(on my button or the youtube iframe). I get the exact same problem using https://developers.google.com/youtube/youtube_player_demo so I cant see it as a problem with my code.
vo...@knyt.tl <vo...@knyt.tl> #37
The issue seems not to be resolved: following example still does not work on iOS:
http://yt.goout.cz/test.html
vo...@knyt.tl <vo...@knyt.tl> #38
I also tried the hack of jeremy.l...@hotmail.fr, but id did not help.
ad...@gmail.com <ad...@gmail.com> #39
Any updates on this, why is the status marked as fixed - it isn't!
je...@google.com <je...@google.com> #40
Re: #37, the example at http://yt.goout.cz/test.html is not going to work within iOS Safari directly, because autoplay is not supported in random web pages.
The only way to get autoplay to work is to embed the player within a UIWebView in an application, and set
webView.mediaPlaybackRequiresUserAction = NO;
The only way to get autoplay to work is to embed the player within a UIWebView in an application, and set
webView.mediaPlaybackRequiresUserAction = NO;
[Deleted User] <[Deleted User]> #41
I understand, but why it does not give any error, nor there is no way to handle the situation. I suppose, it should show the play button instead of getting stuck.
ad...@gmail.com <ad...@gmail.com> #42
I am not trying to use autoplay, and that is not what this thread was about. The issue is the playVideo() function of the youtube api not working with iOS7. When can we expect this issue to be resolved?
je...@google.com <je...@google.com> #43
There's no functional difference between autoplay and scripted playVideo() calls without the user first interacting with the <video> element—they both achieve the same thing, and they're both blocked by Apple in iOS Safari.
vo...@knyt.tl <vo...@knyt.tl> #44
As I said, I completely understand that, but the player should not get stuck in the loading state. It should rather show the "PLAY" symbol to give the user possibility to play the video manually.
je...@google.com <je...@google.com> #45
I've passed along the request to handle this more gracefully, i.e. by triggered onError. I don't know if it's possible, though, as it might be difficult for the Player JavaScript to detect playbacks that were blocked by iOS Safari.
av...@gmail.com <av...@gmail.com> #46
I just started seeing a potentially-related behavior on iPhone hardware/simulator running iOS 7 -- the iframe player plays fullscreen even if it was configured to play inline. The behavior can be reproduced with the YoutubeAutoplayTest.zip file from the original bug report.
Below is the video tag generated by the iframe api -- I believe it is missing the 'webkit-playsinline' attribute.
On a related note, have YouTube considered supporting some loose versioning for the iframe player API?
I think it would be useful to have the notion of 'stable' and 'latest' versions. Deployed applications could point to the 'stable' version, and developers would get a chance to give feedback on 'latest' versions before they were declared to be 'stable'...
<video class="video-stream html5-main-video" controls="true"
x-webkit-airplay="allow" data-youtube-id="y84oAUjA8ms" title="X-47B
First "Trap" NAS Pax River"
src="http://r18---sn-o097zne7.googlevideo.com/videoplayback?ratebypass=yes&sver=3&mt=1385496489&expire=1385522090&key=yt5&id=cbce280148c0f26b&mv=m&sparams=id%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&ipbits=0&ip=50.76.61.185&itag=18&fexp=907723%2C933300%2C914504%2C939920%2C909717%2C936912%2C936910%2C923305%2C936913%2C907231%2C907240&ms=au&source=youtube&upn=pNT8uDi53I8&cpn=LfSiiDHFeyi0bgpH&signature=310C0A630D59DEBD1BF531C4B318CEFFCB18D72B.539D9C5756D6428269CEC2C058BD6D5E3D58BBFD&ptk=airboyd%252Buser&oid=Hb401im5zLn5RRj-ogiamw&ptchn=lyDDqcDsXp3KQ7J5gyIMuQ&pltype=content "
style="width: 240px; height: 320px; left: 0px; top: 0px;
-webkit-transform: none;"></video>
Below is the video tag generated by the iframe api -- I believe it is missing the 'webkit-playsinline' attribute.
On a related note, have YouTube considered supporting some loose versioning for the iframe player API?
I think it would be useful to have the notion of 'stable' and 'latest' versions. Deployed applications could point to the 'stable' version, and developers would get a chance to give feedback on 'latest' versions before they were declared to be 'stable'...
<video class="video-stream html5-main-video" controls="true"
x-webkit-airplay="allow" data-youtube-id="y84oAUjA8ms" title="X-47B
First "Trap" NAS Pax River"
src="
style="width: 240px; height: 320px; left: 0px; top: 0px;
-webkit-transform: none;"></video>
mo...@gmail.com <mo...@gmail.com> #47
Hi all, I experience the same issue. the playVideo() function is not available on iOS7. Please keep us informed when you solve this.
vo...@knyt.tl <vo...@knyt.tl> #48
ad #45 – this would be brilliant. I suppose all the future developers would not be surprised by the iOS behaviour. At least you could try to detect the device and then forbid call to playVideo.
sa...@gmail.com <sa...@gmail.com> #49
Please reopen this bug as it is not fixed. For a simple test, please visit jsfiddle.net/wrxpm on a non-ios7 device and your ios7 device. On the ios7 device, the video will not play.
st...@gmail.com <st...@gmail.com> #50
Looks like playsinline quit working. I'm using the parameter playsinline=1. My video auto plays fullscreen 100% of the time. Did something change? I know this was undocumented, but it's been working until today.
ra...@gmail.com <ra...@gmail.com> #52
HI,
I am also facing the same issue on iframe api on iOS ( i am on iOS6 ).
This was working till day before yesterday ( I did not check yesterday, so not sure when it started failing).
I did remove playsinline but no success.
added autofullscreen , changed value - no success.
I am also facing the same issue on iframe api on iOS ( i am on iOS6 ).
This was working till day before yesterday ( I did not check yesterday, so not sure when it started failing).
I did remove playsinline but no success.
added autofullscreen , changed value - no success.
ra...@gmail.com <ra...@gmail.com> #53
HI,
Our app is down, Please help ASAP.
Please share if there is any change on the API recently
Our app is down, Please help ASAP.
Please share if there is any change on the API recently
ra...@gmail.com <ra...@gmail.com> #54
Hey,
Any Updates on the issue, may we know cause of this happening from Jan 09 .
Any Updates on the issue, may we know cause of this happening from Jan 09 .
st...@gmail.com <st...@gmail.com> #55
Everything has been working for me now, but is there anyway to hide the new red play button?
al...@exeter.ac.uk <al...@exeter.ac.uk> #56
After looking on many forums and trying to simulate interaction.
I found the best way was to use cueVideoById(ID) then if it wasn't IOS or they had already interacted with the video (i.e. played another one before hand) I would run playVideo()
It works nicely and it's quite obvious to the user they have to click play..but only on the first selection.
Cheers.
I found the best way was to use cueVideoById(ID) then if it wasn't IOS or they had already interacted with the video (i.e. played another one before hand) I would run playVideo()
It works nicely and it's quite obvious to the user they have to click play..but only on the first selection.
Cheers.
tp...@gmail.com <tp...@gmail.com> #57
I have the same problem for some mobile device (IOS). Could you help me?
kf...@gmail.com <kf...@gmail.com> #58
Same issue here. Video just stays in the loading state. Spinning progress indicator never results in video playback!
Please help!
Please help!
jo...@gmail.com <jo...@gmail.com> #59
Seems like this defect still exists. Calling playVideo() doesn't work. Can we get some help with this please?
tr...@gmail.com <tr...@gmail.com> #60
I am still seeing this issue as well. Can we get this reopened?
ma...@gmail.com <ma...@gmail.com> #61
This should be fixed ASAP! (please)
ma...@gmail.com <ma...@gmail.com> #62
This isn't fixed yet.
lo...@gmail.com <lo...@gmail.com> #63
We're blocked due to this defect.
ma...@gmail.com <ma...@gmail.com> #64
To fix the issue on a hybrid app with a webview we did the following:
self.webView.mediaPlaybackRequiresUserAction = NO;
self.webView.allowsInlineMediaPlayback = YES;
This allows us to use playVideo() now on the hybrid app, however it still doesn't work when the webpage is accessed from safari.
self.webView.mediaPlaybackRequiresUserAction = NO;
self.webView.allowsInlineMediaPlayback = YES;
This allows us to use playVideo() now on the hybrid app, however it still doesn't work when the webpage is accessed from safari.
al...@exeter.ac.uk <al...@exeter.ac.uk> #65
Hi all -
Why don't you use cueVideoById(id) instead. It then matches IOS7 requirements and is standard functionality for the user.
I am using it all the time now and people are happy.
Thanks
Ally
Why don't you use cueVideoById(id) instead. It then matches IOS7 requirements and is standard functionality for the user.
I am using it all the time now and people are happy.
Thanks
Ally
li...@gmail.com <li...@gmail.com> #66
This is my code :
NSString *youtubeHTML = [[NSString alloc] initWithFormat:@"\
<html><head>\
<style type=\"text/css\">\
body { background-color: transparent;\
color: white; \
}\
</style>\
</head><body style=\"margin:0\">\
<iframe class=\"youtube-player\" width=\"1000\" height=\"600\" src=\"http://www.youtube.com/embed/%@?&feature=em-upload_owner\ " frameborder=\"0\" allowfullscreen=\"true\"></iframe>\
</body></html>", videoID];
[webv_video loadHTMLString:youtubeHTML baseURL:nil];
SAFE_RELEASE(youtubeHTML);
It not play youtube . Why ? Help me !
NSString *youtubeHTML = [[NSString alloc] initWithFormat:@"\
<html><head>\
<style type=\"text/css\">\
body { background-color: transparent;\
color: white; \
}\
</style>\
</head><body style=\"margin:0\">\
<iframe class=\"youtube-player\" width=\"1000\" height=\"600\" src=\"
</body></html>", videoID];
[webv_video loadHTMLString:youtubeHTML baseURL:nil];
SAFE_RELEASE(youtubeHTML);
It not play youtube . Why ? Help me !
ko...@gmail.com <ko...@gmail.com> #67
alastair,
Can you give an example of using cueVideoByID that works with iOS7? I haven't been successful using it.
Thanks,
Kory
Can you give an example of using cueVideoByID that works with iOS7? I haven't been successful using it.
Thanks,
Kory
sc...@ya.ru <sc...@ya.ru> #68
I've had same issue. And I've found the problem in my code. I've forgotten to set to YES property of the WebView mediaPlaybackRequiresUserAction.
al...@exeter.ac.uk <al...@exeter.ac.uk> #69
Have a look at my test page, click on Filter Results and then click on a thumbnail below. http://emps.exeter.ac.uk/uploads/yt/
The switch-over to cueByVideoId is done on screen size rather than checking the OS, I didn't realise Safari would have issues with it as well.
I hope that helps,
thanks
Ally
The switch-over to cueByVideoId is done on screen size rather than checking the OS, I didn't realise Safari would have issues with it as well.
I hope that helps,
thanks
Ally
ji...@gmail.com <ji...@gmail.com> #70
[Comment deleted]
ji...@gmail.com <ji...@gmail.com> #71
[Comment deleted]
ji...@gmail.com <ji...@gmail.com> #72
I have this working on a live app - the initial video loads and plays automatically, and new videos are loaded and played automatically using programmatic control. No issues on ios6 and ios7.
Some key code:
In Obj-C:
self.webView.mediaPlaybackRequiresUserAction = NO;
self.webView.allowsInlineMediaPlayback = YES;
In the javascript on the website that gets loaded:
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '390',
width: '640',
videoId: '0aPSf3Z8Q5A',
events: {
'onReady': onPlayerReady
},
playerVars: {
'playsinline':'1'
}
});
}
function onPlayerReady(event) {
event.target.playVideo();
}
function playNewVideo(obj) {
player.seekTo(0);
player.stopVideo();
player.clearVideo();
player.loadVideoByID(obj);
}
Some key code:
In Obj-C:
self.webView.mediaPlaybackRequiresUserAction = NO;
self.webView.allowsInlineMediaPlayback = YES;
In the javascript on the website that gets loaded:
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '390',
width: '640',
videoId: '0aPSf3Z8Q5A',
events: {
'onReady': onPlayerReady
},
playerVars: {
'playsinline':'1'
}
});
}
function onPlayerReady(event) {
event.target.playVideo();
}
function playNewVideo(obj) {
player.seekTo(0);
player.stopVideo();
player.clearVideo();
player.loadVideoByID(obj);
}
mc...@gmail.com <mc...@gmail.com> #73
#72 --- I tried that and it didnt work --- copy and pasted your code --- simply just stays black on iOS mobile browser
re...@gmail.com <re...@gmail.com> #74
#72 - same thing here. Doesn't work, screen stays black.
st...@gmail.com <st...@gmail.com> #75
My player is now pushed up in my app. Everything works however there's a black bar about 20px under each video once it starts playing.
This API breaks about every 2 weeks. Where would be an appropriate place to suggest google uses a beta/dev and a production build of this api?
This API breaks about every 2 weeks. Where would be an appropriate place to suggest google uses a beta/dev and a production build of this api?
ni...@gmail.com <ni...@gmail.com> #76
This is NOT fixed!
Please go on a IOS7 device to:https://developers.google.com/youtube/youtube_player_demo?hl=nl
Choose option autoplay - and see for yourself!
also the play api function doesn't work - your screen turns black.
Please go on a IOS7 device to:
Choose option autoplay - and see for yourself!
also the play api function doesn't work - your screen turns black.
[Deleted User] <[Deleted User]> #77
I know everyone here is addressing ios7 but the issue is happening on my site not only for ios7 but also on Android 4.4, browser independent. I'm not sure if that will help the developers but it's worthwhile to note.
Also, I've found it interesting that if a user starts playing the video by clicking on the video (as opposed to a playVideo() API call) all following API calls play, pause etc. work just fine.
A simple jsfiddle allows for easy testing:http://jsfiddle.net/jlmcdonald/dEjXL/
Also, I've found it interesting that if a user starts playing the video by clicking on the video (as opposed to a playVideo() API call) all following API calls play, pause etc. work just fine.
A simple jsfiddle allows for easy testing:
ni...@gmail.com <ni...@gmail.com> #78
I agree with #77 and have the same experience.
I now detect if users are on a mobile device - and if so I ask them to start the frist video manually.
Afterwards you can control the api with javascript.
The limitation is to prevent great bandwidth use on mobile devices without the user having authorised the playing of the videos...
Thanks
Karsten
I now detect if users are on a mobile device - and if so I ask them to start the frist video manually.
Afterwards you can control the api with javascript.
The limitation is to prevent great bandwidth use on mobile devices without the user having authorised the playing of the videos...
Thanks
Karsten
ch...@gutensite.com <ch...@gutensite.com> #79
We embed the video via iframe, and then use javascript to reveal the div that contains our iframe and also make it play via the API call. However, on iOS the area is just black.
Example:http://www.3708colet.com
BUT, if you notice the top left corner of that video area, there is a 1px by 1px white square. This is the <video> tag in the iframed page. If you click that pixel, it actually loads and launches the video...
So it appears that youtube is making that video 1px for some reason.
Example:
BUT, if you notice the top left corner of that video area, there is a 1px by 1px white square. This is the <video> tag in the iframed page. If you click that pixel, it actually loads and launches the video...
So it appears that youtube is making that video 1px for some reason.
ch...@gutensite.com <ch...@gutensite.com> #80
I confirmed that my comment #79 is also broken similarly on Android. Only I don't see a white square in the top left, and clicking there does not play anything (so it's more broken). Can't blame Apple for this one.
te...@gmail.com <te...@gmail.com> #82
I would also like to confirm this bug. The playVideo() call to a player does not work (unless playback has been initiated via the standard play button). This is a real show stopper for the development of our webapp. If anyone at Google is watching this, can you please look into this? As this has been an issue for a very long time...
Thank you
J.J. Prins
Thank you
J.J. Prins
te...@gmail.com <te...@gmail.com> #83
P.S. I should add that it concerns a non native HTML5 application and the problems occur on iOS 7 for iPad.
ne...@gmail.com <ne...@gmail.com> #84
I am having this issue on iOS 7 in mobile Safari. Any workarounds?
st...@gmail.com <st...@gmail.com> #85
Totally not fixed in IO7 IPhone 4s works with no code change in IOS6. Here is my stackoverflow explenation with pictures.. http://stackoverflow.com/questions/22283514/getting-html5-youtube-player-to-fit-in-a-xcode-webview . Like some here im getting a "much" larger video than 1x1 pix. Could this somehow be hardware related? I haven´t tried this on e.g IPhone 5...
ar...@gmail.com <ar...@gmail.com> #86
any solutions?? just want to make a custom play button/image to launch the video. jesus..
st...@gmail.com <st...@gmail.com> #87
A call out to please fix this issue.
mo...@gmail.com <mo...@gmail.com> #88
Still not fixed under iOS 8.1
jm...@gmail.com <jm...@gmail.com> #89
Any fix for this yet?
ts...@gmail.com <ts...@gmail.com> #90
Check the Mobile Considerations on this page : https://developers.google.com/youtube/iframe_api_reference#Mobile_considerations
"Warning: To prevent unsolicited downloads over cellular networks at the user’s expense, embedded media cannot be played automatically in Safari on iOS — the user always initiates playback."
So, make sure you only cue the videos and let the user press the play button on the video and everything works fine.
"Warning: To prevent unsolicited downloads over cellular networks at the user’s expense, embedded media cannot be played automatically in Safari on iOS — the user always initiates playback."
So, make sure you only cue the videos and let the user press the play button on the video and everything works fine.
ay...@gmail.com <ay...@gmail.com> #91
Hi, why the status is fixed?
It always doesn't work on IOS and Chrome mobile (aren't they 2 Google products?!?).
Could you fix it please?
Thanks in advance.
BR
It always doesn't work on IOS and Chrome mobile (aren't they 2 Google products?!?).
Could you fix it please?
Thanks in advance.
BR
ay...@gmail.com <ay...@gmail.com> #92
Not fixed.
There's always a bug in Youtube APi which is not working with some browsers.
There's always a bug in Youtube APi which is not working with some browsers.
pr...@pranapps.com <pr...@pranapps.com> #93
Still not working in iOS 8.1 onwards. Issue has been marked fixed but it's still not
ad...@gtempaccount.com <ad...@gtempaccount.com> #94
Can confirm that playVideo() is not working in iOS 8.3 (12F69)
ad...@gtempaccount.com <ad...@gtempaccount.com> #95
Also broken in iOS 9.02
je...@gmail.com <je...@gmail.com> #96
Correct me if I'm wrong, but I was just experiencing this issue and found that playVideo works as long it is called on a DIRECT touch press. It won't even work if you are calling it from a passed function (meaning you can't have your touch event call a function that calls another function that calls playVideo).
on...@gmail.com <on...@gmail.com> #97
I used IOS 9. My code is -
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api ";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// 3. This function creates an <iframe> (and YouTube player)
// after the API code downloads.
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('playerdiv', {
height: '410',
width: '100%',
videoId: 'y84oAUjA8ms',
playerVars: { 'autoplay': 1, 'controls': 1, 'playsinline':0 },
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
// 4. The API will call this function when the video player is ready.
function onPlayerReady(event) {
player.playVideo(); }
// 5. The API calls this function when the player's state changes.
// The function indicates that when playing a video (state=1),
// the player should play for six seconds and then stop.
var done = false;
function onPlayerStateChange(event)
{
}
But auto play not working in IOS 9. Please guide me. Also this is not working on Android Mobile. But auto play works when the website open from my computer.
Thanks,
Somsubhra
var tag = document.createElement('script');
tag.src = "
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// 3. This function creates an <iframe> (and YouTube player)
// after the API code downloads.
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('playerdiv', {
height: '410',
width: '100%',
videoId: 'y84oAUjA8ms',
playerVars: { 'autoplay': 1, 'controls': 1, 'playsinline':0 },
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
// 4. The API will call this function when the video player is ready.
function onPlayerReady(event) {
player.playVideo(); }
// 5. The API calls this function when the player's state changes.
// The function indicates that when playing a video (state=1),
// the player should play for six seconds and then stop.
var done = false;
function onPlayerStateChange(event)
{
}
But auto play not working in IOS 9. Please guide me. Also this is not working on Android Mobile. But auto play works when the website open from my computer.
Thanks,
Somsubhra
Description
Issue summary:
Under iOS 7, the iframe player API doesn't properly play videos. We hook into the onPlayerReady event, and fire the playVideo method like so:
function onPlayerReady(event) {
player.playVideo();
}
Under iOS 6 and earlier, this works just fine. Under iOS 7, the video momentarily transitions to a playing state, then back to buffering, then to playing, then back to buffering. Users must manually tap the play button to actually play the video.
Steps to reproduce issue:
I've create a sample XCode project exhibiting the problem. Run this under XCode 5 against an iOS 7 simulator or device. I am outputting the state changes, and you'll notice as it transitions between playing and buffering.
Expected output:
The video should commence playback.
Actual results:
The video does not playback.
Notes:
See attached.