Is there something I can add to a direct video URL to make it loop?

So if I have lorenipsum.com/test.mp4, can I modify it like so: lorenipsum.com/test.mp4?&loop=1 or some other append to make it loop?

32 points · 14 comments · view on lemmy.world

14 Comments

Serinus@lemmy.world · 13 pts · 2y (12 replies)

You can make a very simple html page that contains the video and do it there.

https://www.w3schools.com/tags/att_video_loop.asp

Assuming you can host html somewhere.

master5o1@lemmy.nz · 6 pts · 2y (1 reply)

Also, often can right click -> loop.

nooeh@lemmy.world · 1 pts · 2y

I know how to do this but I was hoping there was some way to build it into the url.

nooeh@lemmy.world · 1 pts · 2y (8 replies)

How about JavaScript which writes a simple html page. Any clue how I might go about that?

Serinus@lemmy.world · 6 pts · 2y (7 replies)

Javascript is overkill. Open a file on your desktop, name it whatever.html. Open it in notepad, put this in it. Save it, open it in your browser.

nooeh@lemmy.world · 3 pts · 2y (5 replies)

Lol I can understand what that does. The reason I am asking about JavaScript is that potentially I can use it like a url.

master5o1@lemmy.nz · 4 pts · 2y (4 replies)

data:html,

Might work.

Edit: stupid html stripping. Ugh.

data:html,

data:html,

Fine, a paste bin. https://txt.t0.vc/PDIP

nooeh@lemmy.world · 1 pts · 2y (3 replies)

Thank you so much!! Data URLs were exactly what I was looking for with a little modification! Apparently chrome doesn't allow looping with audio unless it meets certain strict criteria per google. Here is my final URL:

data:text/html,

master5o1@lemmy.nz · 1 pts · 2y (2 replies)

Cool. Can't see that data url. Use an image of pastebin like it did.

nooeh@lemmy.world · 1 pts · 2y

Ah the preview showed the html so I thought it would work.

Here is a pastebin: https://txt.t0.vc/CLMV

Scubus@sh.itjust.works · 1 pts · 2y

When does it delete system32?

0x4E4F@infosec.pub · 0 pts · 2y

It should't matter, it should loop even if it's just the html file locally opened with a browser.

FooBarrington@lemmy.world · 4 pts · 2y

I wrote a quick bookmarklet for you:

javascript: (() => document.querySelectorAll("video").forEach(video => video.loop = true))();

You can paste this into the URL bar (and press Enter to apply) or add it as a bookmark (and apply by clicking on the bookmark), it will make all video elements on the page loop automatically. Caveats:

  • It won't work if the video element is in a subframe (shouldn't be the case too often with normal pages)
  • Only works for HTML5 video elements
  • Custom controls might override the native loop, but they shouldn't