-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
417 lines (412 loc) · 20.6 KB
/
index.html
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="shortcut icon" href="/static/favicon.ico" />
<link rel="apple-touch-icon" sizes="200x200" href="/static/apple-touch-icon.png" />
<link href="{{ static_url('css/bootstrap.min.css') }}" rel="stylesheet">
<link href="/static/css/bootstrap-vue.css" rel="stylesheet">
<link href="/static/css/open-iconic-bootstrap.css" rel="stylesheet">
<link href="{{ static_url('css/common.css') }}" rel="stylesheet">
<script src="/static/js/vue.min.js"></script>
<script src="/static/js/bootstrap-vue.js"></script>
<title>Light Media Player</title>
</head>
<body>
<div id="v-app" class="flex-center">
<!-- output box -->
<x-transition-fade>
<div v-if="output.show" :key="output.text+Math.random()" class="output-container justify-content-center flex-center position-fixed">
<div class="output">
<small class="d-block">${ output.smallText }</small>
${ output.text }
</div>
</div>
</x-transition-fade>
<!-- output box end -->
<!-- nav bar -->
<b-navbar v-show="fixBar.show" fixed toggleable="lg" type="light" class="default-bg z-index-1050 col-xs-12 col-sm-12 col-md-8 col-lg-11 col-xl-8">
<b-btn-group>
<b-btn variant="outline-secondary" title="browser" :pressed.sync="browserShow">
<i v-show="!browserShow" class="oi oi-list"></i>
<i v-show="browserShow" class="oi oi-x"></i>
</b-btn>
<b-btn variant="outline-secondary" title="new" :pressed.sync="boardShow">
<i class="oi" :class="boardShow ? 'oi-caret-left' : 'oi-caret-right'"></i>
</b-btn>
<!-- dlna dmr menu -->
<b-dropdown v-show="!wpMode" variant="outline-dark">
<template slot="button-content">
<i v-show="dlnaMode" class="oi oi-monitor"></i>
<small v-if="dlnaMode" class="d-sm-inline d-none">${ dlnaInfo.CurrentDMR }</small>
<i v-show="!dlnaMode" class="oi oi-browser"></i>
<small v-if="!dlnaMode" class="d-sm-inline d-none">Web Mode</small>
</template>
<b-dropdown-header v-show="dlnaMode">${ dlnaInfo.CurrentDMR }</b-dropdown-header>
<b-dropdown-divider v-show="dlnaMode"></b-dropdown-divider>
<b-dropdown-item @click="mode=''">
<i class="oi oi-browser"></i>
Web Mode
</b-dropdown-item>
<b-dropdown-item v-show="devMode" @click="mode='DLNA'">
<i class="oi oi-monitor"></i>
DLNA Mode
</b-dropdown-item>
<b-dropdown-divider></b-dropdown-divider>
<b-dropdown-item @click="server.dlna_search().catch(window.appView.out)">
<i class="oi oi-magnifying-glass"></i>
Search Media Renderer
</b-dropdown-item>
<b-dropdown-divider></b-dropdown-divider>
<b-dropdown-item v-for="item in dlnaInfo.DMRs" @click="setDmr(item)">
<i class="oi oi-monitor"></i>
${ item }
</b-dropdown-item>
</b-dropdown>
<!-- dlna dmr menu end -->
<b-btn v-if="wpMode" variant="outline-warning" @click="mode=''">
<i class="oi oi-x"></i>
<small class="d-sm-inline d-none">Close</small>
</b-btn>
</b-btn-group>
<!-- browser menu -->
<transition @enter="transitionPulse">
<b-btn-group v-show="browserShow" class="mx-1">
<b-btn @click="showHistory" :pressed="historyShow" variant="outline-dark">
<i class="oi oi-clock"></i>
<small class="d-sm-inline d-none">History</small>
</b-btn>
<b-btn @click="open('', 'folder')" :pressed="!historyShow" variant="outline-dark">
<i class="oi oi-home"></i>
<small class="d-sm-inline d-none">Home dir</small>
</b-btn>
</b-btn-group>
</transition>
<transition @enter="transitionPulse">
<b-nav-text
class="mx-1 col-4 col-xs-6 col-sm-6 col-md-6 col-lg-4 col-xl-3"
style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
v-show="!browserShow && video.src">${ getShortName(video.src) }
</b-nav-text>
</transition>
<!-- browser menu end -->
<b-btn v-show="browserShow" :pressed.sync="editMode" variant="outline-dark">
<i class="oi oi-circle-check"></i>
<small class="d-sm-inline d-none">edit</small>
</b-btn>
<b-navbar-toggle v-show="!browserShow" target="nav_collapse"></b-navbar-toggle>
<b-collapse is-nav id="nav_collapse" v-model="navCollapse">
<b-navbar-nav>
<b-nav-item v-if="false">test</b-nav-item>
</b-navbar-nav>
<!-- Right aligned nav items -->
<b-navbar-nav class="ml-auto">
<b-nav-item-dropdown right>
<template slot="button-content">
<i class="oi oi-cog"></i>Maintainance
</template>
<b-dropdown-item @click="server.db_backup().then(window.appView.out).catch(window.appView.out)">backup</b-dropdown-item>
<b-dropdown-item @click="server.db_restore().then(window.appView.out).catch(window.appView.out)">restore</b-dropdown-item>
<b-dropdown-divider v-if="devMode"></b-dropdown-divider>
<b-dropdown-item v-if="devMode" disabled>Develop Options</b-dropdown-item>
<b-dropdown-item v-if="devMode" @click="server.self_update().then(window.appView.out).catch(window.appView.out)">update</b-dropdown-item>
<b-dropdown-item v-if="devMode" @click="server.test().then(window.appView.out)">test</b-dropdown-item>
<b-dropdown-item v-if="devMode" @click="test">test2</b-dropdown-item>
<b-dropdown-item v-if="devMode" @click="fixBar.show = false">hide nav</b-dropdown-item>
<b-dropdown-item v-if="devMode" @click="window.server = JsonRpc(jsonrpcAxios('/api'))">use ajax</b-dropdown-item>
</b-nav-item-dropdown>
<b-nav-item v-show="wpMode" @click="playNext(video.src)">
<i class="oi oi-media-step-forward"></i> Next
</b-nav-item>
<b-nav-item v-show="wpMode" @click="videoSizeToggle">${ video.sizeBtnText }</b-nav-item>
<!-- web player rate menu -->
<b-nav-item-dropdown v-show="wpMode" right>
<template slot="button-content">
Rate
</template>
<b-dropdown-item @click="rate(0.5)">0.5X</b-dropdown-item>
<b-dropdown-item @click="rate(0.75)">0.75X</b-dropdown-item>
<b-dropdown-divider></b-dropdown-divider>
<b-dropdown-item @click="rate(1)">1X</b-dropdown-item>
<b-dropdown-divider></b-dropdown-divider>
<b-dropdown-item @click="rate(1.25)">1.25X</b-dropdown-item>
<b-dropdown-item @click="rate(1.5)">1.5X</b-dropdown-item>
<b-dropdown-item @click="rate(1.75)">1.75X</b-dropdown-item>
<b-dropdown-item @click="rate(2)">2X</b-dropdown-item>
<b-dropdown-item @click="rate(2.5)">2.5X</b-dropdown-item>
</b-nav-item-dropdown>
<!-- web player rate menu end -->
<!-- seek menu -->
<b-nav-item-dropdown v-show="dlnaMode || wpMode" right>
<template slot="button-content">
Seek
</template>
<b-dropdown-item @click="seek(15)">00:15</b-dropdown-item>
<b-dropdown-item @click="seek(29)">00:30</b-dropdown-item>
<b-dropdown-item @click="seek(44)">00:45</b-dropdown-item>
<b-dropdown-item @click="seek(60)">01:00</b-dropdown-item>
<b-dropdown-item @click="seek(90)">01:30</b-dropdown-item>
</b-nav-item-dropdown>
<!-- seek menu end -->
</b-navbar-nav>
</b-collapse>
</b-navbar>
<!-- nav bar end -->
<!-- dropdown window -->
<transition @enter="transitionBounceIn"
@leave="transitionBounceOut">
<div v-show="browserShow" class="col-xs-12 col-sm-12 col-md-10 col-lg-8 col-xl-6 z-index-1040">
<div class="card window">
<div class="card-header"></div>
<div class="table-responsive-sm text-center auto-overflow" style="min-height: 30vh;">
<table v-show="historyShow" class="table table-striped table-sm">
<tr v-for="item in history">
<td v-show="editMode" class="iconOnly">
<b-input-group-prepend is-text>
<input type="checkbox" :value="item.fullpath" v-model="removeCheckboxList">
</b-input-group-prepend>
</td>
<td class="d-sm-table-cell d-none iconOnly"><i class="oi oi-video"></i></td>
<td @click="open(item.fullpath, 'mp4')"
v-press="pressOpen"
:data-target="item.path"
class="break-all">
<span :class="item.exist ? 'mp4' : 'other'">${ item.filename }</span>
<br>
<small class="text-muted">
${ item.latest_date } | ${ secondToTime(item.position) }
/ ${ secondToTime(item.duration) }
</small>
</td>
<td v-show="!editMode" class="iconOnly">
<b-dropdown no-caret toggle-class="text-dark" variant="link">
<template slot="button-content">
<i class="oi oi-ellipses rotate-90"></i>
</template>
<b-dropdown-header>${ item.filename }</b-dropdown-header>
<b-dropdown-item @click="open(item.fullpath, 'mp4')">
<i class="oi oi-media-play"></i> Play
</b-dropdown-item>
<b-dropdown-item @click="playNext(item.fullpath)">
<i class="oi oi-media-step-forward"></i> Play Next
</b-dropdown-item>
<!-- <b-dropdown-item @click="server.dlna_next(item.fullpath, window.location.host).then(window.appView.out).catch(window.appView.out)" v-if="devMode"> -->
<!-- <i class="oi oi-media-step-forward"></i> Play next through DLNA -->
<!-- </b-dropdown-item> -->
<b-dropdown-item @click="open(item.path, 'folder')">
<i class="oi oi-folder"></i> ${ item.path }
</b-dropdown-item>
<b-dropdown-divider></b-dropdown-divider>
<b-dropdown-item @click="if(confirm('Confirm move?'))move(item.fullpath)">
<i class="oi oi-trash"></i> Move file to .old
</b-dropdown-item>
<b-dropdown-item @click="if(confirm('Confirm remove?'))remove(item.fullpath)">
<i class="oi oi-trash"></i> Remove from history
</b-dropdown-item>
</b-dropdown>
</td>
</tr>
</table>
<table v-show="!historyShow" class="table table-striped table-sm">
<tr v-for="item in filelist">
<td v-show="editMode" class="iconOnly">
<b-input-group-prepend is-text>
<input type="checkbox" :value="item.path" v-model="moveCheckboxList">
</b-input-group-prepend>
</td>
<td class="iconOnly"><i :class="icon[item.type]" class="oi"></i></td>
<td :class="item.type"
v-tap="tapOpen"
:data-type="item.type"
:data-path="item.path"
class="break-all">
${ item.filename }
<br>
<small class="text-muted">${ item.size }</small>
</td>
<td class="iconOnly">
<b-dropdown v-show="!editMode" no-caret toggle-class="text-dark" variant="link">
<template slot="button-content">
<i class="oi oi-ellipses rotate-90"></i>
</template>
<b-dropdown-header>${ item.filename }</b-dropdown-header>
<b-dropdown-item @click="open(item.path, item.type)">
<i class="oi oi-browser"></i> Open
</b-dropdown-item>
<b-dropdown-divider></b-dropdown-divider>
<b-dropdown-item @click="if(confirm('Confirm move?'))move(item.path)">
<i class="oi oi-trash"></i> move file to .old
</b-dropdown-item>
</b-dropdown>
</td>
</tr>
</table>
</div>
<div class="card-footer text-center">
<b-button-group v-show="editMode">
<b-input-group>
<b-input-group-prepend is-text>
<input type="checkbox" v-model="allSelected" @change="historySelectAll"> All
</b-input-group-prepend>
</b-input-group>
<b-btn v-if="historyShow" @click="removeSelected" size="sm" variant="outline-danger" :disabled="removeCheckboxList.length==0">
<i class="oi oi-trash"></i> Remove
</b-btn>
<b-btn v-if="!historyShow" @click="moveSelected" size="sm" variant="outline-danger" :disabled="moveCheckboxList.length==0">
<i class="oi oi-trash"></i> Move to .old
</b-btn>
</b-button-group>
<b-button-close @click="browserShow=false"></b-button-close>
</div>
</div>
</div>
</transition>
<!-- dropdown window end -->
<!-- video -->
<div class="main">
<div class="left-board" :class="boardShow ? 'width-20' : 'width-0'">
<!-- <div v-show="dlnaMode || wpMode"> -->
<div class="mt-3">
<b-card
:title="getShortName(video.src)"
tag="article"
style="max-width: 20rem;"
class="mb-2"
>
<b-button-group vertical>
<b-btn @click="playNext(video.src)">
<i class="oi oi-media-step-forward"></i> Play Next
</b-btn>
<b-btn @click="seek(19)">
seek: 20
</b-btn>
<b-btn @click="seek(44)">
seek: 45
</b-btn>
<b-btn @click="bright200()">
brightness 200%
</b-btn>
<b-dropdown right text="Seek">
<b-dropdown-item @click="seek(15)">00:15</b-dropdown-item>
<b-dropdown-item @click="seek(29)">00:30</b-dropdown-item>
<b-dropdown-item @click="seek(44)">00:45</b-dropdown-item>
<b-dropdown-item @click="seek(60)">01:00</b-dropdown-item>
<b-dropdown-item @click="seek(90)">01:30</b-dropdown-item>
</b-dropdown>
</b-button-group>
</b-card>
</div>
</div>
<div class="board-middle">
<button class="btn btn-outline-secondary middle-button" @click="boardShow = !boardShow">
<i class="oi" :class="boardShow ? 'oi-caret-left' : 'oi-caret-right'"></i>
</button>
</div>
<div class="right-board" :class="boardShow ? 'width-80' : 'width-100'">
<video webkit-playsinline="true"
playsinline=""
v-if="wpMode"
ref="video"
@timeupdate="videosave"
@seeking="videoseek"
@error="videoerror"
@loadedmetadata ="videoAdapt"
@loadeddata="videoload"
@progress="videoprogress"
@volumechange="volumechange"
:key="video.src"
:src="'/video/' + video.src"
poster controls preload="meta">
No video support!
</video>
<div id="nextVideo">
<b-button-group>
<b-btn size="sm" @click="playNext(video.src)">
<i class="oi oi-media-step-forward"></i>
</b-btn>
<!-- <b-btn size="sm" onclick="fullscreenEnter()"> -->
<!-- <i class="oi oi-fullscreen-enter"></i> -->
<!-- </b-btn> -->
<!-- <b-btn size="sm" onclick="fullscreenExit()"> -->
<!-- <i class="oi oi-fullscreen-exit"></i> -->
<!-- </b-btn> -->
</b-button-group>
</div>
</div>
</div>
<!-- video end-->
<!-- dlna interface -->
<div v-if="dlnaMode && dlnaInfo.TrackURI" class="text-center col-sm-10 col-md-8 col-lg-6 col-xl-4">
<b-card v-pan="dlnaTouch"
v-swipe="dlnaTouch"
bg-variant="light"
:title="decodeURI(dlnaInfo.TrackURI)"
class="title break-all my-3">
</b-card>
</div>
<transition @enter="transitionSlideUpBigIn"
@leave="transitionSlideDownBigOut">
<div v-show="dlnaMode" class="fixed-bottom text-center default-bg flex-center">
<div class="card-body col-sm-12 col-md-8 col-lg-6 col-xl-4">
<h6 class="card-subtitle text-muted">${ dlnaInfo.CurrentTransportState }</h6>
<h6 v-show="dlnaInfo.RelTime" class="card-title my-2">
${ dlnaInfo.RelTime} / ${ dlnaInfo.TrackDuration }
</h6>
<input class="position-bar mb-3 mt-1"
v-model.number="positionBarVal"
type="range"
min="0"
:max="positionBarMax"
@change="positionSeek"
@input="positionShow">
<b-btn-toolbar justify class="my-2 text-center">
<b-btn-group class="m-1">
<b-btn class="mx-1" variant="outline-warning" v-tap="volDown">
<i class="oi oi-volume-low"></i>
</b-btn>
<b-btn class="mx-1" variant="outline-warning" v-tap="volUp">
<i class="oi oi-volume-high"></i>
</b-btn>
</b-btn-group>
<b-btn-group>
<b-btn class="btn-lg" variant="outline-success" @click="fastbackward()">
<i class="oi oi-media-skip-backward"></i>
</b-btn>
<b-btn class="btn-lg" variant="outline-success" @click="server.dlna('play').then(window.appView.out).catch(window.appView.out)">
<i class="oi oi-media-play"></i>
</b-btn>
<b-btn class="btn-lg" variant="outline-danger" @click="server.dlna('pause').then(window.appView.out).catch(window.appView.out)">
<i class="oi oi-media-pause"></i>
</b-btn>
<b-btn class="btn-lg" variant="outline-danger" @click="server.dlna('stop').then(window.appView.out).catch(window.appView.out)">
<i class="oi oi-media-stop"></i>
</b-btn>
<b-btn class="btn-lg" variant="outline-success" @click="fastforward()">
<i class="oi oi-media-skip-forward"></i>
</b-btn>
<b-btn class="" variant="outline-success" @click="server.dlna_next().then(window.appView.out).catch(window.appView.out)">
<i class="oi oi-media-step-forward"></i>
</b-btn>
</b-btn-group>
</b-btn-toolbar>
</div>
</div>
</transition>
<!-- dlna interface end -->
</div>
<footer class="text-center">
<small class="text-muted">©2016-2019 Xenos' Light Media Player</small>
</footer>
</body>
<script src="/static/js/velocity.min.js"></script>
<script src="/static/js/velocity.ui.min.js"></script>
<script src="/static/js/axios.min.js"></script>
<script src="{{ static_url('js/reconnecting-websocket.min.js') }}"></script>
<script src="{{ static_url('js/hammer.min.js') }}"></script>
<script src="{{ static_url('js/jsonrpc.js') }}"></script>
<script src="{{ static_url('js/common.js') }}"></script>
<script src="{{ static_url('js/main.js') }}"></script>
</html>