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 680 forks source link

player.loadVideo(byId: x, startSeconds: y) not working #430

Open Elamuruga opened 3 years ago

Elamuruga commented 3 years ago

@todd-patterson Video load by URL or ID not working while assigning with start and end seconds, If it is declared like player.load(withVideoId:x) means it's working fine. Could you please help me to resolve this?

ykws commented 2 years ago

@Elamuruga Hi, you can use the parameter of start in playerVars instead. For example, append , "@start" : @600 to the end of the following line,

https://github.com/youtube/youtube-ios-player-helper/blob/ff5991e6e3188867fe2738aa92913a37127f8f1d/Project/youtube-player-ios-example/youtube-player-ios-example/SingleVideoViewController.m#L25-L30

Do you expect it?

https://user-images.githubusercontent.com/5770480/135496216-c877b6a7-7063-4c0e-96fd-dee406d4e267.mp4

mvemjsun commented 1 year ago

Hi, it seems that it does not work even when you specify the "start" parameter. It just loads the video but does not begin playback.

let playerVars = [
"start": 1,
"rel": 1,
"modestbranding": 1,
"fs": 0,
"autoplay": 1 
]

...
load(withVideoId:playerVars:)