Giter Site home page Giter Site logo

Comments (15)

Kowaio avatar Kowaio commented on August 12, 2024 4

You can add a [playerView playVideo]; in the "- (void)playerViewDidBecomeReady:(YTPlayerView *)playerView" delegate method.

Best,

from youtube-ios-player-helper.

tirrorex avatar tirrorex commented on August 12, 2024 2

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.

tirrorex avatar tirrorex commented on August 12, 2024 1

Oh, dunno how i missed that, must be a regression, thanks though

from youtube-ios-player-helper.

Bkishoresharma avatar Bkishoresharma commented on August 12, 2024

Thanks for the Quick reply @Kowaio

from youtube-ios-player-helper.

samiq avatar samiq commented on August 12, 2024

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.

acfriedman avatar acfriedman commented on August 12, 2024

samiq, your above code does not work for me even with the current version

from youtube-ios-player-helper.

neirar avatar neirar commented on August 12, 2024

@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.

tirrorex avatar tirrorex commented on August 12, 2024

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.

manish-ps avatar manish-ps commented on August 12, 2024

This is working fine

-(void) playerViewDidBecomeReady:(YTPlayerView* )playerView {
[self.playerView playVideo];
}

from youtube-ios-player-helper.

macecchi avatar macecchi commented on August 12, 2024

The workaround works fine, but this should be documented. The autoplay parameter is useless.

from youtube-ios-player-helper.

laposheureux avatar laposheureux commented on August 12, 2024

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.

MrBoog avatar MrBoog commented on August 12, 2024

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.

rinov avatar rinov commented on August 12, 2024

@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.

RemaliDas avatar RemaliDas commented on August 12, 2024

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.

RemaliDas avatar RemaliDas commented on August 12, 2024

How can i set time for youtube video?

from youtube-ios-player-helper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.