How to add button overLay in Video Tag

Volatil3

I appended a div within video tag and used following CSS but it is not working. I already incorported javascript to play/stop video on click. I want to show a button in the middle of player. Something like this

#player_buttons
{
    width: 128px;
    height: 128px;
    z-index: 99;
    background: url('http://cdn1.iconfinder.com/data/icons/iconslandplayer/PNG/64x64/CircleBlue/Play1Pressed.png') center center no-repeat;
}
mhlzr

I don't think you can/should place content inside a video-element other than video-sources unless you want that content displayed in browsers that do not support the video-tag. Taken from the specs:

Content may be provided inside the video element; it is intended for older Web browsers which do not support video, so that legacy video plugins can be tried, or to show text to the users of these older browsers informing them of how to access the video contents

http://dev.w3.org/html5/spec-author-view/video.html#video

But by wrapping the video element with a container and appending the overlay-div to that container, you can stack them via position:absolute and z-index.

You can see the example here: http://jsfiddle.net/vtrzmf92/

Updated HTML:

<div class="container">
    <video src="#" width="800" height="600"></video>
    <div class="player-buttons"></div>
</div>

Updated CSS:

.container{
    position: relative;
}

.container>.player-buttons{
    background: url('http://cdn1.iconfinder.com/data/icons/iconslandplayer/PNG/64x64/CircleBlue/Play1Pressed.png') center center no-repeat;
    height: 128px;
    left: 50%;
    margin: -64px 0 0 -64px;
    position: absolute;
    top: 50%;
    width: 128px;
    z-index: 1; 
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

javascript how to add element dynamically to form tag using button

From Dev

Rails: How to add an empty 'required' attribute to a radio_button_tag

From Dev

How to add a button to play YouTube video full screen using JavaScript?

From Dev

How to overlay one video on another in iOS?

From Dev

Objective-C How To Add Overlay To Video Using AVFoundation?

From Dev

How to replace an image tag with an video tag in jsp

From Dev

customizing html5 audio tag, how to add a volume button?

From Dev

Add image overlay on video FFmpeg

From Dev

Add animated overlay image to video

From Dev

Add a moving overlay of rectangular shape to html5 video

From Dev

How do you add an icon to a button_tag using HAML?

From Dev

ffmpeg how to put color overlay over video

From Dev

How can I overlay a "play button" over a VR Video?

From Dev

How to turn an overlay into a giant button

From Dev

add UIView overlay to UIIMagePickerController video recording

From Dev

How to add a Button to the li tag dynamically using Jquery

From Dev

How to add button overLay in Video Tag

From Dev

How to add web cam(video) recording as overlay using ffmpeg

From Dev

How to overlay a transparent PNG over video and scale to video size in FFmpeg

From Dev

How to replace an image tag with an video tag in jsp

From Dev

FFMpeg: How to add an overlay to a video; then add 5 seconds a still image + 5 seconds silence

From Dev

How add css attributes in button_tag?

From Dev

How to add a button on the embedded youtube video?

From Dev

How can I overlay a "play button" over a VR Video?

From Dev

How to add data-dismiss inside button tag?

From Dev

Add transparent color overlay over an <img> tag

From Dev

How to add color overlay on an image

From Dev

Add animated overlay to video from camera

From Dev

Add button overlay on UITableViewController with use static cells

Related Related

  1. 1

    javascript how to add element dynamically to form tag using button

  2. 2

    Rails: How to add an empty 'required' attribute to a radio_button_tag

  3. 3

    How to add a button to play YouTube video full screen using JavaScript?

  4. 4

    How to overlay one video on another in iOS?

  5. 5

    Objective-C How To Add Overlay To Video Using AVFoundation?

  6. 6

    How to replace an image tag with an video tag in jsp

  7. 7

    customizing html5 audio tag, how to add a volume button?

  8. 8

    Add image overlay on video FFmpeg

  9. 9

    Add animated overlay image to video

  10. 10

    Add a moving overlay of rectangular shape to html5 video

  11. 11

    How do you add an icon to a button_tag using HAML?

  12. 12

    ffmpeg how to put color overlay over video

  13. 13

    How can I overlay a "play button" over a VR Video?

  14. 14

    How to turn an overlay into a giant button

  15. 15

    add UIView overlay to UIIMagePickerController video recording

  16. 16

    How to add a Button to the li tag dynamically using Jquery

  17. 17

    How to add button overLay in Video Tag

  18. 18

    How to add web cam(video) recording as overlay using ffmpeg

  19. 19

    How to overlay a transparent PNG over video and scale to video size in FFmpeg

  20. 20

    How to replace an image tag with an video tag in jsp

  21. 21

    FFMpeg: How to add an overlay to a video; then add 5 seconds a still image + 5 seconds silence

  22. 22

    How add css attributes in button_tag?

  23. 23

    How to add a button on the embedded youtube video?

  24. 24

    How can I overlay a "play button" over a VR Video?

  25. 25

    How to add data-dismiss inside button tag?

  26. 26

    Add transparent color overlay over an <img> tag

  27. 27

    How to add color overlay on an image

  28. 28

    Add animated overlay to video from camera

  29. 29

    Add button overlay on UITableViewController with use static cells

HotTag

Archive