-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
29 changed files
with
945 additions
and
112 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.43 MB
classes/jsp/assets/drums/gospel-latin-1_98_2449_9796_2449_2449_4898.drum
Binary file not shown.
Binary file added
BIN
+3.24 MB
classes/jsp/assets/drums/gospel-latin-2_98_2449_9796_2449_2449_4898.drum
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<!-- | ||
This example demonstrates how to publish a stream without libraries or dependencies. | ||
--> | ||
|
||
<html> | ||
<head> | ||
<title>publisher</title> | ||
<script src="./js/stophe.min.js"></script> | ||
</head> | ||
|
||
<body> | ||
<button onclick="window.publishStream()"> Publish Stream </button> | ||
|
||
<h3> Video </h3> | ||
<audio id="audioPlayer" autoplay muted controls style="width: 500"> </audio> | ||
|
||
<h3> Connection State </h3> | ||
<div id="connectionState"></div> <br /> | ||
</body> | ||
|
||
<script> | ||
window.publishStream = async () => { | ||
window.connection = new Strophe.Connection(location.protocol.replace("http", "ws") + "//" + location.host + "/ws/"); | ||
|
||
window.connection.connect(location.hostname, null, async function (status) { | ||
console.debug("XMPPConnection.connect", status); | ||
|
||
if (status === Strophe.Status.CONNECTED) { | ||
window.connection.send($pres()); | ||
|
||
let mediaOptions = {audio: true, video: false} | ||
|
||
let peerConnection = new RTCPeerConnection(); | ||
|
||
peerConnection.oniceconnectionstatechange = () => { | ||
document.getElementById('connectionState').innerText = peerConnection.iceConnectionState; | ||
} | ||
|
||
const stream = await navigator.mediaDevices.getUserMedia(mediaOptions); | ||
document.getElementById('audioPlayer').srcObject = stream; | ||
|
||
stream.getTracks().forEach(t => { | ||
if (t.kind === 'audio') { | ||
peerConnection.addTransceiver(t, {direction: 'sendonly'}) | ||
} | ||
}) | ||
|
||
const offer = await peerConnection.createOffer(); | ||
peerConnection.setLocalDescription(offer); | ||
|
||
window.connection.sendIQ($iq({type: 'set', to: window.connection.domain}).c('whip', {xmlns: 'urn:xmpp:whip:0'}).c('sdp', offer.sdp), | ||
function (res) { | ||
const answer = res.querySelector('sdp').innerHTML; | ||
peerConnection.setRemoteDescription({sdp: answer, type: 'answer'}); | ||
console.debug('whip answer', answer); | ||
|
||
}, function (err) { | ||
console.warn('whip failed', err); | ||
} | ||
); | ||
} | ||
else | ||
|
||
if (status === Strophe.Status.DISCONNECTED) { | ||
|
||
} | ||
}); | ||
} | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<!-- | ||
This example demonstrates how to watch a stream without libraries or dependencies. | ||
With this HTML you can add a 'Broadcast Box Player' to any site you want | ||
--> | ||
|
||
<html> | ||
<head> | ||
<title>audio-watcher</title> | ||
<script src="./js/stophe.min.js"></script> | ||
</head> | ||
|
||
<body> | ||
<b> Stream Key </b> <input type="text" id="streamKey" /> <br /> | ||
<button onclick="window.watchStream()"> Watch Stream </button> | ||
|
||
<h3> Audio </h3> | ||
<audio id="audioPlayer" autoplay controls style="width: 500"> </audio> | ||
|
||
<h3> Connection State </h3> | ||
<div id="connectionState"></div> <br /> | ||
</body> | ||
|
||
<script> | ||
window.watchStream = () => { | ||
window.connection = new Strophe.Connection(location.protocol.replace("http", "ws") + "//" + location.host + "/ws/"); | ||
|
||
window.connection.connect(location.hostname, null, function (status) { | ||
console.debug("XMPPConnection.connect", status); | ||
|
||
if (status === Strophe.Status.CONNECTED) { | ||
window.connection.send($pres()); | ||
|
||
setTimeout(() => { | ||
const streamKey = document.getElementById('streamKey').value | ||
|
||
if (streamKey === '') { | ||
return window.alert('Stream Key must not be empty') | ||
} | ||
|
||
let peerConnection = new RTCPeerConnection() | ||
peerConnection.addTransceiver('audio', { direction: 'recvonly' }) | ||
|
||
peerConnection.ontrack = function (event) { | ||
document.getElementById('audioPlayer').srcObject = event.streams[0] | ||
} | ||
|
||
peerConnection.oniceconnectionstatechange = () => { | ||
document.getElementById('connectionState').innerText = peerConnection.iceConnectionState; | ||
} | ||
|
||
peerConnection.createOffer().then(offer => { | ||
peerConnection.setLocalDescription(offer); | ||
console.debug('whep offer', offer.sdp); | ||
|
||
window.connection.sendIQ($iq({type: 'set', to: window.connection.domain}).c('whep', {id: streamKey, xmlns: 'urn:xmpp:whep:0'}).c('sdp', offer.sdp), | ||
function (res) { | ||
console.debug('whep response', res); | ||
const answer = res.querySelector('sdp').innerHTML; | ||
peerConnection.setRemoteDescription({sdp: answer, type: 'answer'}); | ||
console.debug('whep answer', answer); | ||
|
||
}, function (err) { | ||
console.warn('whep failed', err); | ||
} | ||
); | ||
}) | ||
}); | ||
} | ||
else | ||
|
||
if (status === Strophe.Status.DISCONNECTED) { | ||
|
||
} | ||
}); | ||
} | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.