wplayer

Check-in [ff191ae03e]
Login

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

Overview
Comment:Simplify; use autoplay
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:ff191ae03e7387c1d8ab14ee6cbfc1cf7952b2ad3ab1cb1504495e36c0816159
User & Date: ajv-899-334-8894@vsta.org 2016-02-01 15:30:07
Context
2016-02-03
19:05
Trying to keep Tin browser on Android to keep playing when it's in background w. screen off. Didn't help, but I'm leaving it in for now. check-in: 58ddb4e0b6 user: ajv-899-334-8894@vsta.org tags: master, trunk
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to html/top.html.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<body>
 <textarea rows="8" cols="80" readonly id="pqueue"></textarea>
 <hr>
 <span id="nowplaying"></span><br>
 <table>
  <tr>
   <td>
    <audio controls id="player" style="text-align: center;"></audio>
   </td>
  </tr>
  <tr>
   <td>
    <button onclick="return seek(-600);">-10m</button>
    <button onclick="return seek(-60);">-1m</button>
    <button onclick="return seek(-10);">-10s</button>







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<body>
 <textarea rows="8" cols="80" readonly id="pqueue"></textarea>
 <hr>
 <span id="nowplaying"></span><br>
 <table>
  <tr>
   <td>
    <audio controls autoplay id="player" style="text-align: center;"></audio>
   </td>
  </tr>
  <tr>
   <td>
    <button onclick="return seek(-600);">-10m</button>
    <button onclick="return seek(-60);">-1m</button>
    <button onclick="return seek(-10);">-10s</button>

Changes to js/player.js.

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
...
172
173
174
175
176
177
178
179
180
181
182
    if (newTime >= 0) {
	player.currentTime = newTime;
    }
}

// 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;
    }
}

// Callback; media is ready, start the audio
function playNow() {
    player.play();
}

// Add file to playlist (or play if playlist empty)
function go_file(fidx) {
    // Working on a previous click
    if (pcontents == null) {
	return false;
    }

................................................................................
    pdepth += 1;
    curdir();
    return false;
}

// Set up the player
player.addEventListener("ended", playNext);
player.addEventListener("loadeddata", playNow);

// Initial browser window update
curdir();







<
<
<
<












<
<
<
<
<







 







<



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
...
163
164
165
166
167
168
169

170
171
172
    if (newTime >= 0) {
	player.currentTime = newTime;
    }
}

// End of current track, try to advance
function playNext() {




    if (playlist.length > 0) {
	var s =  playlist.shift();
	player.src = s;
	nowplaying.textContent = unescape(s);
	paintQueue();
	playing = true;
    } else {
	nowplaying.textContent = '';
	playing = false;
    }
}






// Add file to playlist (or play if playlist empty)
function go_file(fidx) {
    // Working on a previous click
    if (pcontents == null) {
	return false;
    }

................................................................................
    pdepth += 1;
    curdir();
    return false;
}

// Set up the player
player.addEventListener("ended", playNext);


// Initial browser window update
curdir();