forked from podlove/html5-audio-driver
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
133 lines (119 loc) · 3.83 KB
/
index.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
<html>
<head>
<title>Podlove Html5 Audio Driver Test Env</title>
<!-- Google Fonts -->
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<!-- CSS Reset -->
<link rel="stylesheet" href="node_modules/normalize.css/normalize.css">
<!-- Milligram CSS minified -->
<link rel="stylesheet" href="node_modules/milligram/dist/milligram.css">
<style>
body {
padding: 1em;
}
.media video {
width: 100%;
height: auto;
}
td {
max-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="column">
<h1 id="title"></h1>
<div id="media-node" class="media"></div>
</div>
</div>
<div class="row">
<div class="column column-50">
<h3>Properties</h3>
<table>
<thead>
<th width="25%">property</th>
<th width="75%%">value</th>
</thead>
<tbody id="props"></tbody>
</table>
</div>
<div class="column column-50">
<h3>Audio Actions</h3>
<button id="load">load</button>
<button id="play">play</button>
<button id="pause">pause</button>
<button id="restart">restart</button>
<button id="mute">mute</button>
<button id="unmute">unmute</button>
<fieldset>
<label for="volume">Volume</label>
<input type="number" id="volume" placeholder="Volume" min="0" max="1" value="1" step="0.1">
<label for="rate">Rate</label>
<input type="number" id="rate" placeholder="Rate" value="1" min="0" max="4" step="0.1">
</fieldset>
<h3>Progress</h3>
<input id="progress" style="width: 100%" type="range" value="0" min="0" max="1" step="0.01" />
<div>
<button id="backward">-30</button>
<button id="forward">+30</button>
</div>
<h3>Audio Filters</h3>
<button id="mono">mono</button>
<button id="stereo">stereo</button>
</div>
</div>
</div>
<script type="module">
import audio from './example/audio';
import audioHls from './example/audio-hls';
import video from './example/video';
import videoHls from './example/video-hls';
import audioConnect from './example/audio-connect';
import liveHls from './example/live-hls';
import live from './example/live';
const title = document.getElementById('title')
const params = (new URL(location)).searchParams
const test = params.get('mode')
const modes = {
audio: {
title: 'Audio Driver',
fn: audio
},
'audio-hls': {
title: 'Audio Driver HLS',
fn: audioHls
},
video: {
title: 'Video Driver',
fn: video
},
'video-hls': {
title: 'Video Driver HLS',
fn: videoHls
},
'audio-connect': {
title: 'Audio Connect',
fn: audioConnect
},
'live-hls': {
title: 'Audio Driver HLS Live',
fn: liveHls
},
'live': {
title: 'Audio Driver Live',
fn: live
}
}
const mode = modes[test]
if (mode) {
title.innerText = mode.title
mode.fn();
}
</script>
</body>
</html>