youtube / youtube-ios-player-helper

Lightweight helper library that allows iOS developers to add inline playback of YouTube videos through a WebView
Other
1.64k stars 681 forks source link

Video not loading if using loadVideoById function with startSeconds #398

Open mkumargupta opened 4 years ago

mkumargupta commented 4 years ago

Hi

Please check bottom line and it's not loading video if using it with startSeconds, It's working fine for simple id function. [self.playerView loadVideoById:videoId startSeconds:50.0];

Thanks

brol1dev commented 4 years ago

I cannot reproduce the issue on my end. Can you add more info?

Thank you!

marc-cram commented 3 years ago

I have exactly same issue with Xcode 12 on BigSur and IOS 14: just put a UIView in storyboard, Class to YTPlayerView and make code assignment to ViewController.swift

working code is: `import youtube_ios_player_helper import UIKit

class ViewController: UIViewController {

@IBOutlet var ytView: YTPlayerView!

override func viewDidLoad() super.viewDidLoas() ytView.load(withVideoId: "BXRMxgsarpM") }`

I get a empty view (or black screen as I set backgroundcolor of view to black) when using ytView.loadVideo(byId: "BXRMxgsarpM", startSeconds: 20.0) ytView.playVideo()

I did the pod install three days ago. Working great if want to have YT video view from the beginning. But I want to have it from a certain second. I also tried to set the startSeconds in playerVars but same behaviour.