@@ -26,35 +26,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
[#include "/fother.inc.ftl"]
\ No newline at end of file
diff --git a/src/main/resources/kinosearch/webapp/static/js/ksplayer.js b/src/main/resources/kinosearch/webapp/static/js/ksplayer.js
new file mode 100644
index 0000000..fa062d3
--- /dev/null
+++ b/src/main/resources/kinosearch/webapp/static/js/ksplayer.js
@@ -0,0 +1,47 @@
+const KSPlayer = function(containerId) {
+ /* --- FIELDS -------------- */
+
+ var videoType = 'unknown';
+ var isShowTitle = false;
+
+ /* --- PRIVATE FUNCTIONS --- */
+
+ /* --- CONSTRUCTOR --------- */
+
+ const containerElement = document.getElementById(containerId);
+ if (containerElement === null) {
+ throw `Container "${containerId}" not found!`;
+ }
+
+ let videoElement = document.createElement('video');
+ videoElement.id = 'player';
+ videoElement.className = 'center-block';
+ videoElement.setAttribute('controls', 'controls');
+ videoElement.setAttribute('preload', 'none');
+
+ var titleElement = document.createElement('h2');
+ titleElement.id = 'title';
+
+ containerElement.appendChild(videoElement);
+
+ /* --- FUNCTIONS ----------- */
+
+ this.getType = function() {
+ return videoType;
+ }
+
+ this.setTitle = function(text) {
+ if (text) {
+ titleElement.innerText = text;
+ if (!isShowTitle) {
+ containerElement.insertBefore(titleElement, videoElement);
+ isShowTitle = true;
+ }
+ } else {
+ if (isShowTitle) {
+ containerElement.removeChild(titleElement);
+ isShowTitle = false;
+ }
+ }
+ }
+}