mirror of
https://github.com/pion/webrtc.git
synced 2025-10-07 08:01:27 +08:00
Fix Codacy warnings
Run standardjs across all js files, fix all other issues by hand
This commit is contained in:
1
.github/assert-contributors.sh
vendored
1
.github/assert-contributors.sh
vendored
@@ -9,7 +9,6 @@ fi
|
||||
|
||||
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
||||
|
||||
CONTRIBUTORS=()
|
||||
EXCLUDED_CONTIBUTORS=('John R. Bradley')
|
||||
MISSING_CONTIBUTORS=()
|
||||
|
||||
|
@@ -18,12 +18,12 @@ window.createDataChannel = name => {
|
||||
log(`${fullName}: has opened`)
|
||||
dc.onmessage = e => log(`${fullName}: '${e.data}'`)
|
||||
|
||||
let ul = document.getElementById("ul-open");
|
||||
let li = document.createElement('li');
|
||||
let ul = document.getElementById('ul-open')
|
||||
let li = document.createElement('li')
|
||||
li.appendChild(document.createTextNode(`${fullName}: `))
|
||||
|
||||
let btnSend = document.createElement("BUTTON")
|
||||
btnSend.appendChild(document.createTextNode("Send message"))
|
||||
let btnSend = document.createElement('BUTTON')
|
||||
btnSend.appendChild(document.createTextNode('Send message'))
|
||||
btnSend.onclick = () => {
|
||||
let message = document.getElementById('message').value
|
||||
if (message === '') {
|
||||
@@ -34,8 +34,8 @@ window.createDataChannel = name => {
|
||||
}
|
||||
li.appendChild(btnSend)
|
||||
|
||||
let btnClose = document.createElement("BUTTON")
|
||||
btnClose.appendChild(document.createTextNode("Close"))
|
||||
let btnClose = document.createElement('BUTTON')
|
||||
btnClose.appendChild(document.createTextNode('Close'))
|
||||
btnClose.onclick = () => {
|
||||
dc.close()
|
||||
ul.removeChild(li)
|
||||
@@ -47,12 +47,10 @@ window.createDataChannel = name => {
|
||||
ul.removeChild(li)
|
||||
}
|
||||
|
||||
ul.appendChild(li);
|
||||
ul.appendChild(li)
|
||||
}
|
||||
}
|
||||
|
||||
let sendChannel = window.createDataChannel('foo')
|
||||
|
||||
pc.oniceconnectionstatechange = e => log(`ICE state: ${pc.iceConnectionState}`)
|
||||
pc.onicecandidate = event => {
|
||||
if (event.candidate === null) {
|
||||
@@ -63,7 +61,6 @@ pc.onicecandidate = event => {
|
||||
pc.onnegotiationneeded = e =>
|
||||
pc.createOffer().then(d => pc.setLocalDescription(d)).catch(log)
|
||||
|
||||
|
||||
window.startSession = () => {
|
||||
let sd = document.getElementById('remoteSessionDescription').value
|
||||
if (sd === '') {
|
||||
|
@@ -11,7 +11,7 @@ var log = msg => {
|
||||
document.getElementById('logs').innerHTML += msg + '<br>'
|
||||
}
|
||||
|
||||
navigator.mediaDevices.getUserMedia({video: true, audio: true})
|
||||
navigator.mediaDevices.getUserMedia({ video: true, audio: true })
|
||||
.then(stream => pc.addStream(document.getElementById('video1').srcObject = stream))
|
||||
.catch(log)
|
||||
|
||||
|
@@ -27,7 +27,7 @@ pc.onicecandidate = event => {
|
||||
}
|
||||
}
|
||||
|
||||
pc.createOffer({offerToReceiveVideo: true, offerToReceiveAudio: true}).then(d => pc.setLocalDescription(d)).catch(log)
|
||||
pc.createOffer({ offerToReceiveVideo: true, offerToReceiveAudio: true }).then(d => pc.setLocalDescription(d)).catch(log)
|
||||
|
||||
window.startSession = () => {
|
||||
let sd = document.getElementById('remoteSessionDescription').value
|
||||
|
@@ -11,7 +11,7 @@ var log = msg => {
|
||||
document.getElementById('logs').innerHTML += msg + '<br>'
|
||||
}
|
||||
|
||||
navigator.mediaDevices.getUserMedia({video: true, audio: true})
|
||||
navigator.mediaDevices.getUserMedia({ video: true, audio: true })
|
||||
.then(stream => pc.addStream(document.getElementById('video1').srcObject = stream))
|
||||
.catch(log)
|
||||
|
||||
|
@@ -19,7 +19,7 @@ window.createSession = isPublisher => {
|
||||
}
|
||||
|
||||
if (isPublisher) {
|
||||
navigator.mediaDevices.getUserMedia({video: true, audio: false})
|
||||
navigator.mediaDevices.getUserMedia({ video: true, audio: false })
|
||||
.then(stream => pc.addStream(document.getElementById('video1').srcObject = stream))
|
||||
.catch(log)
|
||||
pc.onnegotiationneeded = e => {
|
||||
@@ -28,7 +28,7 @@ window.createSession = isPublisher => {
|
||||
.catch(log)
|
||||
}
|
||||
} else {
|
||||
pc.createOffer({offerToReceiveVideo: true})
|
||||
pc.createOffer({ offerToReceiveVideo: true })
|
||||
.then(d => pc.setLocalDescription(d))
|
||||
.catch(log)
|
||||
|
||||
|
@@ -27,7 +27,6 @@ static gboolean gstreamer_receive_bus_call(GstBus *bus, GstMessage *msg, gpointe
|
||||
g_printerr("Error: %s\n", error->message);
|
||||
g_error_free(error);
|
||||
exit(1);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
|
@@ -31,7 +31,6 @@ static gboolean gstreamer_send_bus_call(GstBus *bus, GstMessage *msg, gpointer d
|
||||
g_printerr("Error: %s\n", error->message);
|
||||
g_error_free(error);
|
||||
exit(1);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
@@ -71,7 +70,7 @@ void gstreamer_send_start_pipeline(GstElement *pipeline, int pipelineId) {
|
||||
s->pipelineId = pipelineId;
|
||||
|
||||
GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
|
||||
guint bus_watch_id = gst_bus_add_watch(bus, gstreamer_send_bus_call, NULL);
|
||||
gst_bus_add_watch(bus, gstreamer_send_bus_call, NULL);
|
||||
gst_object_unref(bus);
|
||||
|
||||
GstElement *appsink = gst_bin_get_by_name(GST_BIN(pipeline), "appsink");
|
||||
|
Reference in New Issue
Block a user