Избавляемся от war
Теперь KinoSearch самодостаточен и может запускаться без внешних веб-контейнеров
This commit is contained in:
117
src/main/resources/kinosearch/webapp/player.ftl
Normal file
117
src/main/resources/kinosearch/webapp/player.ftl
Normal file
@@ -0,0 +1,117 @@
|
||||
[#ftl]
|
||||
[#include "/header.inc.ftl"]
|
||||
<script type="text/javascript" src="/js/js.cookie-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/player.js"></script>
|
||||
<script type="text/javascript">
|
||||
var playerCore;
|
||||
var data;
|
||||
var plSeason;
|
||||
var plSerial;
|
||||
var playerObj;
|
||||
|
||||
$(function(){
|
||||
var video_data = ${json};
|
||||
var titleObj = $('#title');
|
||||
|
||||
plSeason = $('#pl-season');
|
||||
plSerial = $('#pl-serial');
|
||||
playerObj = $('#player');
|
||||
|
||||
playerCore = new PlayerCore(playerObj, titleObj, video_data);
|
||||
playerCore.setupPlayer();
|
||||
|
||||
// загрузка ранее сохранённых данных
|
||||
data = Cookies.getJSON(playerCore.path);
|
||||
if (data != null) {
|
||||
var fulltime = playerCore.msToTime(data.time * 1000);
|
||||
$('#mdl-vtime').text(fulltime.h + ':' + fulltime.m + ':' + fulltime.s);
|
||||
if (playerCore.getType() == 'simple_serial') {
|
||||
$('#mdl-serial').find('span').text(data.serial + 1);
|
||||
$('#mdl-serial').removeClass('hide');
|
||||
} else if (playerCore.getType() == 'seasons_serial') {
|
||||
$('#mdl-season').find('span').text(data.season + 1);
|
||||
$('#mdl-season').removeClass('hide');
|
||||
$('#mdl-serial').find('span').text(data.serial + 1);
|
||||
$('#mdl-serial').removeClass('hide');
|
||||
}
|
||||
$('#modal').modal('show');
|
||||
}
|
||||
|
||||
if (playerCore.getType() == 'one_film') {
|
||||
playerCore.setTitle();
|
||||
playerCore.setupPlayerForOneFilm();
|
||||
} else if (playerCore.getType() == 'simple_serial') {
|
||||
playerCore.setupPlayerForSimpleSerial($('#pl-serial'));
|
||||
titleObj.hide();
|
||||
} else if (playerCore.getType() == 'seasons_serial') {
|
||||
playerCore.setupPlayerForSeasonSerial($('#pl-season'), $('#pl-serial'));
|
||||
titleObj.hide();
|
||||
} else {
|
||||
console.debug(playerCore.videoData);
|
||||
}
|
||||
});
|
||||
|
||||
function continueVideo() {
|
||||
if (playerCore.getType() == 'simple_serial') {
|
||||
playerCore.setSerial(data.serial, plSerial);
|
||||
} else if (playerCore.getType() == 'seasons_serial') {
|
||||
playerCore.setSeason(data.season, plSeason);
|
||||
playerCore.setSerial(data.serial, plSerial, data.season);
|
||||
}
|
||||
playerObj[0].currentTime = data.time;
|
||||
playerObj.load();
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" tabindex="-1" role="dialog" id="modal">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Продолжить просмотр?</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<b>Время:</b> <span id="mdl-vtime"></span>
|
||||
<div id="mdl-blk-serial">
|
||||
<div id="mdl-season" class="hide"><b>Сезон:</b> <span></span></div>
|
||||
<div id="mdl-serial" class="hide"><b>Серия:</b> <span></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="continueVideo()">Да</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="playerObj.load()">Нет</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div id="pl-season" class="dropdown hide" style="display: inline-block;">
|
||||
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownSeason" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
Seasons
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul id="pl-season-menu" class="dropdown-menu" aria-labelledby="dropdownSeason">
|
||||
<li><a href="#">Season</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="pl-serial" class="dropdown hide" style="display: inline-block;">
|
||||
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownSerial" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
Serials
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul id="pl-serial-menu" class="dropdown-menu" aria-labelledby="dropdownSerial">
|
||||
<li><a href="#">Serial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br id="plbr">
|
||||
|
||||
<h2 id="title"></h2>
|
||||
|
||||
<br>
|
||||
|
||||
<video id="player" class="center-block" controls="controls" preload="none"></video>
|
||||
<br>
|
||||
[#include "/fother.inc.ftl"]
|
||||
Reference in New Issue
Block a user