Add CSS class for video player and refactor video element creation
This commit is contained in:
parent
8696b9c0f6
commit
a0b4e6d649
@ -77,6 +77,16 @@
|
|||||||
border: 2px solid white;
|
border: 2px solid white;
|
||||||
box-shadow: 0 0 15px rgba(0,0,0,0.7);
|
box-shadow: 0 0 15px rgba(0,0,0,0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.video-player {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 10000;
|
||||||
|
background-color: black;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
function hideLoader() {
|
function hideLoader() {
|
||||||
@ -103,7 +113,7 @@
|
|||||||
|
|
||||||
$("#play-button").click(function() {
|
$("#play-button").click(function() {
|
||||||
if (currentVideo && currentVideo.url) {
|
if (currentVideo && currentVideo.url) {
|
||||||
let videoElement = $("<video controls autoplay style='width:100%;height:100%;position:fixed;top:0;left:0;z-index:10000;background-color:black;'></video>").attr("src", currentVideo.url).appendTo("body")[0];
|
let videoElement = $("<video controls autoplay class='video-player'></video>").attr("src", currentVideo.url).appendTo("body")[0];
|
||||||
if (videoElement.requestFullscreen) {
|
if (videoElement.requestFullscreen) {
|
||||||
videoElement.requestFullscreen();
|
videoElement.requestFullscreen();
|
||||||
} else if (videoElement.mozRequestFullScreen) { /* Firefox */
|
} else if (videoElement.mozRequestFullScreen) { /* Firefox */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user