This file contains 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
using UnityEngine; | |
using UnityEngine.UI; | |
using UnityEngine.Networking; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class CloudRecordController : MonoBehaviour | |
{ | |
[SerializeField] | |
string ServerURL = default; |
This file contains 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
using UnityEngine; | |
using System; | |
// Returns json {"resourceId":"xxxx", "sid":"yyy", "serverResponse":{"status":5,"fileList":"zzzz.m3u8","fileListMode":"string","sliceStartTime":1606357122528} } | |
[Serializable] | |
public class CloudRecordResponseModel | |
{ | |
public string resourceId; |
This file contains 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
<?php | |
require_once("config.php"); | |
$curl = curl_init(); | |
// Receive ResourceID and sid from client | |
$ResourceID = $_POST["resourceId"]; | |
$Channel = $_POST["channel"]; |
This file contains 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
<?php | |
require_once("config.php"); | |
$curl = curl_init(); | |
// Receive ResourceID and sid from client | |
$ResourceID = $_POST["resourceId"]; | |
$Channel = $_POST["sid"]; | |
curl_setopt_array($curl, array( |
This file contains 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
<?php | |
require_once("config.php"); | |
$curl = curl_init(); | |
// Receive ResourceID from client | |
$ResourceID = $_POST["resourceId"]; | |
$Channel = $_POST["channel"]; |
This file contains 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
<?php | |
require_once("config.php"); | |
$Channel = $_POST["channel"]; | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => "https://api.agora.io/v1/apps/$AppID/cloud_recording/acquire", | |
CURLOPT_RETURNTRANSFER => true, |
This file contains 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
<?php | |
// Agora | |
$AppID = ""; | |
$CustomerID=""; | |
$CustomerSecret=""; | |
$AuthSecret = base64_encode("$CustomerID:$CustomerSecret"); | |
// You define | |
$RecUID = "889988"; |
This file contains 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
using UnityEngine; | |
using agora_gaming_rtc; | |
public class AgoraApiHandlersImpl | |
{ | |
private IRtcEngine mRtcEngine; | |
public AgoraApiHandlersImpl(IRtcEngine engine) | |
{ | |
mRtcEngine = engine; |
This file contains 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
void SetupUI() | |
{ | |
GameObject go = GameObject.Find("MyView"); | |
myView = go.AddComponent<VideoSurface>(); | |
go = GameObject.Find("LeaveButton"); | |
go?.GetComponent<Button>()?.onClick.AddListener(Leave); | |
go = GameObject.Find("JoinButton"); | |
go?.GetComponent<Button>()?.onClick.AddListener(Join); | |
} |
This file contains 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
void Join() | |
{ | |
mRtcEngine.EnableVideo(); | |
mRtcEngine.EnableVideoObserver(); | |
myView.SetEnable(true); | |
mRtcEngine.JoinChannel(ChannelName, "", 0); | |
} | |
void Leave() | |
{ |