Spring Boot WebFlux - Video Streaming Example | JavaTechie

  Рет қаралды 59,973

Java Techie

Java Techie

Күн бұрын

Пікірлер: 141
@maheshsadashiv5606
@maheshsadashiv5606 Жыл бұрын
I always wondered how streaming videos worked. Thanks for the informative tutorial.
@cutesharwan
@cutesharwan 3 жыл бұрын
God bless you(Basant),to help us useful content.
@thahirThavvagunta
@thahirThavvagunta 3 жыл бұрын
Super super super.... 👌👌👌👌👏👏👏👏👏.... Interesting topics which makes anyone to explore spring boot more and more
@titanmtp4368
@titanmtp4368 3 жыл бұрын
Excellent topic. Please next topic for cdn and saga design patterns sir.
@sadiulhakim7814
@sadiulhakim7814 2 ай бұрын
what i was looking for. Thanks man
@mohamedaminnaimi2770
@mohamedaminnaimi2770 7 ай бұрын
Thanks for the simple and clear tutorial
@mohamedlarbisoufi6568
@mohamedlarbisoufi6568 3 жыл бұрын
it's amzing . we want a full tutorial about webflux with a real project to well practice
@zesment
@zesment 3 жыл бұрын
How is the range value used ? You get it from request header in the Controller, but it's never used in the Service
@stanewstanew
@stanewstanew 8 ай бұрын
Looks like everything is done by Resource class and video tag. The requests are handled then underneath by netty. This tutorial is not precise. So streaming is actually implemented in the lower level in netty. Definitely not in webflux controller.
@046_mech_prasadd5
@046_mech_prasadd5 2 ай бұрын
It will be handled internellay by ResourceHttpMessageWriter....there is a write method in that class which takes the range from request header public Mono write(Publisher
@046_mech_prasadd5
@046_mech_prasadd5 2 ай бұрын
ResourceHttpMessageWriter handles the request headers, checks for range requests, and writes the response based on the Resource provided. If a range request is present, it uses methods like writeResource and writeSingleRegion to write the appropriate parts of the resource to the HTTP response. ResourceLoader is used to load resources, while ResourceHttpMessageWriter is responsible for writing those resources to the HTTP response. They work together to efficiently serve resources, including handling range requests for streaming content like videos. If you have any more questions or need further clarification, feel free to ask!
@abhijitprusty
@abhijitprusty 3 жыл бұрын
Super this is interisting one, we usually see videos around webflux, but this is different...amazing..
@nirmesh44
@nirmesh44 3 жыл бұрын
Fantastic and deep knowledge i got from this video. Thanks
@damyandimitrov611
@damyandimitrov611 2 жыл бұрын
Fantastic explanation. Gives excellent basic knowledge on how to do it. Very good! Thank you for the lesson. I thought that it is much more difficult, but you made it so easy for us. Thank you, again!
@Javatechie
@Javatechie 2 жыл бұрын
Thanks buddy 😊
@oladimejijames9554
@oladimejijames9554 3 жыл бұрын
wow, thanks for this... now I understand video streaming after watching this.
@thineshn1321
@thineshn1321 3 жыл бұрын
Excellent ..! Awesome Content! Keep rocking ..!
@tech_talk05
@tech_talk05 3 жыл бұрын
Wow....Excellent Explanation...what a beautiful content...👏👏👏👏 Really Enjoyed it....it's so helpful n informative....through this channel you are continuously spreading your knowledge to everyone n helping us to grow...thanks a lot for your endless effort and dedication ....such a reliable and authentic channel for java.. .
@Javatechie
@Javatechie 3 жыл бұрын
Thanks Subhra 😊
@sreejithar450
@sreejithar450 3 жыл бұрын
Another awesome content. Thank you so much. In fact your channel had became my scrum team's reference bank
@Javatechie
@Javatechie 3 жыл бұрын
Waooo thanks buddy. Good to hear this
@vi.v.tsvetkoff
@vi.v.tsvetkoff 2 жыл бұрын
Why does the range header in logs have just start byte without end byte? At 14:35, for example, "bytes=7602176-", "bytes=7733248-", etc? Does the application send data from start byte to the end of file? Simply, if the first request "bytes=0-" will download the whole video?
@tiejeevan
@tiejeevan 3 жыл бұрын
Man you are java God. Thank you
@emvoinamdinh
@emvoinamdinh 3 жыл бұрын
Thanks so much Bro! i want to learn more from you !!!!
@raghavendraboddupalli1181
@raghavendraboddupalli1181 3 жыл бұрын
Excellent content Basanth..
@Talaria.School
@Talaria.School 3 жыл бұрын
Thanks techie. It's time to go into gradle Kotlin coroutines and spring boot the perfect mix.
@japanesetranslation4315
@japanesetranslation4315 3 жыл бұрын
Wow! nice video. Thank you.
@pritabratamallik5391
@pritabratamallik5391 3 жыл бұрын
Sir now that the demo is done. Could you please, show us how to fetch the video from a DB or a media server and then stream it?
@anuragduttachowdhury9440
@anuragduttachowdhury9440 3 жыл бұрын
For that you can use your own REST API based File Server. That can be another SpringBoot Application.
@letscode8018
@letscode8018 2 жыл бұрын
public Mono getVideoFromResource(long blobId){ VideoBlobFile videoBlobObj=videoBlobFileRepository.getReferenceById(blobId); String path=videoPath; if(OS.contains("win")){ path=videoPath; } String videoFileName=videoBlobObj.getVFile(); String videoFullPath=path+videoFileName; log.debug("filepath {}",videoFullPath); Resource res= new FileSystemResource(videoFullPath); return Mono.fromSupplier(()->res); } for file server you can use above code and for DB public Mono getVideo(long blobId){ VideoBlobFile videoBlobObj=videoBlobFileRepository.getReferenceById(blobId); byte[] videoBlob=videoBlobObj.getVBlob(); ByteArrayResource byteArrayResource=new ByteArrayResource(videoBlob); return Mono.fromSupplier(()->byteArrayResource.getByteArray()); }
@karansingh-eu5mg
@karansingh-eu5mg 3 ай бұрын
​@@anuragduttachowdhury9440 And then we have to use rest Template for that
@jitendrapandey176
@jitendrapandey176 3 жыл бұрын
Awesome Java techie 👏👏👏👏
@amitkharbade
@amitkharbade 3 жыл бұрын
Thanks for this tutorial🙏
@nagendrad9263
@nagendrad9263 3 жыл бұрын
Useful video sir ....Thank you 👏🏻👏🏻👏🏻👏🏻
@AshishYadav-se4db
@AshishYadav-se4db 3 жыл бұрын
Amazing content sir🔥🙏.
@RahulKumar-qu1if
@RahulKumar-qu1if 3 жыл бұрын
Very good content ☺️ sir.
@devashish_yt
@devashish_yt 3 жыл бұрын
Great content 👏... thank you
@VivekanandaReddyC
@VivekanandaReddyC 3 жыл бұрын
Very good content Basanth. One question, range is printing in the controller but how the stream is moving forward or backward without taking the range...
@Javatechie
@Javatechie 3 жыл бұрын
It's taking range from request header
@VivekanandaReddyC
@VivekanandaReddyC 3 жыл бұрын
@@Javatechie request header is having the range but we're not using it to move forward/backward
@vijayank923
@vijayank923 3 жыл бұрын
Nice example . Can you please add few more examples , 1. How can we load videos from cloud server (AWS, GCP, Azure) or from Kafka server 2. Please add more size video (1GB) 3. How can we retain watched hours for next same users next time
@niteshapte
@niteshapte 3 жыл бұрын
3. Client should log such data in DB with necessary data like user id, video id, etc. 2. I think it's not needed as this is streaming and not uploading. 1. Not 100 percent sure but queues maybe. But with WebFlux, queues are not needed as it is non-blocking, so chances data loss is rare to zero. I am also planning to build an OTT. You can contact me on FB Messenger. I am doing some R&D at the moment. Maybe we can help each other.
@vijayank923
@vijayank923 3 жыл бұрын
@@niteshapte thanks . I’m looking if user paused in middle, next time same user and video how to take user to in same place ( assume maintaining users last watched logs)
@niteshapte
@niteshapte 3 жыл бұрын
@@vijayank923 I think paused time can be read through video metadata or simply by reading video tag properties using javascript and then details can be saved in DB. Upon reopening, read the details and set the value in video tag in html.
@kambalavijay6800
@kambalavijay6800 3 жыл бұрын
Good content. However, I still have a question. Where is it specified to cal the rest endpoint in order to fetch Mono
@ogabeksaidov1986
@ogabeksaidov1986 3 жыл бұрын
Great 👍👍👍👍👍
@johncerpa3782
@johncerpa3782 3 жыл бұрын
Excellent, thank you
@fabricioaraujo7642
@fabricioaraujo7642 3 жыл бұрын
Wow thanks for your content man :) if could talk more about java streams api.
@Javatechie
@Javatechie 3 жыл бұрын
Can you please checkout my java 8 playlist all important stream context I already covered there .just check it out
@motolola
@motolola 3 жыл бұрын
Awesome video ...I am wondering how will it download in bits from ... say AWS S3 or any cloud media storage.
@anandsingh1011
@anandsingh1011 3 жыл бұрын
awesome topic
@RAJU9622
@RAJU9622 3 жыл бұрын
Amazing content
@pratishrutipanda6461
@pratishrutipanda6461 3 жыл бұрын
Nice content 😊
@TimVanMeerbeeck
@TimVanMeerbeeck 7 ай бұрын
If you are still reading these reactions: If you add Spring Security around your spring video endpoint. (let's say you need a JWT to access the endpoint) Can you still use the default HTML5 video tag with the src? Or how would you adapt the source tag? I am blocked by this at the moment. Anyway thanks for the video!
@zesment
@zesment 3 жыл бұрын
There is an error in the logs : java.io.IOException: An established connection was dropped by software on your host computer (something like that after translation in English) How can I manage this exception ?
@rahul-java-dev
@rahul-java-dev 3 жыл бұрын
Thank you Sir ❤❤
@juro804
@juro804 9 ай бұрын
Is providing video streaming with WebFlux appropriate? Wouldn't the performance suffer due to the ioWorkerThread being parked during I/O operations?
@simoneric
@simoneric 3 жыл бұрын
Awesome Content!
@SanjeevGhosh
@SanjeevGhosh Жыл бұрын
I would have really appreciated if you had shown where did you mention the 'range' header in the index.html file.
@Javatechie
@Javatechie Жыл бұрын
Please check in the script method call
@ridhamsood1784
@ridhamsood1784 11 ай бұрын
instead of storing videos locally can we store it in any cloud like aws s3 and does it same work by getting data in chunks rather then downloading whole video?
@Javatechie
@Javatechie 11 ай бұрын
Yes absolutely it will work with the same approach
@ridhamsood1784
@ridhamsood1784 11 ай бұрын
can you explain that i am trying to implement but unable to do that
@parthipanmurali4451
@parthipanmurali4451 3 жыл бұрын
Nice topic
@topfactland2120
@topfactland2120 11 ай бұрын
how does get request to 8080 returning index.html page do you have another controller ?
@Javatechie
@Javatechie 11 ай бұрын
Source code link share on description please check the code
@tiejeevan
@tiejeevan 3 жыл бұрын
I would appreciate you, if u could do more about this in detail like 1 hr video
@aadiraj6126
@aadiraj6126 3 жыл бұрын
Good one. But plz start spring, Oauth/jwt, spring boot, Microservices, etc interview qsn ...those are pending from ur side🙏
@Javatechie
@Javatechie 3 жыл бұрын
Jwt and oauth 2 already I covered please checkout in my channel
@hemoonegi6363
@hemoonegi6363 Жыл бұрын
what if i have multiple videos on my single tab? or multiple images?
@AshishRohillax
@AshishRohillax 2 жыл бұрын
How is the range value used ? You never called the rest endpoint as well then how it got executed ?
@Javatechie
@Javatechie 2 жыл бұрын
In javascript I called this range please checkout my source code
@rssaini01
@rssaini01 3 жыл бұрын
What is the use of Range request header?
@Javatechie
@Javatechie 3 жыл бұрын
Client will send byte range to Server using it
@rssaini01
@rssaini01 3 жыл бұрын
@@Javatechie how?? And if client can send the byte range to server then how server will handle this?
@anisam123
@anisam123 2 жыл бұрын
sir you did not use rage to load the video, so how was the video getting loaded using chunks?
@Javatechie
@Javatechie 2 жыл бұрын
Yes range will pass as part of headers
@thedragoncorpse6403
@thedragoncorpse6403 2 жыл бұрын
Hello SIr , i have my videos stored in my google cloud firestore , and i have a url for that video , how can i play that video directly in my spring boot application ,with the same functionalitiues that you have shown in the video, plz help
@sleepysquirlz7715
@sleepysquirlz7715 Жыл бұрын
this is a great video, but im trying to do this on an existing project i already have in intellij, and im trying to see if i can just insert this code into my already existing project. Would this work if i did that? because i got this video tutorial working but i can get it to work when i try to slide this code into my existing project?
@asam0997
@asam0997 3 жыл бұрын
Sir, any idea how to change video quality while Playing just like in KZbin we do?
@Javatechie
@Javatechie 3 жыл бұрын
Need to check Anmol . will update
@mohammadnayeemetp
@mohammadnayeemetp 3 жыл бұрын
Yes saga design patterns sir
@egi-og9ed
@egi-og9ed 2 жыл бұрын
Great, i have question how to integrate with reactjs? and is this possible to create live streaming video?
@mohammadsajeed370
@mohammadsajeed370 Жыл бұрын
but isn't it progressive downloading supported by browser's video tag by default?
@elasingh3151
@elasingh3151 3 жыл бұрын
I'm getting "no video with supported format and mime type found". Is this a browser issue? I tried on both Chrome and Firefox.
@Javatechie
@Javatechie 3 жыл бұрын
Did you specify produces and also make sure that in index.html you specified valid path to your video
@elasingh3151
@elasingh3151 3 жыл бұрын
@@Javatechie Thanks. It worked :)
@_ravi_kumar_gupta
@_ravi_kumar_gupta 3 жыл бұрын
Great great video. Can you please make a video on saga design pattern for microservice.
@Javatechie
@Javatechie 3 жыл бұрын
Yes I will do that
@kameshganeshan2894
@kameshganeshan2894 3 жыл бұрын
Also mention why the app runs on netty and not on tomcat. I know the reason but the crowd watching your tech blog would be keen to know.
@ashishsengar87
@ashishsengar87 2 жыл бұрын
Thanks! Nice video. Can you please tell what changes will be required in this demo to fetch the video from a video streaming link instead of local?
@simplifyvms215
@simplifyvms215 2 жыл бұрын
Can i know the request Header that you have used while doing the request
@m3jh
@m3jh 3 жыл бұрын
what would be the proper way for big audio files speaking of 500mb - 1gb of like 2-3 hours of audio files mp3 for instance to be streamed from some s3 or something? thanks.
@sandipmane3941
@sandipmane3941 3 жыл бұрын
Good.. Can we have same kind of thing.. If we have indexed large file on cloud... That I want to stream it... How we. Can approach this one.....
@Javatechie
@Javatechie 3 жыл бұрын
Get the content from cloud and render it in ui
@sandipmane3941
@sandipmane3941 3 жыл бұрын
@@Javatechie will this work to down load large image file on cloud.... Down load in chunks only..
@Javatechie
@Javatechie 3 жыл бұрын
It won't download entire content as I mentioned in video based on byte range it will get connect
@sovrinfo
@sovrinfo 2 жыл бұрын
Big thanks
@loknathkumar2369
@loknathkumar2369 3 жыл бұрын
Sir how can we add tag name filter in s3 bucket like giving specific tag name particular file in s3 must be fetched
@preethamumarani7363
@preethamumarani7363 3 жыл бұрын
tried this example of java 11, it works. just curious, is there any specific reason you used java 8 ?
@Javatechie
@Javatechie 3 жыл бұрын
No it will work on any version of java . I am more comfortable with jdk 8
@preethamumarani7363
@preethamumarani7363 3 жыл бұрын
@@Javatechie great thank you. Also, just a generic query, why many companies still have java 8 ? any specific benefits or just the migration concerns ?
@Javatechie
@Javatechie 3 жыл бұрын
@@preethamumarani7363 java 8 release change the world by supporting functional style coding and which is available in free called ooenjdk 8 but 11 is paid .
@zakariadaoudi1729
@zakariadaoudi1729 3 жыл бұрын
Thanks man A+++
@AVSOFT-fq1qm
@AVSOFT-fq1qm 8 ай бұрын
WHERE U CALLED THI API IN HTML PAGE
@sbshshendkar
@sbshshendkar 3 жыл бұрын
Java 8 stream is working like this?
@Javatechie
@Javatechie 3 жыл бұрын
This is reactive programming
@ning6434
@ning6434 2 жыл бұрын
Nice video, Do you know how can we play the video if the endpoint is secured by jwt? Thanks in advance
@Javatechie
@Javatechie 2 жыл бұрын
On top of this api you could add jwt validation
@ning6434
@ning6434 2 жыл бұрын
@@Javatechie But as we use the video tag in frontend how can we add the Bearer token to it?
@sivapriya3924
@sivapriya3924 2 жыл бұрын
Is there any possible way to stream video from s3 directly without downloading
@Javatechie
@Javatechie 2 жыл бұрын
Yes we can do that
@sivapriya3924
@sivapriya3924 2 жыл бұрын
@@Javatechie Any sample video
@angulardesign7412
@angulardesign7412 3 жыл бұрын
i am working on e-learning web app but thing is that user should not able to download video from my server how to prevent downloading ? Thanks for your video?
@codedestiny6955
@codedestiny6955 3 жыл бұрын
Thanks bro, how to do with resolutions bro ??
@exact-itacademy1282
@exact-itacademy1282 3 жыл бұрын
how to load videos from C driver ?
@Javatechie
@Javatechie 3 жыл бұрын
Give the absolute path of your file in index.html
@chiragmatta9171
@chiragmatta9171 3 жыл бұрын
Can you please make tutorial on reactive programing with Kafka and ActiveMQ
@sui2490
@sui2490 Жыл бұрын
why is java 8 used?
@sbshshendkar
@sbshshendkar 3 жыл бұрын
waiting for SAGA design patterns with messaging.
@Javatechie
@Javatechie 3 жыл бұрын
Will start buddy , parallely with kuhernetes
@sbshshendkar
@sbshshendkar 3 жыл бұрын
@@Javatechie thank you❤️
@tadurirk
@tadurirk 3 жыл бұрын
Super
@sreenureddy994
@sreenureddy994 3 жыл бұрын
its amazing
@CaptainDriftwood
@CaptainDriftwood 10 ай бұрын
thank you saar
@GameXplorers46
@GameXplorers46 3 жыл бұрын
Is it not possible without web flux or reactive programming??
@Javatechie
@Javatechie 3 жыл бұрын
Possible but not asynchronous
@muhammadsabirqadri8659
@muhammadsabirqadri8659 Жыл бұрын
please some one explain me how to add video inside videos folder. please help me.
@abinthomas12914
@abinthomas12914 3 жыл бұрын
Awesome
@sneak9407
@sneak9407 2 жыл бұрын
How about the video that gets the video from an actual database? You never released the video anymore.
@sneak9407
@sneak9407 2 жыл бұрын
Also I have a problem with my ranges. I can't seem to skip to a point in the video.
@sripriyanagaraju7019
@sripriyanagaraju7019 3 жыл бұрын
please write the code for live streaming/online streaming/broadcasting
@tadurirk
@tadurirk 3 жыл бұрын
Start spring webflux series
@tiejeevan
@tiejeevan 3 жыл бұрын
I worked in lot of companies, we are using CNET or other streaming services to get this functionality. I would really appreciate you if you could teach me more sir.
@naraharig1625
@naraharig1625 3 жыл бұрын
bro make video on splunk bro
@Javatechie
@Javatechie 3 жыл бұрын
Splunk is not opensource I believe
@starlordop2644
@starlordop2644 3 жыл бұрын
❤️❤️
@9703080696
@9703080696 3 жыл бұрын
Awesome
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
What is Spring Webflux and when to use it?
17:46
Defog Tech
Рет қаралды 246 М.
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Рет қаралды 1,3 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН