Comments (15)
You can add a [playerView playVideo]; in the "- (void)playerViewDidBecomeReady:(YTPlayerView *)playerView" delegate method.
Best,
from youtube-ios-player-helper.
Bumping this :
extension YoutubePostDetailViewController: YTPlayerViewDelegate {
func playerViewDidBecomeReady(playerView: YTPlayerView) {
self.playerView.playVideo()
}
}
Still not working, how did you guys managed to get the delegate to work?
playerViewDidBecomeReady is actually never called
from youtube-ios-player-helper.
Oh, dunno how i missed that, must be a regression, thanks though
from youtube-ios-player-helper.
Thanks for the Quick reply @Kowaio
from youtube-ios-player-helper.
if you are using the version of code here in the repository (and not the one in cocoa pods), the correct way would be to pass @"autoplay" : @1 as part of the playerVars dictionary when loading the player as
NSDictionary *playerVars = @{
@"playsinline":@1,
@"controls" : @0,
@"autoplay" : @1,
@"showinfo" : @0,
@"modestbranding" : @1,
@"rel" : @0
};
[self.player loadWithVideoId:@"dtJScNZ4v20" playerVars:playerVars];
from youtube-ios-player-helper.
samiq, your above code does not work for me even with the current version
from youtube-ios-player-helper.
@samiq This issue is also happening to me ("autoplay" set to 1 not working). I'm using version 0.1.4 via CocoaPods.
I had to resort to implementing a delegate method as a workaround:
func playerViewDidBecomeReady(playerView: YTPlayerView!) {
playerView.playVideo()
}
from youtube-ios-player-helper.
Bumping this, autoplay not working in xcode 7.3.1, pod version 0.1.6 in swift.
ViewController has the delegate with the playVideo() set.
ViewController has the parameters correctly passed to the player :
let playerVars = ["playsinline": 1, "autoplay": 1, "autohide": 1, "controls" : 0, "showinfo" : 0, "modestbranding" : 1, "rel" : 0] self.playerView.loadWithVideoId("FUVj61gruwg",playerVars: playerVars)
from youtube-ios-player-helper.
This is working fine
-(void) playerViewDidBecomeReady:(YTPlayerView* )playerView {
[self.playerView playVideo];
}
from youtube-ios-player-helper.
The workaround works fine, but this should be documented. The autoplay
parameter is useless.
from youtube-ios-player-helper.
Probably a limitation of uiwebview/safari. The autoplay param simply gets handed off to JS code that is not allowed to autoplay a video in the browser except under iOS 10 and then only if it's silent.
from youtube-ios-player-helper.
Maybe HTML5 <video>
didn't support autoplay. https://developers.google.com/youtube/iframe_api_reference#Autoplay_and_scripted_playback
see Mobile Considerations
from youtube-ios-player-helper.
@tirrorex In YoutubePostDetailViewController
ytplayer.delegate = self
It is called after loading a video.
According to apple, some of video player's autoplay
property doesn't work.
This is to prevent the case where the playback continues and the packet communication fee is charged if the sound is silent and the user is not aware.
from youtube-ios-player-helper.
I set "end" parameter key to value '4700' but it doesn't effect. How can i achieveset time Youtube Video. please help me .
from youtube-ios-player-helper.
How can i set time for youtube video?
from youtube-ios-player-helper.
Related Issues (20)
- A Quality Video of Streaming Youtube's Video Not Properly
- Crash: [AVPlayerController boolValue]: unrecognized selector sent to instance
- YouTubeiOSPlayerHelper - When calls the 'Load' method (Xcode 14.2 - Target iOS 15)
- https://youtu.be/kXz8mD3Q_Lk
- youtube-ios-player-helper multiple audio selection
- Give us the bulk like functionality YOUTUBE!
- YouTube
- Youtube playsinline does not work for iPad
- It will lead App crash after update xcode
- YouTube
- Live label not showing on player for iphone.
- memory issue
- Fix Nullabilty warnings: Implicit conversion from nullable pointer 'X' to non-nullable pointer type 'Y' HOT 1
- Infinite loader when trying to play video
- WebKit`WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen App Crash
- i'm HOT 2
- Privacy manifest HOT 1
- Memory leak issue when calling StopViedo()
- Youtube
- Collapse the parent view of YTPlayerView when picture in Picture is enabled
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from youtube-ios-player-helper.