wplayer

Check-in [5ca5f19a17]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add drop first/last from queue, and add all album
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:5ca5f19a1709a404de11c6a9c5e1fbc1006f4e754bc236e474085352f5826c54
User & Date: ajv-899-334-8894@vsta.org 2016-02-12 03:32:32
Context
2016-06-18
03:27
Work on now playing data display. Add "drop all" list. check-in: 7d0b100321 user: ajv-899-334-8894@vsta.org tags: master, trunk
2016-02-12
03:32
Add drop first/last from queue, and add all album check-in: 5ca5f19a17 user: ajv-899-334-8894@vsta.org tags: master, trunk
2016-02-11
15:03
chore library check-in: da01a57b41 user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to html/top.html.

28
29
30
31
32
33
34




35
36
37
38
39
40
   </td>
  </tr>
 </table>
 <hr>
 <button onclick="return go_up();">
  <img src="/imgs/player_eject.png" alt="Go Up" />
 </button>




 <textarea rows="1" cols="40" readonly id="trackname"></textarea>
 <br>
 <span id="browser"></span>
 <script src="/js/player.js"></script>
</body>
</html>







>
>
>
>






28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
   </td>
  </tr>
 </table>
 <hr>
 <button onclick="return go_up();">
  <img src="/imgs/player_eject.png" alt="Go Up" />
 </button>
 <button onclick="return dropFirst();">-First</button>
 <button onclick="return dropLast();">-Last</button>
 <button onclick="return addAll();">+All</button>
 <br>
 <textarea rows="1" cols="40" readonly id="trackname"></textarea>
 <br>
 <span id="browser"></span>
 <script src="/js/player.js"></script>
</body>
</html>

Changes to js/player.js.

105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
...
152
153
154
155
156
157
158
































159
160
161
162
163
164
165
	player.currentTime = newTime;
    }
}

// End of current track, try to advance
function playNext() {
    if (playlist.length > 0) {
	var s =  playlist.shift();
	player.src = s;

	// For good measure
	player.play();

	nowplaying.textContent = unescape(s);
	paintQueue();
................................................................................
    }
    var idx = path.lastIndexOf("/");
    path = path.slice(0, idx);
    pdepth -= 1;
    curdir();
    return false;
}

































// Push to dir
function go_dir(didx) {
    // Working on a previous click
    if (pcontents == null) {
	return false;
    }







|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
...
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
	player.currentTime = newTime;
    }
}

// End of current track, try to advance
function playNext() {
    if (playlist.length > 0) {
	var s = playlist.shift();
	player.src = s;

	// For good measure
	player.play();

	nowplaying.textContent = unescape(s);
	paintQueue();
................................................................................
    }
    var idx = path.lastIndexOf("/");
    path = path.slice(0, idx);
    pdepth -= 1;
    curdir();
    return false;
}

// Drop first thing on playlist (i.e., next to play)
function dropFirst() {
    if (playlist.length == 0) {
	return false;
    }

    // Drop it
    playlist.shift();

    // Update list
    paintQueue();
}

// Drop latest thing we've added (last to play)
function dropLast() {
    if (playlist.length == 0) {
	return false;
    }
    playlist.pop()
    paintQueue();
}

// Add all files in current folder to playlist
// (i.e., "play album")
function addAll() {
    if (pcontents.files.length > 0) {
	for (var fidx = 0; fidx < pcontents.files.length; fidx++) {
	    go_file(fidx);
	}
    }
}

// Push to dir
function go_dir(didx) {
    // Working on a previous click
    if (pcontents == null) {
	return false;
    }