Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mhadji05 opened this issue Jul 9, 2021 · 6 comments
Open

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

mhadji05 opened this issue Jul 9, 2021 · 6 comments

Comments

@mhadji05
Copy link

mhadji05 commented Jul 9, 2021

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
Copy link
Owner

iBicha commented Jul 9, 2021

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.

  • The default for regular videos is best which is the highest video quality with both video and audio streams (usually at 720p)
  • The default for 360 is bestvideo[height<=?1080] which is the highest video quality with only the video stream, and smaller or equal to 1080p.
  • If you want to specify higher qualities, you might to set [ext=mp4] (e.g. bestvideo[ext=mp4]) so you don't get a webm file which Unity video player will fail to load.
  • See format for more details.

@mhadji05
Copy link
Author

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

@iBicha
Copy link
Owner

iBicha commented Jul 27, 2021

PlayVideoAsync is a method on the YoutubePlayer Monobehaviour

@mhadji05
Copy link
Author

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
Copy link
Owner

iBicha commented Aug 8, 2021

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

@mhadji05
Copy link
Author

mhadji05 commented Aug 8, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants