javascript - Centered image on video tag -
allright project need have centered image (a play button) rendered @ runtime on top off video depending on useragent. if useragent isn't firefox want display image since firefox has it's own playevent , button on top of video @ start. previous attempts have failed.
i tried:
- tag in video tag , put z-index 10 while putting video z-index 1
- putting div background image around video tag
are there other ways this, , please don't reply use poster since allready have poster need use.
-edit-
code:
<tr> <td runat="server" width="680px" height="383px" id="vcontainer"> <video id="player" style="z-index: 1" width="100%" height="100%" title="" controls runat="server"> <source runat="server" id="ffvideo" type="video/ogg" /> <source runat="server" id="mp4video" type="video/mp4" /> </video> <embed id="playerold" width="680px" autostart="false" allowfullscreen="true" height="383px" title="" style="display: none" type="application/mp4" runat="server" /> </td> </tr>
as simple put tag , give more z-index. can make running: http://jsfiddle.net/65rda3jq/
<div class="cont"> <div class="img"></div> <video id="player" style="z-index: 1" width="100%" height="100%" title="" controls runat="server"> <source runat="server" id="ffvideo" type="video/ogg" /> <source runat="server" id="mp4video" type="video/mp4" /> </video> <embed id="playerold" width="680px" autostart="false" allowfullscreen="true" height="383px" title="" style="display: none" type="application/mp4" runat="server" /> </div>
css
.cont { position:relative; } video { position: relative; } .img {z-index:10; background: #f00; position: absolute; top: 50%; left: 50%; width: 50px; height: 50px; }
Comments
Post a Comment