Lib-jitsi-meet - switch to desktop mode

Hi! I’m learning about lib-jitsi-meet to do a doctoral study using videoconferences.

I’m facing some problems to fire events to signal video changes from camera to desktop sharing.

I tried some approaches, but i think i’m doing something wrong.

Approach 1:

1.1 Remove old track from room [camera track]
1.2 Create a new track [desktop track]
1.3 Add new track into room

When i do this, TRACK_ADDED event is fired, but when i check if new track (passed in event parameter) is a camera or screen, returns camera.

Approach 2:

create new track [desktop track]
replace tracks (old to new).

No event is fired.

My problem is in event firing to discover changes (camera to screen) and modify my interface elements to do build appropriate visualization [display in fullscreen the screen share track].

There are any approach to convert camera track in desktop tracks?
Do you have some tips to signal those changes?

Thanks