4

I use the MediaElement.js HTML 5 Video Player and I want to add a Advertisement (like Youtube Add) over my Videos between the playing time (like: the add fadein at 0:20s and fadeout at 0:30s - add visible: 10s).

Did someone do something like this? thanks!

Kamil
  • 79
  • 7
  • I don't know this library but may be if you can obtain the actual time of the video playing with a method in js, you could place an absolute div infront(with z-index) of the video that can appear and disappear(display:none;block) with the actual time of the video. – Mark E Jul 19 '12 at 15:59

1 Answers1

2

One way would be to change the source of the video at currentTime 20s of the video, playing the 10sec Add and than changing back to the original source of the video.

Problem here is that anyone could move to the end of the add and skip it since people can just use the controls of the video tag.

Unless you know a way to block the controls this wouldn't be an optimal solution.

(Removing controls="controls" isn't a solution either since you can add it back trough inspector.)

Marcio
  • 612
  • 6
  • 20