When I try to dispose of than remote side TRACK_REMOVED event is not called - lib-jitsi-meet

I am trying to remove the desktop track for all participants who joined the meeting but when I try to dispose of the track than not called the TRACK_REMOVED event listener.
If have some ideas please reply.
room.on(JitsiMeetJS.events.conference.TRACK_REMOVED, (track) => {
console.log("TRACK_REMOVED", track)
})
oldTrack.dispose();
My expectation is when I dispose of the track that time TRACK_REMOVED called for every participant's side also.

Related

Vue server side events and showing components

How can I use server side events(sse) in vue? I'm receiving sse from backend and I need to implement that when I receive first event, I will show ringing panel on screen. Then I can accept that call and then show different panel and when I click on hang up I will show again screen like before events. It will be a call centrum.
I created method for receieving and handling event.
setupStream(){
let evtSource = new EventSource('/hzs/events.sse')
evtSource.addEventListener('call_status', event => {
let data = JSON.parse(event.data)
this.channels.push(data);
}, false)
}
Now, when I call I get something like this:
Where first curly brackets are incoming call, second are after I pick up phone and last are after I hang up.
How can I use this in app and show for example green ringing bar on screen based on events? So for every event I need different UI components.
Do I need to use vuex?
Thanks

Target specific Element UI notification

I'm starting to use Element UI on a Vue app and can't see any obvious way to target a specific Notification instance.
As an example. I have a Vuex action that is triggering an info notification like so
Notification.info({
duration: 0,
title: 'Generating PDF',
message: 'Please standby...',
position: 'bottom-left'
})
Once I get a response from the rest of the action, I then want to dismiss that particular notification and replace it with another, but the options for a notification doesn't have even as much as an id option to tap into.
I can't be alone in having the need to target a specific notification instance?
According to the documentation of element ui:
Notification and this.$notify returns the current Notification
instance. To manually close the instance, you can call close on it.
Or Notification.closeAll to close all notifications at once

Sharepoint 2010 event receiver ItemUpdated fires twice

I attach three events to my CustomLists:
ItemAdded
ItemUpdated
ItemDeleting
On one list I have a workflow, which is changing columns in that list. So when I edit an entry in that list, the ItemUpdated-Event fires two times. On the other lists (without any workflows) my receiver is working fine.
How can I find out if a workflow called my event receiver?
Is there a difference between a workflow which fires the event, or a user who fires the event?
You can add hidden field to the list which is always sets by workflow (and only by workflow). Then you will see if workflow called the event receiver.
Or
You can create HandleEventFiring class in your workflow project and use DisableAllEventFiring and EnableAllEventFiring before and after updates in workflow
public class HandleEventFiring : SPItemEventReceiver
{
public void DisableAllEventFiring()
{
this.DisableEventFiring();
}
public void EnableAllEventFiring()
{
this.EnableEventFiring();
}
}
To answer your first question:
Yes, you can find your workflow. The easiest way would be to use the SharePointManager 2010 and
Navigate to your site collection is located
Lists -> [Your List] -> Event Receivers
Check each Event Receiver's properties and delete the event receiver that is firing twice.
I don't know if I understand your second question correctly, but here goes:
A workflow can be started manually by a user or automatically if a List Item is
Added
Updated or
Deleted
Other than that there is not much of a differance.

YII getFlashes() not deleting?

Before jumping in with an answer, please make sure you understand my scenario.
I have ajax calls that CREATE flashes.
I have other ajax calls that FETCH the flashes as JSON.
What is currently happening: I click a button which creates the flash. After which I run a ajax call that executes:
public function actionGetAllFlashesAsJSON() {
$flashMessages = Yii::app()->user->getFlashes(true);
$returnResult = array();
foreach ($flashMessages as $key => $value) {
$newItem = array();
$newItem['message'] = $value;
$newItem['kind'] = $key;
$returnResult[]= $newItem;
}
print json_encode($returnResult);
die();
}
My problem is, when I execute this function twice in a row, it still keeps returning the flashes. However, if I refresh the site, it shows the error, and then if I press refresh again, it's gone. My theory is that page refresh is causing some other kind of deletion of messages... but what? And how can I force the deletion of these messages after I receive the message in the above code?
More background info: I am using the flashes as ERROR messages, but i want them to appear at the top of my site AS THEY ARE CREATED. Flashes might get created via Ajax, so I have javascript running to check for new messages, and display them, but my problem is it shows the messages several times, because they are not getting deleted after calling getFlashes?
The flash messages are controlled by SESSION variables, which Yii destroys when the page is loaded (probably somewhere quite deep in the framework). You will have to manually destroy all the previous flash messages at the start of the ajax request
You can use: getFlashes() to get all the existing flash messages
For the other flash message methods have a look at the CWebUser docs here

Kill jquery ajax form submit

I am remotely submitting a form potentially several times in close succession. For this particular case, debouncing is not an option. I am looking for the jQuery equivalent of .abort() for remote forms submitted using .submit() so I can cancel all previous submissions when a new one is made.
Thanks in advance,
Garrett
What I did is attach to the beforeSend event of the form, store the xhr object as part of the form's data, and abort it if a new request is enqueued:
$('form').bind("ajax:beforeSend", function(evt, xhr) {
console.log('Enqueued new xhr request');
var prevXhr = $(this).data('current-xhr');
if (prevXhr) {
prevXhr.abort();
console.log('Aborting previous xhr request');
}
$(this).data('current-xhr', xhr);
});
And you can still use the :remote => true option in the form straightforward.
Maybe you could use jQuery .queue() to queue your submits and .clearQueue() to clear the queue when needed. Just an idea...
I don't understand your problem. If the form is submitted, a request is sent to the server... so, how can you abort that?
If by abort you mean, cancelling the processing of the response, just use a control variable that you increase/decrease to know if there are pending requests.
From the API: http://api.jquery.com/category/ajax/ you can't do that.