<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Akshat Gupta</title>
    <description>The latest articles on DEV Community by Akshat Gupta (@akshatvg).</description>
    <link>https://dev.to/akshatvg</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F528861%2F4acae1b3-4c8d-4285-81b1-f91e298cf396.jpeg</url>
      <title>DEV Community: Akshat Gupta</title>
      <link>https://dev.to/akshatvg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akshatvg"/>
    <language>en</language>
    <item>
      <title>Building a Raise-Your-Hand Feature for Live Streams Using the Agora Web SDK</title>
      <dc:creator>Akshat Gupta</dc:creator>
      <pubDate>Thu, 04 Nov 2021 01:19:05 +0000</pubDate>
      <link>https://dev.to/akshatvg/request-to-be-promoted-during-a-live-video-streaming-using-the-agora-web-sdk-fmf</link>
      <guid>https://dev.to/akshatvg/request-to-be-promoted-during-a-live-video-streaming-using-the-agora-web-sdk-fmf</guid>
      <description>&lt;p&gt;Being a community-driven developer, I conduct educational webinars on live streams. At the end of each session I leave time for doubt-solving. These sessions are very hard to execute smoothly, because often several participants text on the meeting chat asking to clear their doubts at the same time. This makes it difficult to keep track of issues that any one person is facing  and to ask follow-up questions.&lt;/p&gt;

&lt;p&gt;What's needed is a way to briefly talk directly to a participant, outside of the chat.&lt;/p&gt;

&lt;p&gt;In this tutorial, we will develop a web application where a user can send a request for a role promotion, giving the host the option to accept or decline the request. On approval, the user would be called onto the live stream as a speaker. We will use the &lt;a href="https://docs.agora.io/en/Video/downloads?platform=Web" rel="noopener noreferrer"&gt;Agora Web SDK&lt;/a&gt; and the &lt;a href="https://docs.agora.io/en/Real-time-Messaging/API%20Reference/RTM_web/v1.0.0/index.html" rel="noopener noreferrer"&gt;Agora RTM SDK&lt;/a&gt; to build this sample app:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbnarc1k0qapqkdd359qp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbnarc1k0qapqkdd359qp.png" alt="Screenshot of the project we will be developing in this tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Prerequisites
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;  Basic knowledge of how to work with JavaScript, JQuery, Bootstrap, and Font Awesome&lt;/li&gt;
&lt;li&gt;  Agora Developer Account - Sign up &lt;a href="https://sso.agora.io/en/signup?utm_source=medium&amp;amp;utm_medium=blog&amp;amp;utm_campaign=building-a-raise-your-hand-feature-for-live-streams-using-the-agora-web-sdk" rel="noopener noreferrer"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Know how to use the &lt;a href="https://docs.agora.io/en/Video/downloads?platform=Web" rel="noopener noreferrer"&gt;Agora Web SDK&lt;/a&gt; and the &lt;a href="https://docs.agora.io/en/Real-time-Messaging/API%20Reference/RTM_web/v1.0.0/index.html" rel="noopener noreferrer"&gt;Agora RTM SDK&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Project Setup
&lt;/h1&gt;

&lt;p&gt;We will build on our &lt;a href="https://www.agora.io/en/blog/build-your-own-many-to-many-live-video-streaming-using-the-agora-web-sdk/" rel="noopener noreferrer"&gt;existing project&lt;/a&gt;: &lt;a href="https://www.agora.io/en/blog/build-your-own-many-to-many-live-video-streaming-using-the-agora-web-sdk/" rel="noopener noreferrer"&gt;Build Your Own Many To Many, Live Video Streaming Using the Agora Web SDK.&lt;/a&gt; You can begin by cloning this project’s &lt;a href="https://github.com/akshatvg/Agora-Many-to-Many-Live-Streaming-SDK-NG" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;. You will now have a project that looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjm7687ontxxvfgj3gj6s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjm7687ontxxvfgj3gj6s.png" alt="Screenshot of the Agora Many to Many, Live Video Streaming UI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have difficulty understanding what the above code does, see &lt;a href="https://www.agora.io/en/blog/build-your-own-many-to-many-live-video-streaming-using-the-agora-web-sdk/" rel="noopener noreferrer"&gt;this tutorial&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I have added code for entering a user’s name to the UI and the JavaScript file. &lt;/p&gt;

&lt;p&gt;You now have a fully functional, video live streaming application, with muting and unmuting capabilities.&lt;/p&gt;

&lt;h1&gt;
  
  
  What do I do when someone raises their hand?
&lt;/h1&gt;

&lt;p&gt;We will send channel messages using the &lt;a href="https://docs.agora.io/en/Real-time-Messaging/API%20Reference/RTM_web/v1.0.0/index.html" rel="noopener noreferrer"&gt;Agora RTM SDK&lt;/a&gt; whenever someone raises or lowers their hand. This way, even if there are multiple hosts, all hosts will be notified and any host can promote the user or deny their request.&lt;/p&gt;

&lt;p&gt;We listen for a button click event by an audience member. Whenever someone clicks the &lt;strong&gt;Raise Hand&lt;/strong&gt; button, we toggle the text as well as the functions connected to the button. We also update the state of the global variable that we created to track whether a user’s hand is raised or not.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h1&gt;
  
  
  How do I promote or reject someone after I receive their request?
&lt;/h1&gt;

&lt;p&gt;Since we want to promote or reject only the user who sends a request, we send the user acceptance and rejection updates through a peer message.&lt;/p&gt;

&lt;p&gt;If the peer message received asks the user to change their role to a host, the user rejoins the channel as a host.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;We have the application’s structure laid out and can now test the application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; For testing, you can use two or more browser tabs to simulate multiple users on the call.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;h2&gt;
  
  
  You did it!
&lt;/h2&gt;

&lt;p&gt;You have successfully made a request-based role promotion service inside a web live streaming application. In case you weren’t coding along or want to see the complete, finished product, I have uploaded all the code to GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/akshatvg/Agora-Invite-User-To-Stage" rel="noopener noreferrer"&gt;https://github.com/akshatvg/Agora-Invite-User-To-Stage&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can check out the demo of the code in action:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://handraise.akshatvg.com" rel="noopener noreferrer"&gt;https://handraise.akshatvg.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for taking the time to read my tutorial. If you have questions, please let me know with a comment. If you see room for improvement, feel free to fork the repo and make a pull request!&lt;/p&gt;

&lt;h1&gt;
  
  
  Other Resources
&lt;/h1&gt;

&lt;p&gt;To learn more about the Agora Web SDK and other use cases, see the developer guide &lt;a href="https://docs.agora.io/en/Video/landing-page?platform=Webhttps://docs.agora.io/en" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://agoraio-community.github.io/AgoraWebSDK-NG/api/en/index.html" rel="noopener noreferrer"&gt;https://agoraio-community.github.io/AgoraWebSDK-NG/api/en/index.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.agora.io/en/Real-time-Messaging/API%20Reference/RTM_web/v1.0.0/index.html" rel="noopener noreferrer"&gt;https://docs.agora.io/en/Real-time-Messaging/API%20Reference/RTM_web/v1.0.0/index.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.agora.io/en/Real-time-Messaging/messaging_web?platform=Web" rel="noopener noreferrer"&gt;https://docs.agora.io/en/Real-time-Messaging/messaging_web?platform=Web&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.agora.io" rel="noopener noreferrer"&gt;https://www.agora.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.agora.io/en/blog/build-your-own-many-to-many-live-video-streaming-using-the-agora-web-sdk" rel="noopener noreferrer"&gt;https://www.agora.io/en/blog/build-your-own-many-to-many-live-video-streaming-using-the-agora-web-sdk&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also join our Slack channel:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.agora.io/en/join-slack" rel="noopener noreferrer"&gt;https://www.agora.io/en/join-slack&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agora</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>webrtc</category>
    </item>
    <item>
      <title>Build a Live Translated Transcriptions Service in Your Video Call Web App</title>
      <dc:creator>Akshat Gupta</dc:creator>
      <pubDate>Sun, 24 Oct 2021 11:48:49 +0000</pubDate>
      <link>https://dev.to/akshatvg/build-a-live-translated-transcriptions-service-within-your-video-call-web-app-4dhl</link>
      <guid>https://dev.to/akshatvg/build-a-live-translated-transcriptions-service-within-your-video-call-web-app-4dhl</guid>
      <description>&lt;p&gt;Learn how to make a real-time translation service using the Agora Web SDK and Google Cloud.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Doing business globally is a goal for almost every company. The chance to scale up to an international level can increase profits but may require knowledge of multiple languages to communicate with clients or partners from around the world.&lt;/p&gt;

&lt;p&gt;Getting an interpreter to help translate multilingual video conferences is impractical, because it may be annoying and will make the meetings longer than needed. You may also want to keep some information confidential.&lt;/p&gt;

&lt;p&gt;In this tutorial, we will develop a web application that supports speech-to-text transcription and translation using JavaScript’s &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API" rel="noopener noreferrer"&gt;Web Speech API&lt;/a&gt;, the &lt;a href="https://docs.agora.io/en/Video/downloads?platform=Web" rel="noopener noreferrer"&gt;Agora Web SDK&lt;/a&gt;, the &lt;a href="https://docs.agora.io/en/Real-time-Messaging/API%20Reference/RTM_web/v1.0.0/index.html" rel="noopener noreferrer"&gt;Agora RTM SDK&lt;/a&gt;, and the &lt;a href="https://cloud.google.com/translate/docs/basic/quickstart#translate_translate_text-drest" rel="noopener noreferrer"&gt;Google Cloud Translation API&lt;/a&gt; to avoid dependency on translators and remove the language barrier during video calls.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbb7m0kiqq5mi5wqf6i0u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbb7m0kiqq5mi5wqf6i0u.png" alt="Screenshot of the project we will be developing in this tutorial"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Basic knowledge of how to work with JavaScript, JQuery, Bootstrap, and Font Awesome&lt;/li&gt;
&lt;li&gt;Agora Developer Account - Sign up &lt;a href="https://sso.agora.io/en/signup?utm_source=medium&amp;amp;utm_medium=blog&amp;amp;utm_campaign=build-a-live-translated-transcriptions-service-your-video-call-web-app" rel="noopener noreferrer"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Know how to use the &lt;a href="https://docs.agora.io/en/Video/downloads?platform=Web" rel="noopener noreferrer"&gt;Agora Web SDK&lt;/a&gt; and the &lt;a href="https://docs.agora.io/en/Real-time-Messaging/API%20Reference/RTM_web/v1.0.0/index.html" rel="noopener noreferrer"&gt;Agora RTM SDK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://console.cloud.google.com/" rel="noopener noreferrer"&gt;Google Cloud account&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Understand how to make requests and receive responses from REST APIs&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Project Setup
&lt;/h2&gt;

&lt;p&gt;We will build on our &lt;a href="https://www.agora.io/en/blog/building-your-own-transcription-service-within-a-video-call-web-app/" rel="noopener noreferrer"&gt;existing project&lt;/a&gt;: &lt;a href="https://www.agora.io/en/blog/building-your-own-transcription-service-within-a-video-call-web-app/" rel="noopener noreferrer"&gt;Building Your Own Transcription Service Within a Video Call Web App&lt;/a&gt;. You can begin by cloning this project’s &lt;a href="https://github.com/akshatvg/Agora-Transcription" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;. You will now have a project that looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy43man750jyv25eeds09.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy43man750jyv25eeds09.png" alt="Screenshot of the Agora Transcription Service UI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will now remove the self-note related HTML and the extra buttons. If you face difficulties understanding what the above code does, see &lt;a href="https://www.agora.io/en/blog/building-your-own-transcription-service-within-a-video-call-web-app/" rel="noopener noreferrer"&gt;this tutorial&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I have also added code for muting and unmuting video and audio to the video calling application. You can learn more about muting and unmuting from &lt;a href="https://docs.agora.io/en/Video/API%20Reference/web_ng/interfaces/icameravideotrack.html?platform=Web#setenabled" rel="noopener noreferrer"&gt;the Agora documentation&lt;/a&gt;. Your code will now look like &lt;a href="https://github.com/akshatvg/Agora-Translated-Transcription/tree/starter" rel="noopener noreferrer"&gt;this&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You now have a fully functional transcription service along with muting and unmuting capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding Real-Time Translation to Our Application
&lt;/h2&gt;

&lt;p&gt;We will now add the following code into our HTML file under the existing input field row and add an option for a user to enter their Google Cloud project's API key.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ght06rmg802fa67sgrl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ght06rmg802fa67sgrl.png" alt="Screenshot of how our application looks after adding the new row"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a Google Cloud Translation API Key
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In the Cloud Console, go to the &lt;strong&gt;&lt;a href="https://console.cloud.google.com/projectselector/iam-admin/serviceaccounts/create?supportedpurview=project" rel="noopener noreferrer"&gt;Create service account page&lt;/a&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select a project.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Service account name&lt;/strong&gt; field, enter a name. The Cloud Console completes the &lt;strong&gt;Service account ID&lt;/strong&gt; field based on this name.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Service account description&lt;/strong&gt; field, enter a description. For example, &lt;strong&gt;Agora Live Translated Transcription&lt;/strong&gt;. &lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create and Continue&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffacn6alxdsbmcx8hm3ky.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffacn6alxdsbmcx8hm3ky.png" alt="Screenshot of the page where you can create a service account"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the &lt;strong&gt;Select a role&lt;/strong&gt; field and choose the &lt;strong&gt;Cloud Translation API Admin&lt;/strong&gt; role.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9of8kneh5he0krxalhx5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9of8kneh5he0krxalhx5.png" alt="Screenshot of the role set screen for service accounts"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click &lt;strong&gt;Continue&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Done&lt;/strong&gt; to finish creating the service account.&lt;/li&gt;
&lt;li&gt;Enable the Cloud Translation API from &lt;a href="https://console.cloud.google.com/marketplace/product/google/translate.googleapis.com?q=search&amp;amp;referrer=search&amp;amp;project=agora-328918" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbwm6cx7sjypu2ihqo26j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbwm6cx7sjypu2ihqo26j.png" alt="Enable the Translation API on GCP"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the &lt;strong&gt;Credentials&lt;/strong&gt; tab in the left sidebar, and then click on &lt;strong&gt;Create Credentials&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Create and copy the generated API Key.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6bzcpiy6enisfibpsrbb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6bzcpiy6enisfibpsrbb.png" alt="The generated API key has to be copied from this page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Core Functionality (JS)
&lt;/h2&gt;

&lt;p&gt;Now that we have the basic structure laid out as well as the keys generated, we can begin adding functionality to the translation service. It may look intimidating at first, but if you follow GCP’s &lt;a href="https://cloud.google.com/translate/docs/basic/quickstart#translate_translate_text-drest" rel="noopener noreferrer"&gt;official docs&lt;/a&gt;, it’ll be a piece of cake.&lt;/p&gt;

&lt;p&gt;The code below takes in the user’s inputted GCP key and the user’s preferred transcription language. As soon as the user stops speaking, their words are transcribed in the chosen language using JavaScript’s Web Speech API. &lt;br&gt;
This same message is sent in the speaker’s language to all users through the Agora RTM SDK. When this message is received, we check for the receiver’s preferred language and use the Google Translate API to convert the original sent message to user-understandable text. This way, even if the remote user has a different language from the local user, the logic would still work as expected.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjlop49x3fd53tatloxh9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjlop49x3fd53tatloxh9.png" alt="Screenshot of the demo from the user's perspective."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; For testing, you can use two or more browser tabs to simulate multiple users on the call.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;h3&gt;
  
  
  You did it!
&lt;/h3&gt;

&lt;p&gt;You have successfully made a multilingual transcription service inside a web video call application. In case you weren’t coding along or want to see the finished product all together, I have uploaded all the code to GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/akshatvg/Agora-Translated-Transcription" rel="noopener noreferrer"&gt;https://github.com/akshatvg/Agora-Translated-Transcription&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can check out the demo of the code in action:&lt;br&gt;
&lt;a href="https://translation.akshatvg.com" rel="noopener noreferrer"&gt;https://translation.akshatvg.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for taking the time to read my tutorial. If you have questions, please let me know with a comment. If you see room for improvement, feel free to fork the repo and make a pull request!&lt;/p&gt;

&lt;h2&gt;
  
  
  Other Resources
&lt;/h2&gt;

&lt;p&gt;To learn more about the Agora Web SDK and other use cases, see the developer guide &lt;a href="https://docs.agora.io/en/Video/landing-page?platform=Web" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.agora.io/en" rel="noopener noreferrer"&gt;https://docs.agora.io/en&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://agoraio-community.github.io/AgoraWebSDK-NG/api/en/index.html" rel="noopener noreferrer"&gt;https://agoraio-community.github.io/AgoraWebSDK-NG/api/en/index.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.agora.io/en/Real-time-Messaging/API%20Reference/RTM_web/v1.0.0/index.html" rel="noopener noreferrer"&gt;https://docs.agora.io/en/Real-time-Messaging/API%20Reference/RTM_web/v1.0.0/index.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.agora.io/en/Real-time-Messaging/messaging_web?platform=Web" rel="noopener noreferrer"&gt;https://docs.agora.io/en/Real-time-Messaging/messaging_web?platform=Web&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.agora.io/" rel="noopener noreferrer"&gt;https://www.agora.io/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.agora.io/en/blog/building-your-own-transcription-service-within-a-video-call-web-app/" rel="noopener noreferrer"&gt;https://www.agora.io/en/blog/building-your-own-transcription-service-within-a-video-call-web-app/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also join our Slack channel:&lt;br&gt;
&lt;a href="https://www.agora.io/en/join-slack/" rel="noopener noreferrer"&gt;Join Slack&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agora</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>translation</category>
    </item>
    <item>
      <title>Connecting to Agora with Tokens in the Web — React</title>
      <dc:creator>Akshat Gupta</dc:creator>
      <pubDate>Sun, 24 Oct 2021 11:48:19 +0000</pubDate>
      <link>https://dev.to/akshatvg/connecting-to-agora-with-tokens-in-the-web-react-5d12</link>
      <guid>https://dev.to/akshatvg/connecting-to-agora-with-tokens-in-the-web-react-5d12</guid>
      <description>&lt;p&gt;Keep your application secure and authenticated.&lt;/p&gt;

&lt;p&gt;When you’re building a Real-Time Engagement application, security is of key importance (pun intended). Making sure users’ audio/video is visible only to the intended recipients is critical. Using the Agora Voice or Video SDK, you can easily add another layer of security to your app with the help of tokens.&lt;/p&gt;

&lt;p&gt;In this tutorial, we’ll take a look at how to fetch tokens from a server and use them to join a video/voice channel in React. You can deploy your own server to generate tokens, or you can use either this &lt;a href="https://github.com/AgoraIO-Community/TokenServer-nodejs"&gt;Node&lt;/a&gt; or &lt;a href="https://github.com/AgoraIO-Community/agora-token-service"&gt;GoLang&lt;/a&gt; example. We’ll be using the Node token server in our tutorial, and you can easily deploy the same server by following the instructions. You can also use our latest GoLang example. A Docker image is also available for this example.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Jp3sAESd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1400/1%2ANctB5dOz29H_k3aKcUkq3w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Jp3sAESd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1400/1%2ANctB5dOz29H_k3aKcUkq3w.png" alt="Deploy the token server using a one-click deploy." width="880" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Prerequisites
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;  Agora Developer Account - Sign up &lt;a href="https://sso.agora.io/en/signup?utm_source=medium&amp;amp;utm_medium=blog&amp;amp;utm_campaign=connecting-to-agora-with-tokens-on-web"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Know how to use the &lt;a href="https://docs.agora.io/en/Video/downloads?platform=Web"&gt;Agora Web SDK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  A basic understanding of React&lt;/li&gt;
&lt;li&gt;  An Agora token server&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To get us up to speed with a basic video calling app, let’s use this &lt;a href="https://github.com/prakhar0912/agora-gc"&gt;demo&lt;/a&gt;. You can follow the instructions in the &lt;code&gt;README.md&lt;/code&gt; file to get the app working on your device. We’ll be discussing the code for fetching and updating tokens below. If you just want a working demo, you can check the &lt;a href="https://github.com/prakhar0912/agora-gc/tree/tokens"&gt;tokens branch&lt;/a&gt; for the final outcome.&lt;/p&gt;

&lt;h1&gt;
  
  
  Connecting with Tokens
&lt;/h1&gt;

&lt;p&gt;We’ll make a GET request to our server (running locally or on a remote server) with our channel name  and  UID before we start the call using the &lt;code&gt;join&lt;/code&gt; method. We’ll use fetch to make our request and obtain our token. Our server responds with &lt;code&gt;{“token”:”&amp;lt;TOKEN HERE&amp;gt;”}&lt;/code&gt;. We get the token value from the JSON and pass it as the third parameter in our &lt;code&gt;join&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Xrho3h35--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f0ycier4l0b7nl00rpjw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Xrho3h35--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f0ycier4l0b7nl00rpjw.png" alt="Response from our token server." width="880" height="739"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;:&lt;/em&gt;  We’re using the URL structure found in &lt;a href="https://github.com/AgoraIO-Community/TokenServer-nodejs"&gt;the sample token server&lt;/a&gt;.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h1&gt;
  
  
  Staying Connected
&lt;/h1&gt;

&lt;p&gt;All tokens have an expiry. The length of time until they expire is set by the token server. Or it can be set as a parameter sent in the request. For example, &lt;code&gt;URL/access_token?channel=channel-test&amp;amp;uid=0&amp;amp;expiredTs=60&lt;/code&gt; would set the expiry as 60 seconds for uid 0 in channel-test for the token server we’re using.&lt;/p&gt;

&lt;p&gt;When a connected user’s token is set to expire in 30 seconds, we receive a &lt;code&gt;token-privilege-will-expire&lt;/code&gt; event. We can set an event handler to update the token before it expires, avoiding any interruption in the connection. Once we’ve obtained a new token, we can use the &lt;code&gt;renewToken&lt;/code&gt; method to renew our token. We’ll add the listener in our init method.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Creating an app id with token security and adding a few lines of code can make your application secure. If you want to learn about how the demo app works, see this &lt;a href="https://www.agora.io/en/blog/build-a-video-calling-app-using-agora-in-a-react-project/"&gt;tutorial&lt;/a&gt;. And if you want to look at other features, see the &lt;a href="https://docs.agora.io/en/Video/API%20Reference/react_native/index.html"&gt;API Reference&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can check out the demo of the code in action:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/prakhar0912/agora-gc/tree/tokens"&gt;https://github.com/prakhar0912/agora-gc/tree/tokens&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://agora-tokens.akshatvg.com"&gt;https://agora-tokens.akshatvg.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for taking the time to read my tutorial. If you have questions, please let me know with a comment. If you see room for improvement, feel free to fork the repo and make a pull request!&lt;/p&gt;

&lt;h1&gt;
  
  
  Vanilla JavaScript Implementation
&lt;/h1&gt;

&lt;p&gt;I have also implemented the same in Vanilla JS using fetch to make our request. You can check out the code for this on:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/akshatvg/Agora-Token-Service/tree/vanilla-js"&gt;https://github.com/akshatvg/Agora-Token-Service/tree/vanilla-js&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The demo code in action:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://agora-token-vanilla.akshatvg.com"&gt;https://agora-token-vanilla.akshatvg.com&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Other Resources
&lt;/h1&gt;

&lt;p&gt;To learn more about the Agora Web SDK and other use cases, see the developer guide &lt;a href="https://docs.agora.io/en/Video/landing-page?platform=Web"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.agora.io/en"&gt;https://docs.agora.io/en&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://agoraio-community.github.io/AgoraWebSDK-NG/api/en/index.html"&gt;https://agoraio-community.github.io/AgoraWebSDK-NG/api/en/index.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.agora.io/"&gt;https://www.agora.io/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also join our Slack channel:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.agora.io/en/join-slack"&gt;https://www.agora.io/en/join-slack&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agora</category>
      <category>webdev</category>
      <category>authentication</category>
      <category>react</category>
    </item>
  </channel>
</rss>
