wplayer

Check-in [e0f7a0e0cf]
Login

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

Overview
Comment:Move some stuff to static HTML out of JS
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:e0f7a0e0cf9de71584964d4d8ca3a06e1331c1a3cb94321b23b0fed1545443b3
User & Date: ajv-899-334-8894@vsta.org 2016-01-31 01:08:21
Context
2016-01-31
03:16
Escape things before they go back out (they were already un-escaped on the way int). Fix some resulting display treatment. check-in: 175042e320 user: ajv-899-334-8894@vsta.org tags: master, trunk
01:08
Move some stuff to static HTML out of JS check-in: e0f7a0e0cf user: ajv-899-334-8894@vsta.org tags: master, trunk
2016-01-30
23:08
Next track. Fiddle with "media ready" kind of events. - Had to keep an extra "play" because older Firefox didn't appear to deliver the events when starting. check-in: f14fa0930f user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to html/top.html.

25
26
27
28
29
30
31





32
33
34
35
    <button onclick="return seek(60);">+1m</button>
    <button onclick="return seek(600);">+10m</button>
    <button onclick="return playNext();">>next</button>
   </td>
  </tr>
 </table>
 <hr>





 <span id="browser"></span>
 <script src="/js/player.js"></script>
</body>
</html>







>
>
>
>
>




25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
    <button onclick="return seek(60);">+1m</button>
    <button onclick="return seek(600);">+10m</button>
    <button onclick="return playNext();">>next</button>
   </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>

Changes to js/player.js.

9
10
11
12
13
14
15



16
17
18
19
20
21
22
..
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

// File/dir browsing
var browser = document.getElementById("browser");

// Show the queue of tracks
var pqueue = document.getElementById("pqueue");




// The playlist queue
var playlist = [];

// Current browsing path, and how "deep" we are down into it
var path = "";
var pdepth = 0;
// This will be path's contents; it goes to null while
................................................................................
var pcontents = null;

// Do we have something on the turntable right now?
var playing = false;

// Answer back on dir contents
function gotDir(req) {
    var d, f;

    // Connection progress
    if ((req.readyState != 4) || (req.status != 200)) {
        return;
    }

    // Decode JSON
    pcontents = JSON.parse(req.responseText);


    // Paint file browsing window
    var res = '<button onclick="return go_up();">\n'
    res += ' <img src="/imgs/player_eject.png" alt="Go Up" />\n'
    res += '</button>' + path + "<br>\n"




    // 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() + ');">'







>
>
>







 







|









>

<
|
|
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
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

// File/dir browsing
var browser = document.getElementById("browser");

// Show the queue of tracks
var pqueue = document.getElementById("pqueue");

// Where to stash text of current track path
var trackname = document.getElementById("trackname");

// The playlist queue
var playlist = [];

// Current browsing path, and how "deep" we are down into it
var path = "";
var pdepth = 0;
// This will be path's contents; it goes to null while
................................................................................
var pcontents = null;

// Do we have something on the turntable right now?
var playing = false;

// Answer back on dir contents
function gotDir(req) {
    var d, f, res;

    // Connection progress
    if ((req.readyState != 4) || (req.status != 200)) {
        return;
    }

    // Decode JSON
    pcontents = JSON.parse(req.responseText);

    //
    // 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() + ');">'