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'
|
'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.
|
// Render to DOM.
|
||||||
app.mount('#app')
|
app.mount('#app')
|
||||||
|
|
|
@ -58,6 +58,7 @@ export default {
|
||||||
setup () {
|
setup () {
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
const trackers = inject('trackers')
|
const trackers = inject('trackers')
|
||||||
|
const rtcConfig = inject('rtcConfig')
|
||||||
var webTorrent = null
|
var webTorrent = null
|
||||||
var wireUpdateHandle = null
|
var wireUpdateHandle = null
|
||||||
const player = ref(null)
|
const player = ref(null)
|
||||||
|
@ -79,7 +80,7 @@ export default {
|
||||||
const wireStatistics = reactive([])
|
const wireStatistics = reactive([])
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
webTorrent = new WebTorrent()
|
webTorrent = new WebTorrent({ tracker: { rtcConfig: rtcConfig } })
|
||||||
})
|
})
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
|
|
@ -64,6 +64,7 @@ export default {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
const trackers = inject('trackers')
|
const trackers = inject('trackers')
|
||||||
|
const rtcConfig = inject('rtcConfig')
|
||||||
var webTorrent = null
|
var webTorrent = null
|
||||||
var wireUpdateHandle = null
|
var wireUpdateHandle = null
|
||||||
const player = ref(null)
|
const player = ref(null)
|
||||||
|
@ -93,7 +94,7 @@ export default {
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
webTorrent = new WebTorrent()
|
webTorrent = new WebTorrent({ tracker: { rtcConfig: rtcConfig } })
|
||||||
downloadVideo(props.id)
|
downloadVideo(props.id)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue