How to play a video URL with the .m3u8 extension in the browser?

I have a video URL that ends with.m3u8, I don’t know how to play it in my web browser.

It seems that the video is in HLS (HTTP Live Streaming) format which is natively supported by the Safari browser only so if you are using the Safari web browser then you can directly play the video.
If you are using any other browser then you will need a web video player to play the video. You just need to write a few lines of HTML code and then load the HTML file into your browser and it will be able to play the video.
A few open-source video players are mentioned below.

  1. VideoJS
  2. Plyr

Thanks for your response!
Also, can you give a clue on how to play a video URL with the .mpd extension in the browser?

Sure!

Videos with MPEG-DASH (Dynamic Adaptive Streaming over HTTP) format are delivered with the .mpd extension.
You will not be able to play the video directly in any browser. You will need a web video player to play the video.
You just need to write a few lines of HTML code and then load the HTML file into your browser and it will be able to play the video.
A few open-source video players are mentioned below.

  1. DashJS
  2. Shaka Player

I hope now your query is resolved. If not, do let us know!
Thanks