[mirotalksfu] - first release
هذا الالتزام موجود في:
40
api/README.md
Normal file
40
api/README.md
Normal file
@@ -0,0 +1,40 @@
|
||||

|
||||
|
||||
## Create a meeting
|
||||
|
||||
Create a meeting with a `HTTP request` containing the `API_KEY` sent to MiroTalk’s server. The response contains a `meeting` URL that can be `embedded` in your client within an `iframe`.
|
||||
|
||||
```bash
|
||||
# js
|
||||
node meeting.js
|
||||
# php
|
||||
php meeting.php
|
||||
# python
|
||||
python meeting.py
|
||||
# bash
|
||||
./meeting.sh
|
||||
```
|
||||
|
||||
## Embed a meeting
|
||||
|
||||
Embedding a meeting into a `service` or `app` requires using an `iframe` with the `src` attribute specified as the `meeting` from `HTTP response`.
|
||||
|
||||
```html
|
||||
<iframe
|
||||
allow="camera; microphone; fullscreen; display-capture; autoplay"
|
||||
src="https://localhost:3010/join/room_name"
|
||||
style="height: 100%; width: 100%; border: 0px;"
|
||||
></iframe>
|
||||
```
|
||||
|
||||
## Fast Integration
|
||||
|
||||
Develop your `website` or `application`, and bring `video meetings` in with a simple `iframe`.
|
||||
|
||||
```html
|
||||
<iframe
|
||||
allow="camera; microphone; fullscreen; display-capture; autoplay"
|
||||
src="https://localhost:3010/newroom"
|
||||
style="height: 100%; width: 100%; border: 0px;"
|
||||
></iframe>
|
||||
```
|
||||
22
api/meeting.js
Normal file
22
api/meeting.js
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
const API_KEY = 'mirotalksfu_default_secret';
|
||||
const MIROTALK_URL = 'http://localhost:3010/api/v1/meeting';
|
||||
|
||||
function getResponse() {
|
||||
return fetch(MIROTALK_URL, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
authorization: API_KEY,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
getResponse().then(async (res) => {
|
||||
console.log('Status code:', res.status);
|
||||
const data = await res.json();
|
||||
console.log('meeting:', data.meeting);
|
||||
});
|
||||
24
api/meeting.php
Normal file
24
api/meeting.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
$API_KEY = "mirotalksfu_default_secret";
|
||||
$MIROTALK_URL = "http://localhost:3010/api/v1/meeting";
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $MIROTALK_URL);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
|
||||
$headers = [
|
||||
'authorization:' . $API_KEY,
|
||||
'Content-Type: application/json'
|
||||
];
|
||||
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
$response = curl_exec($ch);
|
||||
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
echo "Status code: $httpcode \n";
|
||||
$data = json_decode($response);
|
||||
echo "meeting: ", $data->{'meeting'}, "\n";
|
||||
19
api/meeting.py
Normal file
19
api/meeting.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import requests
|
||||
import json
|
||||
|
||||
API_KEY = "mirotalksfu_default_secret"
|
||||
MIROTALK_URL = "http://localhost:3010/api/v1/meeting"
|
||||
|
||||
headers = {
|
||||
"authorization": API_KEY,
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
response = requests.post(
|
||||
MIROTALK_URL,
|
||||
headers=headers
|
||||
)
|
||||
|
||||
print("Status code:", response.status_code)
|
||||
data = json.loads(response.text)
|
||||
print("meeting:", data["meeting"])
|
||||
9
api/meeting.sh
Executable file
9
api/meeting.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
API_KEY="mirotalksfu_default_secret"
|
||||
MIROTALK_URL="http://localhost:3010/api/v1/meeting"
|
||||
|
||||
curl $MIROTALK_URL \
|
||||
--header "authorization: $API_KEY" \
|
||||
--header "Content-Type: application/json" \
|
||||
--request POST
|
||||
ثنائية
api/restAPI.png
Normal file
ثنائية
api/restAPI.png
Normal file
ملف ثنائي غير معروض.
|
بعد العرض: | الارتفاع: | الحجم: 13 KiB |
المرجع في مشكلة جديدة
حظر مستخدم