Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 video - playing only a portion of a video

Is there some straightforward technique to play only a certain part of a HTML5 video? For example in a 30 second clip I would like to play only the part 5-20 sec. Additionally the rest of the video should not be accessible from the UI at all (meaning the video timeline should only show the 5-20 sec part).

I've been going through some HTML5 video players but none of them seem to be supporting this kind of functionality. If anyone knows a (good) way to implement this feature please give me a hint.

Thanks in advance!

like image 454
calle Avatar asked Apr 16 '12 12:04

calle


People also ask

Why video is not playing in HTML5?

This is not allowed for security reasons. Open the html file locally to view the video or upload the video to the server. Chrome will give this error: Not allowed to load local resource.

What is the correct HTML5 element for playing video?

<video>: The Video Embed element. The <video> HTML element embeds a media player which supports video playback into the document.

How do I make videos play automatically in HTML5?

Try autoplay="autoplay" instead of the "true" value. That's the documented way to enable autoplay.

Can HTML5 play video?

With the introduction of HTML5, you can now place videos directly into the page itself. This makes it possible to have videos play on pages that are designed for mobile devices, as plugins like Adobe Flash Player don't work on Android or iOS. The HTML <video> element is used to embed video in web documents.


1 Answers

Even though this question has already been marked as answered, here's something that may interest you and anyone else who stumbles across here: Specifying playback range.

It's part of the Media Fragment API and currently works in the latest versions of Firefox, Chrome and Safari 6+.

like image 146
Ian Devlin Avatar answered Sep 18 '22 15:09

Ian Devlin