-
Notifications
You must be signed in to change notification settings - Fork 1
/
player.html
200 lines (189 loc) · 15.8 KB
/
player.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
<div v-on:dblclick="transport_playpause">
<nav>
<i class="material-icons uk-text-muted enable-dragging" onclick="api.set_draggable(true);">drag_handle</i>
</nav>
<template v-if='!view_settings && status == "connecting"'>
<div class="uk-text-center">
Connecting...<br>
<small v-if='paired == true' class="uk-text-muted">Plugin is connecting</small>
<small v-else class="uk-text-muted">Please enable extension in Roon settings</small>
<div class="uk-margin-large-top">
<form>
<label>Server IP</label><br>
<input v-model="server_ip" @input="change_server_ip" type="text" placeholder="localhost" :value="server_ip" style="background: rgba(0,0,0,0.9); color: #38f; border: none; outline: none; padding: 3px;"/><br>
<label>Server Port</label><br>
<input v-model="server_port" @input="change_server_port" type="text" placeholder="9100" :value="server_port" style="background: rgba(0,0,0,0.9); color: #38f; border: none; outline: none; padding: 3px;"/><br>
<button @click.prevent="update_settings" style="background: rgba(0,0,0,0.9); color: #38f; border: none; outline: none; padding: 3px;">Submit</button>
</form>
</div>
</div>
</template>
<template v-if='view_settings'>
<div class="uk-text-center">
Settings<br>
<small v-if='paired == true' class="uk-text-muted">Editing config.json</small>
<small v-else class="uk-text-muted">Available roon settings</small>
<div class="uk-margin-medium-top uk-margin-large-bottom">
<form>
<label>Server IP</label><br>
<input v-model="server_ip" @input="change_server_ip" type="text" placeholder="localhost" :value="server_ip" style="background: rgba(0,0,0,0.9); color: #38f; border: none; outline: none; padding: 3px;"/><br><br>
<label>Server Port</label><br>
<input v-model="server_port" @input="change_server_port" type="text" placeholder="9100" :value="server_port" style="background: rgba(0,0,0,0.9); color: #38f; border: none; outline: none; padding: 3px;"/><br><br>
<button @click.prevent="cancel_settings" style="background: rgba(0,0,0,0.9); color: #38f; border: none; outline: none; padding: 3px;">Cancel</button> 
<button @click.prevent="update_settings" style="background: rgba(0,0,0,0.9); color: #38f; border: none; outline: none; padding: 3px;">Submit</button>
</form>
</div>
</div>
</template>
<template v-if='!view_settings && status == "disconnected"'>
<div class="uk-text-center">
Disconnected...<br>
<small v-if='paired == true' class="uk-text-muted">Lost connection to core</small>
<small v-else class="uk-text-muted">Plugin has been disabled in Roon settings</small>
</div>
</template>
<template v-if='!view_settings && status == "connected"'>
<div class="uk-grid uk-grid-small uk-margin-small-bottom" data-uk-grid-margin="">
<div class="uk-width-1-2">
<select v-model="current_zone_id" style="background: rgba(0,0,0,0.9); color: #38f; border: none; outline: none; padding: 3px;">
<option v-for="zone in zones" :value="zone.zone_id">{{ zone.display_name }}</option>
</select>
</div>
<div class="uk-width-1-2 uk-text-center hidden-small">
<div v-if='zone' class='zonetitle uk-text-small uk-text-truncate'>
<small class="uk-text-muted" data-uk-tooltip="{pos: 'top'}" title="{{zone.display_name}}">{{status}}   ({{zone.state}})</small>
</div>
</div>
<div class="uk-width-1-1 uk-text-left visible-small scaled-info">
<img class="uk-float-left" v-if='zone.now_playing.image_key' :src="'http://' + server_ip + ':' + server_port + '/api/image/' + zone.now_playing.image_key + '?format=image/png&scale=fit&width=1000&height=1000'"/>
<div @click="toggleTrackAlbumTitle" class="line1 pointer uk-animation uk-animation-middle-left uk-animation-scale-up uk-text-truncate">{{zone.now_playing.three_line.line1}}</div>
<div @click="toggleTrackAlbumTitle" class="line2 pointer uk-animation uk-animation-middle-left uk-animation-scale-up uk-text-truncate uk-hidden">{{zone.now_playing.three_line.line3}}</div>
<div class="default uk-text-truncate uk-text-muted uk-text-small">{{zone.now_playing.three_line.line2}}</div>
</div>
</div>
<div class="uk-grid uk-grid-small main-grid" data-uk-grid-margin="">
<div class="uk-width-1-1 hidden-small">
<div class="album {{zone.state == 'stopped' ? '' : 'nowplaying'}}" v-if='zone'>
<div class="photo" v-if='zone.now_playing.artist_image_keys' :style='{ "background-image": "url(http://" + server_ip + ":" + server_port + "/api/image/" + zone.now_playing.artist_image_keys[0] + "?format=image/png&scale=fit&width=1000&height=1000)" }'></div>
<div class="photo" v-else style="background-image: url(assets/img/noartist.png)"></div>
<img v-if='zone.now_playing.image_key' :src="'http://' + server_ip + ':' + server_port + '/api/image/' + zone.now_playing.image_key + '?format=image/png&scale=fit&width=1000&height=1000'"/>
<img v-else='zone.now_playing.image_key' :src="'assets/img/noalbum.png'"/>
<div class="infos">
<div class="song">
<span @click="toggleTrackAlbumTitle" class="line1 pointer uk-animation uk-animation-middle-left uk-animation-scale-up uk-text-truncate">{{zone.now_playing.three_line.line1}}</span>
<span @click="toggleTrackAlbumTitle" class="line2 pointer uk-animation uk-animation-middle-left uk-animation-scale-up uk-text-truncate uk-hidden">{{zone.now_playing.three_line.line3}}</span>
<small class="line3 default uk-text-truncate">{{zone.now_playing.three_line.line2}}</small>
</div>
</div>
</div>
</div>
<div class="uk-width-1-1">
<div class="dashboard">
<div class="list hidden-small">
<div id="listBtn" class="list-btn" @click="toggleList"><span></span></div>
</div>
<div class="player" v-if='zone'>
<div v-if='zone.state == "stopped" || zone.state == "loading"' class="time default"><small class="current default">— /</small> <small class="duration default">—</small></div>
<div v-else class="time default"><small class="current default">{{to_time(zone.now_playing.seek_position)}} /</small> <small class="duration default">{{to_time(zone.now_playing.length)}}</small></div>
<div class="time-rail pointer" @click.prevent="transport_seek" v-on:mousemove="hover_show_seek_time" v-on:mouseleave="hover_hide_seek_time(false)">
<div class="thumb" :style='{ left: zone.now_playing.seek_position / zone.now_playing.length * 100 + "%" }'></div>
<div class="track"></div>
<div class="time-rail-seek"></div>
</div>
</div>
<div class="player" v-else>
<div class="time"><small class="current">—</small> / <small class="duration">—</small></div>
<div class="time-rail">
<div class="thumb" style='left: 0%;'></div>
<div class="track"></div>
</div>
</div>
<div v-if='zone' class="action-button">
<a class="radio" @click="transport_change_settings('auto_radio')"><i class="material-icons {{ zone.settings.auto_radio ? 'uk-text-primary' : 'md-color-white'}}">radio</i></a>
<a class="random" @click="transport_change_settings('shuffle')"><i class="material-icons {{ zone.settings.shuffle ? 'uk-text-primary' : 'md-color-white'}}">shuffle</i></a>
<a class="prev" @click="transport_previous"><i class="material-icons md-color-white">fast_rewind</i></a>
<a class="play-pause" @click="transport_playpause"><i class="material-icons md-icon md-color-white">{{ zone.state == 'playing' ? 'pause' : 'play_arrow'}}</i></a>
<a class="next" @click="transport_next"><i class="material-icons md-color-white">fast_forward</i></a>
<a class="stop" @click="transport_stop"><i class="material-icons md-color-white">stop</i></a>
<a class="volume" @click="show_volume">
<i class="material-icons md-color-white">volume_up</i>
<input @change="transport_volume" class="volume-input" type="number" min="0" max="100" value="">
</a>
</div>
<div v-else class="action-button">
<a class="radio"><i class="material-icons md-color-white">radio</i></a>
<a class="random"><i class="material-icons md-color-white">shuffle</i></a>
<a class="prev"><i class="material-icons md-color-white">fast_rewind</i></a>
<a class="play-pause"><i class="material-icons md-icon md-color-white">block</i></a>
<a class="next"><i class="material-icons md-color-white">fast_forward</i></a>
<a class="stop"><i class="material-icons md-color-white">stop</i></a>
<a class="volume"><i class="material-icons md-color-white">volume_up</i></a>
</div>
</div>
</div>
</div>
<div v-if='list' class='lists browser hidden-small'>
<div class="uk-grid uk-grid-small label" data-uk-grid-margin="">
<div class="uk-width-3-10">
<img v-if='list.image_key' style='width: 95px; object-fit: cover; object-position: center;' :src="'http://' + server_ip + ':' + server_port + '/api/image/' + list.image_key + '?format=image/png&scale=fit&width=500&height=500'">
<img v-else style='width: 95px; object-fit: cover; object-position: center;' src="assets/img/roon.png">
</div>
<div class="uk-width-7-10">
<div class="uk-grid uk-grid-small" data-uk-grid-margin="">
<div class="uk-width-1-1 uk-margin-small-bottom uk-text-truncate browsertitle">{{list.title}}</div>
<div class="uk-width-1-1 uk-margin-small-bottom uk-text-truncate browsersubtitle">{{list.subtitle}}</div>
<div class="uk-width-1-1 uk-margin-small-bottom">
<div class="box">
<a href="back" v-if='list.level != 0' @click.prevent='list_back()'><i class="md-icon material-icons md-color-white">arrow_back</i></a>
<a href="home" v-if='list.level != 0' @click.prevent='list_home()'><i class="md-icon material-icons md-color-white">home</i></a>
<a href="refresh" @click.prevent='list_refresh()'><i class="md-icon material-icons md-color-white">refresh</i></a>
<div v-if='list.count != items.length' class="uk-grid uk-grid-small">
<a href='previouspage' @click.prevent='list_prev_page'><i class="md-icon material-icons uk-text-muted">keyboard_arrow_left</i></a>
<small>{{listoffset+1}}-{{listoffset + items.length}} of {{list.count}}</small>
<a href='nextpage' @click.prevent='list_next_page'><i class="md-icon material-icons uk-text-muted">keyboard_arrow_right</i></a>
</div>
</div>
</div>
</div>
</div>
</div>
<ul class='browseitems'>
<li v-for='item in items' class='browseitem'>
<form v-if='item.input_prompt' action='submit' @submit.prevent='list_input(item)' class='browseiteminput'>
<img style='float: right; margin: 0 1em;' v-if='item.image_key' :src="'http://' + server_ip + ':' + server_port + '/api/image/' + item.image_key + '?format=image/png&scale=fit&width=100&height=100'">
<div>{{item.input_prompt.prompt}}</div>
<div>
<input type='{{item.input_prompt.is_password ? "password" : "text"}}' v-model='item.input_prompt.value'>
<input type='submit' value='{{item.input_prompt.action}}' @click.prevent='list_input(item)'>
</div>
<br v-if='item.image_key' style='clear:both'/>
</form>
<div v-else @click.prevent='list_item(item)' class='browseitemnormal' >
<img style='float: right; margin: 0 1em;' v-if='item.image_key' :src="'http://' + server_ip + ':' + server_port + '/api/image/' + item.image_key + '?format=image/png&scale=fit&width=100&height=100'">
<div class='browseitemtitle uk-text-truncate'>{{item.title}}</div>
<div class='browseitemsubtitle uk-text-truncate uk-text-small uk-text-muted'>{{item.subtitle}}</div>
<br v-if='item.image_key' style='clear:both'/>
</div>
</li>
</ul>
</div>
<div v-else class='lists browser hidden-small'>
<div class="label">
<div class="uk-grid uk-grid-small uk-margin-remove uk-padding-remove">
<div class="uk-width-2-10 uk-padding-remove" style="border: 1px solid #353535;">
<img style='width: 100%; height: 65px;' src="assets/img/roon.png">
</div>
<div class="uk-width-4-10 uk-text-truncate browsertitle" style="padding-left: 10px"> </div>
<div class="uk-width-4-10 uk-text-truncate browsersubtitle" style="padding-left: 5px"> </div>
</div>
</div>
<div class="box">
<a href="back"><i class="md-icon material-icons md-color-white">arrow_back</i></a>
<a href="home"><i class="md-icon material-icons md-color-white">home</i></a>
<a href="refresh"><i class="md-icon material-icons md-color-white">refresh</i></a>
</div>
<div style="min-height: 32px; height: 32px; position: relative; left: 80px;"> </div>
<ul class='browseitems'><li class='browseitem'>No items to display</li></ul>
</div>
</template>
</div>