CreateObjectURL and RevokeObjectURL (Explained by Example)
Вставка
- Опубліковано 8 бер 2019
- 💻 More Software engineering videos • Software Engineering b...
In this video we will learn how to use CreateObjectURL and RevokeObjectURL to cache resources locally after loading them with the fetch url and using them locally, then finally releasing them after we are done by calling revoke.
As usual we will use Javascript since this code runs in the browser and we will load an image over the air using fetch api then we will cache the image locally using CreateObjectURL then set this image as resource. Finally, we will revoke the resource.
Source Code: github.com/hnasr/javascript_p...
Stay Awesome!
Hussein
I just discovered your channel and i already love it, your way of teaching is superb, despite i am not a native american speaker i understand every thing. thx!
You are my hero. This video saves my project.
Nice explanation. Finally, understand what it is after watching this
Expiation with
Thank you! This was quite useful!
This is useful, thanks a lot!!!!
You Rock my man,,, You litterally Burnt it, :v i need to learn a whole bunch. You inspire me
in eventlistener you could revoke the url first then blob another one to avoid memory leak. otherwise with each click the browser creates a new url which points to a new memory address even though the url variable changes to new one but the garbage collector wont delete it
Yeah that was great but what If I want to load image videos from server.Should I need to create blob out of url in client side or serverside and then send that to client
Here is a scenario. I want only the authorized user should be able to view the content(video). Can I pass the JWT token as a bearer header with fetch and get the link for the the authorized video. ...then following the same step above ??
Awesome
how can i do it, but with videos?? and not images?
u could get all imgs by querySelectorAll
almost all stackoverflow threads are old and wants you to use the FileReader api but this is much simpler
Any reason why revokeObjectURL doesn't do anything in Firefox? At least that's my situation
Do it with video tag please , how to RevokeObjectURL a video url ?
it doesn't work on mobile :/