question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`GetMediaStreamAsync` To handle Youtube stuff?

See original GitHub issue

GetMediaStreamAsync that would handle rate limiting for me?

It took me 2 hours until it occured to me to check how DownloadMediaStreamAsync works.

I would like to get a stream that handles all the Youtube “shenanigans” for me, because right now to make my stream work I would have to basically copy DownloadMediaStreamAsyc code, instead of reusing it from this library?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Tyrrrzcommented, Mar 23, 2018

It would be really difficult to return a single stream that will run multiple HTTP requests behind the hood and I think in most use-cases it’s not worth it. However I added an overload for DownloadMediaStreamAsync that takes stream as an output (instead of file path), this way you can copy the contents to a stream at full speed, without allocating the video in memory. In your example, however, you would need to figure out a different way to use it, because the way it is you’ll still have a memory stream anyway, but at least now you won’t have to copy-paste the rate-bypass logic from YoutubeExplode.

1reaction
Tyrrrzcommented, Mar 23, 2018

Yeah you will have to clean up after yourself I guess, but you really shouldn’t load large binary files into RAM. I will do something to make it possible though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

After binding my stream to my broadcast using the Youtube ...
Ok so I got a working solution by adding two things: 1) bind my streamID to my ... const recordScreen = async ()...
Read more >
Unable to process age-restricted video · Issue #110
GetVideoAsync (id); // Get media stream info set MediaStreamInfoSet ... It seems that youtube can read info for restricted videos, ...
Read more >
Screen and Webcam Mixing and Recording with Web APIs
I'd like the recording process to be cheap, and I want the end result to have a ... list webcam devices const listWebcamDevices...
Read more >
Get started with WebRTC - web.dev
MediaStream API (also known as getUserMedia API) #. The MediaStream API represents synchronized streams of media. For example, a stream taken ...
Read more >
JS Tidbits - MediaStream API
Tiny post about tiny things - let's remind some basics of JavaScript and Web APIs ... async function getMedia() { const constraints =...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found