diff --git a/README.md b/README.md index 9c9a5c41be819df297ace5322dbfe06eb62e39f7..458e76be582ebe1568784ea87f9e83af779331a4 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ You need to set some environment variables to run the container. * BBB_SHOW_CHAT - shows the chat on the left side of the window (Default: false) * BBB_RESOLUTION - the streamed/downloaded resolution (Default: 1920x1080) * BBB_CHAT_MESSAGE - prefix for the message that would be posted to BBB chat, while joining a conference (Default: "This meeting is streamed to") +* BBB_STREAMVIEW_URL - post the viewing URL for the STREAM in the BBB chat (Default: "Secret URL") * TZ - Timezone (Default: Europe/Vienna) #### Chat settings diff --git a/examples/docker-compose.yml.example b/examples/docker-compose.yml.example index c23165fec98cf8d65d6f31997cc02d2b507d076a..47743f6402a00a94836b10c1376a57ea0db6b46a 100644 --- a/examples/docker-compose.yml.example +++ b/examples/docker-compose.yml.example @@ -31,6 +31,8 @@ services: - BBB_STREAM_URL=rtmp://media_server_url/stream/stream_key # Message to post in BBB Chat when joining a conference - BBB_CHAT_MESSAGE=This meeting is streamed to + # post the viewing URL for the STREAM in the BBB chat (Default: "Secret URL") + - BBB_STREAMVIEW_URL=https://yourStream.url # Resolution to be streamed/downloaded in format WxH (default 1920x1080) - BBB_RESOLUTION=1920x1080 # stream video bitrate diff --git a/startStream.sh b/startStream.sh index 9f70127163fb44f0bb9cfc0aaae2f341db06b887..084c0c28fd8e0e6cabace1245fc1f2b42fb5886a 100644 --- a/startStream.sh +++ b/startStream.sh @@ -86,10 +86,17 @@ then DEV_SHM_USAGE='--browser-disable-dev-shm-usage' fi +STREAMVIEW_URL=""; +if [ "${BBB_STREAMVIEW_URL}" != "" ] +then + STREAMVIEW_URL="--streamviewUrl ${BBB_STREAMVIEW_URL}"; +fi + + if [ "${BBB_ENABLE_CHAT}" = "true" ] then xvfb-run -n 133 --server-args="-screen 0 1280x720x24" python3 chat.py -s ${BBB_URL} -p ${BBB_SECRET} -i "${BBB_MEETING_ID}" -r ${BBB_REDIS_HOST} -u "${BBB_CHAT_NAME}" -c ${BBB_REDIS_CHANNEL} $START_MEETING $ATTENDEE_PASSWORD $MODERATOR_PASSWORD $DEV_SHM_USAGE -T "$MEETING_TITLE" & sleep 10 fi -xvfb-run -n 122 --server-args="-screen 0 ${RESOLUTION}x24" python3 stream.py -s ${BBB_URL} -p ${BBB_SECRET} -i "${BBB_MEETING_ID}" -u "${BBB_USER_NAME}" -r "${RESOLUTION}" ${SHOW_CHAT} $START_MEETING $ATTENDEE_PASSWORD $MODERATOR_PASSWORD $DEV_SHM_USAGE -T "$MEETING_TITLE" $STREAM_MEETING $CHAT_STREAM_URL $CHAT_STREAM_MESSAGE $INTRO $BEGIN_INTRO $END_INTRO $DOWNLOAD_MEETING; +xvfb-run -n 122 --server-args="-screen 0 ${RESOLUTION}x24" python3 stream.py -s ${BBB_URL} -p ${BBB_SECRET} -i "${BBB_MEETING_ID}" -u "${BBB_USER_NAME}" -r "${RESOLUTION}" ${SHOW_CHAT} $START_MEETING $ATTENDEE_PASSWORD $MODERATOR_PASSWORD $DEV_SHM_USAGE -T "$MEETING_TITLE" $STREAM_MEETING $CHAT_STREAM_URL $CHAT_STREAM_MESSAGE $INTRO $BEGIN_INTRO $END_INTRO $DOWNLOAD_MEETING $STREAMVIEW_URL; diff --git a/stream.py b/stream.py index 190f0e7981e39619a28cafdf1a105d2b1df19987..ec2580dcdf88e86c7a79a380f43d8dbc9b245490 100644 --- a/stream.py +++ b/stream.py @@ -42,6 +42,7 @@ parser.add_argument("-u","--user", help="Name to join the meeting",default="Live parser.add_argument("-t","--target", help="RTMP Streaming URL") parser.add_argument("--chatUrl", help="Streaming URL to display in the chat", default=False) parser.add_argument("--chatMsg", nargs='+', help="Message to display in the chat before Streaming URL", default=False) +parser.add_argument("--streamviewUrl", help="Streaming View URL do display in the chat", default=False) parser.add_argument("-c","--chat", help="Show the chat",action="store_true") parser.add_argument("-r","--resolution", help="Resolution as WxH", default='1920x1080') parser.add_argument('--ffmpeg-stream-threads', help='Threads to use for ffmpeg streaming', type=int, @@ -148,13 +149,16 @@ def bbb_browser(): # ensure chat is enabled (might be locked by moderator) if element.is_enabled() and chat_send.is_enabled(): tmp_chatMsg = os.environ.get('BBB_CHAT_MESSAGE', "This meeting is streamed to") + tmp_streamviewUrl = os.environ.get('BBB_STREAMVIEW_URL', "Secret URL") if not tmp_chatMsg in [ 'false', 'False', 'FALSE' ]: tmp_chatUrl = args.target.partition('//')[2].partition('/')[0] if args.chatUrl: tmp_chatUrl = args.chatUrl + if args.streamviewUrl: + tmp_streamviewUrl = args.streamviewUrl if args.chatMsg: tmp_chatMsg = ' '.join(args.chatMsg).strip('"') - element.send_keys("{0}: {1}".format(tmp_chatMsg, tmp_chatUrl)) + element.send_keys("{0}: {1} {2}".format(tmp_chatMsg, tmp_chatUrl, tmp_streamviewUrl)) chat_send.click() if args.chat: