iBicha / UnityYoutubePlayer

Play YouTube videos in Unity
The Unlicense
336 stars 63 forks source link

How can i play FHD, UHD, 4K, 8K panoramic videos? #61

Open mhadji05 opened 3 years ago

mhadji05 commented 3 years ago

How can i play FHD, UHD, 4K, 8K panoramic videos?

In previous version i used this: var streamInfo = streamManifest.Video.LastOrDefault(s => s.VideoQualityLabel == "1080p60"

Now something changed. Please let me know..

iBicha commented 3 years ago

See

YoutubePlayer.PlayVideoAsync(string videoUrl = null, YoutubeDlOptions options = null, CancellationToken cancellationToken = default)

YoutubeDlOptions is an object to specify options passed to youtube-dl, such as format (quality) and user agent.

mhadji05 commented 3 years ago

Τo which script should I add this code to play a 1440s60 quality for 360 YouTube video for example?

iBicha commented 3 years ago

PlayVideoAsync is a method on the YoutubePlayer Monobehaviour

mhadji05 commented 3 years ago

I cant play 360 video in 4k quality.

Can you please write a script for different qualities or maybe update with example scene?

Thanks in advance!

iBicha commented 3 years ago

Thanks for the suggestion, I tagged this as a feature request (adding example scene with different qualities)

mhadji05 commented 3 years ago

It would be even more interesting if you could add the original feature of YouTube for auto quality setting depending on the speed of the internet connection.