Add TURN support
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
8561b9c6c6
commit
7312b279ea
21
src/main.js
21
src/main.js
|
@ -59,5 +59,26 @@ app.provide('trackers', [
|
|||
'ws://hub.bugout.link:80/announce'
|
||||
])
|
||||
|
||||
app.provide('rtcConfig', {
|
||||
iceServers: [
|
||||
{
|
||||
urls: [
|
||||
'stun:stun.l.google.com:19302',
|
||||
'stun:global.stun.twilio.com:3478'
|
||||
]
|
||||
},
|
||||
{
|
||||
urls: [
|
||||
'turn:relay.instant.io:443?transport=udp',
|
||||
'turn:relay.instant.io:443?transport=tcp',
|
||||
'turns:relay.instant.io:443?transport=tcp'
|
||||
],
|
||||
username: 'relay.instant.io',
|
||||
credential: 'nepal-cheddar-baize-oleander'
|
||||
}
|
||||
],
|
||||
sdpSemantics: 'unified-plan'
|
||||
})
|
||||
|
||||
// Render to DOM.
|
||||
app.mount('#app')
|
||||
|
|
|
@ -58,6 +58,7 @@ export default {
|
|||
setup () {
|
||||
const toast = useToast()
|
||||
const trackers = inject('trackers')
|
||||
const rtcConfig = inject('rtcConfig')
|
||||
var webTorrent = null
|
||||
var wireUpdateHandle = null
|
||||
const player = ref(null)
|
||||
|
@ -79,7 +80,7 @@ export default {
|
|||
const wireStatistics = reactive([])
|
||||
|
||||
onMounted(() => {
|
||||
webTorrent = new WebTorrent()
|
||||
webTorrent = new WebTorrent({ tracker: { rtcConfig: rtcConfig } })
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
|
|
|
@ -64,6 +64,7 @@ export default {
|
|||
const router = useRouter()
|
||||
const toast = useToast()
|
||||
const trackers = inject('trackers')
|
||||
const rtcConfig = inject('rtcConfig')
|
||||
var webTorrent = null
|
||||
var wireUpdateHandle = null
|
||||
const player = ref(null)
|
||||
|
@ -93,7 +94,7 @@ export default {
|
|||
})
|
||||
|
||||
onMounted(() => {
|
||||
webTorrent = new WebTorrent()
|
||||
webTorrent = new WebTorrent({ tracker: { rtcConfig: rtcConfig } })
|
||||
downloadVideo(props.id)
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue