-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
videoPlayer.js
26 lines (23 loc) · 899 Bytes
/
videoPlayer.js
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
function videoPlayerInit() {
$("body").append("<div id=\"videoPlayerVideoMask\" active=\"false\"><video src=\"\" controls=\"controls\" autoplay=\"autoplay\" id=\"videoPlayerVideo\" show=\"false\"></video></div>");
$("#videoPlayerVideoMask").click(function () {
videoPlayerExit();
});
$("*").scrollTop(0);
console.log("Video Player Initialized.");
}
function videoPlayerPlay(videoSource) {
$("#videoPlayerVideo").bind("click", function () {
event.stopPropagation();
})
$("#videoPlayerVideo").attr("src", videoSource);
$("#videoPlayerVideo").attr("show", "true");
$("#videoPlayerVideoMask").attr("active", "true");
}
function videoPlayerExit() {
$("#videoPlayerVideo").attr("show", "false");
$("#videoPlayerVideoMask").attr("active", "false");
setTimeout(function () {
$("#videoPlayerVideo").attr("src", "");
}, 500)
}