how to stop live streaming pushed by obs studio - javascript

I was built a rmpt server successfully, and it worked well,but there is a thing, if here is a button which said 'stop the live' and users click on it will stop the live streaming.
My question is how to break the connection between rtmp server and obs studio?
I have already tried to delete the folder when clicked the 'stop live' botton,but the same folder created after and live is still streaming.

Related

How to run my video call app integrated with ms Teams to run in background

We have created a webrtc video call application using node Js and loaded it into internet using heroku. When i have added the webrtc call to ms-teams app using App studio as a Tab and allowing device preferences. we have added the app and when i open chat section in ms teams, the video call gets disconnected as the iframe gets flushed when we go away from it.if we can use any other alternatives to have it run even in background so that when i go to chat and come back to webrtc it should be running.Any help is appreciated.

Editing a Chrome Extention

So i use this extension to record my online classes using a remote desktop .
it works perfect but when i stop my connection to the remote computer the recording stops.
i saw this post
In this post the answer says to use the Chrome extension source viewer
i tried it but i couldn't wrap my head around the code.
one thing i found is that the extension sends a runtime message called "RECORDING_STOPPED" when recording ends and when i disconnect my remote desktop connection it apparently sends it that time also
i checked the /static/js/main.c502a7e6.js file Line : 16 , Column : 4875 as the line is quite long i didn't understand it

How to know if web app and executable app both are active at same time

I have a web app something like slack which is used for chatting and when user is offline then we send the notification that "you have a new message". The notification is html5 push notification, so it works when user has not opened web app.
I have recently created an executable app for people who chat all day. But problem is that when a new message is coming : notification coming from exe app and browser both.
So my question is : Can we find if web app and exe app both are active in one device? So that we can supress one of the notification. Does a pc have something like common id which we can access from javascript in browser and executable too?
Note :- I have information stored in server that web app is active and exe is active, i only need to find if they are from same device.
Thanks in advance. Please let me know your solution.
After a lot of hit and trial with different solutions - I found a solution.
I am embedding a http server in the exe app which let me communicate with web app. In the web app, i have added a web worker, which will ping the exe app server every 10 sec. If response received means exe app is active, then i turn off the notification on server by calling api. This will also make sure when the exe app is quitted, web worker wont get any response means exe is not active, so it activates the notification.
Now another issue was that - after installing the app, user didn't open the web app and he is getting two notification still. For overcoming this - i open the web app url when the exe app starts for the first time and it detects the status and turn off the browser notification. In the same process - i also save the browserId (a unique guid to identify the browser ) to the exe app and whenever exe app starts, i call the api to turn off the notification for these browserId.
Hope this helps someone.

PWA javascript event on aux cable removed

I'm currently working on a progressive web app to play music (like Spotify or Google Play Music). I came upon a few things I'm not quite sure how to accomplish.
One of them is the feature that the music stopps playing as soon as the aux cable is removed from the phone. Is there a Javascript event or something similar I can attach an event handler to to dispatch the 'pause' action once the aux jack is removed?
You will not have such hardware event listener in PWA just with JS.
If you have the option to ask the user to install an service(like some app asks to install barcode scanner service to scan barcode in their app), you can create a helper class like in this solution, which will have an indent filter for aux like in this solution, when detected aux remove event, calls your PWA indent code, which pauses the music.
As an addition; I ran into some more issues discussed in this post regarding media notifications.
Implementing a hidden <audio> element allowed me to display those notifications with controls on them. Once I hooked up all of the controls (onPause, onPlay, skip, seek, ..) the device would automatically execute the onPause event once the cable has been removed from the device. This might be an Android or Chrome specific feature but it did the trick and was suitable for me.

Keep WebSocket alive in Mobile Safari

Is it possible to keep a html 5 web pages WebSocket connection open in Mobile-Safari once the screen is locked?
I want to send my users continuous updates throughout the day and it seems silly that their screens should always have to be unlocked to receive those notifications.
Are there any other options?
I don't think it's possible to keep the connection open while the browser is in the background, or when the screen is locked, the reason being that the app is essentially frozen in memory. Here's a quote from a similar question:
the reason you cant keep a network socket open, is that without your app jumping to the foreground when it receives a connection, it cannot respond to network traffic(because if it is not in the foreground its memory content is frozen).
However, I did find this page on Push Notifications for Websites that shows you 'how to sign up your users to receive notifications even when your site is not running in Safari'.
There are some other options: if you want to send continuous updates, you could write an app and either follow the instructions on Apple's site to keep a socket open permanently, or you could configure the app to implement Push Notifications.
I'm sorry I couldn't find a quick fix, but I hope at least one of these options works for you!
I have found a hacky way to keep WebSocket alive in Mobile Safari.
Basically it's the same solution as for this question.
Create an infinity looping audio file to keep Javascript running:
<audio loop src="http://www.sousound.com/music/healing/healing_01.mp3"></audio>
Note: some user interaction is required to initiate the audio file.
It would be nice if a WebSocket kept the browser alive in the same manner as an audio or video file.
PS this also works on Android.

Categories