mirror of
https://github.com/pion/webrtc.git
synced 2025-10-07 16:10:55 +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 )
|
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
||||||
|
|
||||||
CONTRIBUTORS=()
|
|
||||||
EXCLUDED_CONTIBUTORS=('John R. Bradley')
|
EXCLUDED_CONTIBUTORS=('John R. Bradley')
|
||||||
MISSING_CONTIBUTORS=()
|
MISSING_CONTIBUTORS=()
|
||||||
|
|
||||||
|
@@ -18,12 +18,12 @@ window.createDataChannel = name => {
|
|||||||
log(`${fullName}: has opened`)
|
log(`${fullName}: has opened`)
|
||||||
dc.onmessage = e => log(`${fullName}: '${e.data}'`)
|
dc.onmessage = e => log(`${fullName}: '${e.data}'`)
|
||||||
|
|
||||||
let ul = document.getElementById("ul-open");
|
let ul = document.getElementById('ul-open')
|
||||||
let li = document.createElement('li');
|
let li = document.createElement('li')
|
||||||
li.appendChild(document.createTextNode(`${fullName}: `))
|
li.appendChild(document.createTextNode(`${fullName}: `))
|
||||||
|
|
||||||
let btnSend = document.createElement("BUTTON")
|
let btnSend = document.createElement('BUTTON')
|
||||||
btnSend.appendChild(document.createTextNode("Send message"))
|
btnSend.appendChild(document.createTextNode('Send message'))
|
||||||
btnSend.onclick = () => {
|
btnSend.onclick = () => {
|
||||||
let message = document.getElementById('message').value
|
let message = document.getElementById('message').value
|
||||||
if (message === '') {
|
if (message === '') {
|
||||||
@@ -34,8 +34,8 @@ window.createDataChannel = name => {
|
|||||||
}
|
}
|
||||||
li.appendChild(btnSend)
|
li.appendChild(btnSend)
|
||||||
|
|
||||||
let btnClose = document.createElement("BUTTON")
|
let btnClose = document.createElement('BUTTON')
|
||||||
btnClose.appendChild(document.createTextNode("Close"))
|
btnClose.appendChild(document.createTextNode('Close'))
|
||||||
btnClose.onclick = () => {
|
btnClose.onclick = () => {
|
||||||
dc.close()
|
dc.close()
|
||||||
ul.removeChild(li)
|
ul.removeChild(li)
|
||||||
@@ -47,12 +47,10 @@ window.createDataChannel = name => {
|
|||||||
ul.removeChild(li)
|
ul.removeChild(li)
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.appendChild(li);
|
ul.appendChild(li)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let sendChannel = window.createDataChannel('foo')
|
|
||||||
|
|
||||||
pc.oniceconnectionstatechange = e => log(`ICE state: ${pc.iceConnectionState}`)
|
pc.oniceconnectionstatechange = e => log(`ICE state: ${pc.iceConnectionState}`)
|
||||||
pc.onicecandidate = event => {
|
pc.onicecandidate = event => {
|
||||||
if (event.candidate === null) {
|
if (event.candidate === null) {
|
||||||
@@ -63,7 +61,6 @@ pc.onicecandidate = event => {
|
|||||||
pc.onnegotiationneeded = e =>
|
pc.onnegotiationneeded = e =>
|
||||||
pc.createOffer().then(d => pc.setLocalDescription(d)).catch(log)
|
pc.createOffer().then(d => pc.setLocalDescription(d)).catch(log)
|
||||||
|
|
||||||
|
|
||||||
window.startSession = () => {
|
window.startSession = () => {
|
||||||
let sd = document.getElementById('remoteSessionDescription').value
|
let sd = document.getElementById('remoteSessionDescription').value
|
||||||
if (sd === '') {
|
if (sd === '') {
|
||||||
|
@@ -27,7 +27,6 @@ static gboolean gstreamer_receive_bus_call(GstBus *bus, GstMessage *msg, gpointe
|
|||||||
g_printerr("Error: %s\n", error->message);
|
g_printerr("Error: %s\n", error->message);
|
||||||
g_error_free(error);
|
g_error_free(error);
|
||||||
exit(1);
|
exit(1);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
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_printerr("Error: %s\n", error->message);
|
||||||
g_error_free(error);
|
g_error_free(error);
|
||||||
exit(1);
|
exit(1);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -71,7 +70,7 @@ void gstreamer_send_start_pipeline(GstElement *pipeline, int pipelineId) {
|
|||||||
s->pipelineId = pipelineId;
|
s->pipelineId = pipelineId;
|
||||||
|
|
||||||
GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
|
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);
|
gst_object_unref(bus);
|
||||||
|
|
||||||
GstElement *appsink = gst_bin_get_by_name(GST_BIN(pipeline), "appsink");
|
GstElement *appsink = gst_bin_get_by_name(GST_BIN(pipeline), "appsink");
|
||||||
|
Reference in New Issue
Block a user