-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage.php
More file actions
49 lines (38 loc) · 1.35 KB
/
page.php
File metadata and controls
49 lines (38 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php get_header(inner); ?>
<h1> <?php the_title(); ?> </h1>
<?php the_post_thumbnail('medium'); ?>
<div class="content">
<p>
<?php echo get_the_content(); ?>
</p>
</div>
<?php $img_path = wp_get_attachment_image_src(get_post_thumbnail_id(),'large'); ?>
<img src="<?php echo $img_path[0] ?>" alt="" id="popimg">
<video id="videoElement" width="400" height="250" controls="true" src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/WeAreGoingOnBullrun.mp4"></video>
<button id="full_screen">[ ]</button>
<script>
function enterFullScreen(element) {
if(element.requestFullscreen) {
element.requestFullscreen();
}else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen(); // Firefox
}else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen(); // Safari
}else if(element.msRequestFullscreen) {
element.msRequestFullscreen(); // IE/Edge
}
};
let btn = document.getElementById("full_screen");
btn.addEventListener("click", function(){
let img = document.querySelector("img");
enterFullScreen(img);
});
document.addEventListener('fullscreenchange', (event) => {
if (document.fullscreenElement) {
console.log('Entered fullscreen:', document.fullscreenElement);
} else {
console.log('Exited fullscreen.');
}
});
</script>
<?php get_footer(); ?>