Updated insecure-js tutorial to fit with docker deployment

This commit is contained in:
csantosm 2020-09-30 15:52:33 +02:00
parent 49e44db216
commit dcdb9f06fd
5 changed files with 14 additions and 9 deletions

View File

@ -1,7 +1,5 @@
FROM nginx:1.19.2-alpine
ARG OPENVIDU_TUTORIALS_VERSION
RUN apk update && \
# apk add wget && \
rm -rf /var/cache/apk/*

View File

@ -0,0 +1,10 @@
version: '3.1'
services:
app:
image: openvidu/openvidu-insecure-js-demo:2.15.0
restart: on-failure
network_mode: host
environment:
- OPENVIDU_URL=http://localhost:5443
- OPENVIDU_SECRET=${OPENVIDU_SECRET}

View File

@ -3,9 +3,7 @@
[ ! -z "${OPENVIDU_URL}" ] && echo "OPENVIDU_URL: ${OPENVIDU_URL}" || echo "OPENVIDU_URL: default"
[ ! -z "${OPENVIDU_SECRET}" ] && echo "OPENVIDU_SECRET: ${OPENVIDU_SECRET}" || echo "OPENVIDU_SECRET: default"
if [ ! -z "${OPENVIDU_URL}" ]; then
sed -i "s/^var OPENVIDU_SERVER_URL =.*$/var OPENVIDU_SERVER_URL = \"$(echo "${OPENVIDU_URL}" | sed 's#/#\\/#g')\";/" /var/www/openvidu-insecure-js/app.js
fi
sed -i "s/^var OPENVIDU_SERVER_URL =.*$/var OPENVIDU_SERVER_URL = \"$(echo https://\" + location.hostname | sed 's#/#\\/#g');/" /var/www/openvidu-insecure-js/app.js
if [ ! -z "${OPENVIDU_SECRET}" ]; then
sed -i "s/^var OPENVIDU_SERVER_SECRET =.*$/var OPENVIDU_SERVER_SECRET = \"${OPENVIDU_SECRET}\";/" /var/www/openvidu-insecure-js/app.js

View File

@ -1,6 +1,5 @@
server {
listen 80;
server_name localhost;
listen 5442;
root /var/www/openvidu-insecure-js;
}

View File

@ -67,7 +67,7 @@ function joinSession() {
publishVideo: true, // Whether you want to start publishing with your video enabled or not
resolution: '640x480', // The resolution of your video
frameRate: 30, // The frame rate of your video
insertMode: 'APPEND', // How the video is inserted in the target element 'video-container'
insertMode: 'APPEND', // How the video is inserted in the target element 'video-container'
mirror: false // Whether to mirror your local video or not
});
@ -97,7 +97,7 @@ function leaveSession() {
session.disconnect();
// Removing all HTML elements with user's nicknames.
// Removing all HTML elements with user's nicknames.
// HTML videos are automatically removed when leaving a Session
removeAllUserData();