How to use "APP" in external_api.min.js

i wanted to add on function in external_api.min.js which take argument and execute

APP.conference._room.setLocalParticipantProperty(‘transcription_language’,argument);

for that i wanted to use App in external_api.min.js but how do i export the varible and use here …

APP is only valid inside the iframe, and external_api is the envelope. You need to create a command which you can listen on, and then add the extra functionality in Jitsi Meet.

If i make changes in external_api then should create build ??
and will it also reflect in min.js file

Then you need to rebuild the application, yeah. You can do that with make

Thank you :slight_smile:

as you said APP is only valid in iframe i wanted to execute one command which will change the subtitle how i can create that command any reference ??

Because i found only this way to change subtitle
APP.conference._room.setLocalParticipantProperty(‘transcription_language’,argument);

You can look at how other commands are implemented. See API.js. Basically you’ll send a message from the external API which will arrive at the app running inside the iframe and will execute the actual thing.

Should i remove min.js and again build the project ?

I had made changes iin existing function from API.js
‘pin-participant’: id => {

        logger.debug('Pin participant command received');

        sendAnalytics(createApiEvent('participant.pinned'));

        //APP.store.dispatch(pinParticipant(id));

        APP.conference._room.setLocalParticipantProperty('transcription_language',id);

    },

and calling like:
apiObj.pinParticipant(“hi-IN”);

and again build the project but nothing is happening

Did you deploy these changes to your own server? The changes in API.js need to be in your server, that’s not part of external API, it’s the other end of it.

YES i had done changes on server
which is located at jitsi-meet\modules\API\API.js

MEETING IS STARTING BUT Subtitle is not changing
AND I am accessing that external_api from my end
one button to called changeLanguage()

var apiObj = null;
function StartMeeting() {

const domain = “xxx.xxx.xxx”;

const options = {

roomName: "JitsiMeetAPIExample1236789010",

width: 700,

height: 700,

jwt: "token",

parentNode: document.querySelector("#jitsi-meet-conf-container"),

};

apiObj = new JitsiMeetExternalAPI(domain, options);

}

function changeLanguage() {

apiObj.pinParticipant(“hi-IN”);

// apiObj.captionChange(

// “APP.conference._room.setLocalParticipantProperty(‘transcription_language’,‘hi-IN’);”

// );

}

After making the changes, have you rebuilt the app bundle with make ?

Yes I had rebuild ,

don’t know it is miracle or what now it is working :sweat_smile:

Thank you so much for constant help and support …

can you do one more favor, i need list of subtitle supported by jitsi like for hindi it is (‘transcription_language’,‘hi-IN’)
for english
(‘transcription_language’,‘en-US’);
like i wanted to do for more language but could’t find the expression for other languages