This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function initStopRecording(data) { | |
// Disable Stop Recording Button | |
const stopBtn = document.getElementById("stopRecording"); | |
// Enable Stop Recording button | |
stopBtn.disabled = false; | |
// Remove previous event listener | |
stopBtn.onclick = null; | |
// Initializing our event listener | |
stopBtn.onclick = async function () { | |
// Request backend to stop call recording |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.getElementById("startRecording").onclick = async function () { | |
let channelId = document.getElementById("channel").value; | |
// request your backend to start call recording. | |
startcall = await fetch(`${baseUrl}/api/start/call`, { | |
method: "post", | |
headers: { | |
"Content-Type": "application/json; charset=UTF-8", | |
Accept: "application/json", | |
}, | |
body: JSON.stringify({ channel: channelId }), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialize the start recording button | |
document.getElementById("startRecording").disabled = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _uid = await client.join(appId, channelId, token, uid); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let appId = document.getElementById("app-id").value; | |
let channelId = document.getElementById("channel").value; | |
let data = await getToken(channelId); | |
let token = data.rtc_token; | |
let uid = data.uid; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button id="startRecording" disabled=true>Start Recording</button> | |
<button id="stopRecording" disabled=true>Stop Recording</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getToken(channelName) { | |
const data = await fetch( | |
`${baseUrl}/api/get/rtc/${channelName}` | |
).then((response) => response.json()); | |
return data; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let baseUrl = "https://cloud-recorder.herokuapp.com"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:agora_token_example/screens/home_page.dart'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Agora 1:1 Video Call with Token Server', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:ui'; | |
import 'package:agora_token_example/widgets/call_function.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
import 'package:screenshot_and_share/screenshot_share.dart'; | |
class CallPage extends StatefulWidget { | |
final String userName; | |
final String channelName; |
NewerOlder