-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewer.html
42 lines (39 loc) · 1.08 KB
/
viewer.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
<video id="preloadoa" style="visibility: hidden;" preload="auto"></video>
<div id="oa">
<!--ここにオンエア要素が動的生成される-->
</div>
<script>
const addConnection = (connection) => {};
navigator.presentation.receiver.connectionList.then((list) => {
list.connections.forEach((connection) => {
addConnection(connection);
});
list.onconnectionavailable = (evt) => {
addConnection(evt.connection);
};
});
var oav = document.getElementById("oa");
var poav = document.getElementById("preload");
function prd(ur1){
poav.src=ur1;
}
function change(){
function change() {
var oac = document.createElement('video');
oac.src = poav.src;
oac.id = 'mplayer';
navigator.presentation.requestSession().then((session) => {
session.send(oac);
oac.play();
oac.addEventListener('ended', function() {
endach();
}, false);
}).catch((error) => {
console.error(error.name + ': ' + error.message);
});
}
}
function endach(){
alert("終了");
}
</script>