wplayer

Check-in [c040f16c53]
Login

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

Overview
Comment:Fix layout. Fix display of Now Playing filename.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:c040f16c53ec799332789806eaecf68f60141744c2d2c425527f142080b8be91
User & Date: ajv-899-334-8894@vsta.org 2016-02-01 15:21:19
Context
2016-02-01
15:30
Simplify; use autoplay check-in: ff191ae03e user: ajv-899-334-8894@vsta.org tags: master, trunk
15:21
Fix layout. Fix display of Now Playing filename. check-in: c040f16c53 user: ajv-899-334-8894@vsta.org tags: master, trunk
04:12
Make printable version for "now playing" text pane. check-in: eefabcc658 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="20" 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
   </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>

Changes to js/player.js.

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
...
109
110
111
112
113
114
115
116

117
118
119
120
121
122
123
124
...
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149

    //
    // Paint file browsing window
    //
    res = ''

    // Name of active track in its own position
    trackname.textContent = path;

    // Directories (if any)
    if (pcontents.dirs.length > 0) {
	res += '<b>Directories</b>:<br>';
	for (var didx = 0; didx < pcontents.dirs.length; didx++) {
	    d = pcontents.dirs[didx];
	    res += '<button onclick="return go_dir(' + didx.toString() + ');">'
................................................................................
// End of current track, try to advance
function playNext() {
    if (playing && !player.ended) {
	// Playing and user hit "next track"
	player.pause();
    }
    if (playlist.length > 0) {
	player.src = playlist.shift();

	nowplaying.textContent = unescape(player.src);
	paintQueue();
	playing = true;
    } else {
	nowplaying.textContent = '';
	playing = false;
    }
}
................................................................................
	return false;
    }

    // Assemble full filename
    var fname = "/media" + path + "/" + pcontents.files[fidx]
    if (!playing) {
	player.src = fname;
	nowplaying.textContent = unescape(player.src);
	player.play();
	playing = true;
    } else {
	playlist.push(fname);
	paintQueue();
    }
    return false;







|







 







|
>
|







 







|







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
...
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
...
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150

    //
    // Paint file browsing window
    //
    res = ''

    // Name of active track in its own position
    trackname.textContent = unescape(path);

    // Directories (if any)
    if (pcontents.dirs.length > 0) {
	res += '<b>Directories</b>:<br>';
	for (var didx = 0; didx < pcontents.dirs.length; didx++) {
	    d = pcontents.dirs[didx];
	    res += '<button onclick="return go_dir(' + didx.toString() + ');">'
................................................................................
// End of current track, try to advance
function playNext() {
    if (playing && !player.ended) {
	// Playing and user hit "next track"
	player.pause();
    }
    if (playlist.length > 0) {
	var s =  playlist.shift();
	player.src = s;
	nowplaying.textContent = unescape(s);
	paintQueue();
	playing = true;
    } else {
	nowplaying.textContent = '';
	playing = false;
    }
}
................................................................................
	return false;
    }

    // Assemble full filename
    var fname = "/media" + path + "/" + pcontents.files[fidx]
    if (!playing) {
	player.src = fname;
	nowplaying.textContent = unescape(fname);
	player.play();
	playing = true;
    } else {
	playlist.push(fname);
	paintQueue();
    }
    return false;