Za aplikacije
Videopozivi za vašu aplikaciju
API i SDK za videopozive za Next.js, Laravel, Django i svaki drugi stack. Pozivi između dviju osoba zvone u svakoj kartici i aplikaciji pozvane osobe, uvijek se povezuju i šifrirani su s kraja na kraj, a zaslon poziva spreman je za upotrebu, pa ništa ne morate održavati.
Ili isprobajte demo uživo: otvorite ga u dva preglednika i nazovite iz jednoga u drugi.
Najbolje cijene za WebSockets, neograničeni pozivi 1 na 1 s TURN poslužiteljima diljem svijeta te grupni pozivi i prijenos uživo s uključenom kvotom. Od $11.99 mjesečno za 1.000 istodobnih veza uz godišnju naplatu, ili $14.99 uz mjesečnu naplatu.
Grupni pozivi iznad vašeg plana: $0.20 za 1.000 minuta, $0.10 sa zvukom.
Next.js na poslužitelju i React na stranici.
export async function GET( request: Request ) {
const me = await currentUserId();
const ask = new URL( request.url ).searchParams;
const to = ask.get( 'to' )!;
// Your own check, whatever your app needs.
if ( ! me || ! await mayCall( me, to ) ) {
return new Response( null, { status: 403 } );
}
const token = await realtime.callToken( me, to, {
type: ask.get( 'type' ),
} );
return Response.json( { token } );
}app.get( '/api/call-token', async ( req, res ) => {
const me = userOf( req );
const { to, type } = req.query;
// Your own check, whatever your app needs.
if ( ! me || ! await mayCall( me, to ) ) {
return res.sendStatus( 403 );
}
const token = await realtime.callToken( me, to, { type } );
res.json( { token } );
} );import { createServer } from 'node:http';
createServer( async ( req, res ) => {
const url = new URL( req.url, 'http://localhost' );
if ( url.pathname === '/api/call-token' ) {
const me = userOf( req );
const to = url.searchParams.get( 'to' );
// Your own check, whatever your app needs.
if ( ! me || ! await mayCall( me, to ) ) {
res.writeHead( 403 );
return res.end();
}
const token = await realtime.callToken( me, to, {
type: url.searchParams.get( 'type' ),
} );
res.writeHead( 200, { 'Content-Type': 'application/json' } );
return res.end( JSON.stringify( { token } ) );
}
// Your pages, and realtime.node( userOf ) for the SDK's routes.
} ).listen( 3000 );use Illuminate\Http\Request;
use WordPlus\Realtime\Laravel\Facades\Realtime;
Route::get( '/api/call-token', function ( Request $request ) {
$me = $request->user()->id;
$to = $request->query( 'to' );
// Your own check, whatever your app needs.
abort_unless( may_call( $me, $to ), 403 );
return [ 'token' => Realtime::callToken( $me, $to, [
'type' => $request->query( 'type' ),
] ) ];
} )->middleware( 'auth' );require __DIR__ . '/../src/realtime.php';
$me = current_user_id();
$to = $_GET['to'] ?? '';
// Your own check, whatever your app needs.
if ( ! $me || ! may_call( $me, $to ) ) {
http_response_code( 403 );
exit;
}
header( 'Content-Type: application/json' );
echo json_encode( [
'token' => $realtime->callToken( $me, $to, [
'type' => $_GET['type'] ?? null,
] ),
] );from django.contrib.auth.decorators import login_required
from django.http import HttpResponseForbidden, JsonResponse
from .realtime import realtime
# In urls.py: path("api/call-token", views.call_token)
@login_required
def call_token(request):
me = request.user.id
to = request.GET["to"]
# Your own check, whatever your app needs.
if not may_call(me, to):
return HttpResponseForbidden()
token = realtime.call_token(me, to, type=request.GET.get("type"))
return JsonResponse({"token": token})from fastapi import Depends, HTTPException
from realtime import realtime
@app.get("/api/call-token")
def call_token(
to: str,
type: str = "video",
me: int = Depends(current_user_id),
):
# Your own check, whatever your app needs.
if not me or not may_call(me, to):
raise HTTPException(403)
return {"token": realtime.call_token(me, to, type=type)}from flask import abort, request, session
from realtime import realtime
@app.get("/api/call-token")
def call_token():
me = session.get("user_id")
to = request.args["to"]
# Your own check, whatever your app needs.
if not me or not may_call(me, to):
abort(403)
kind = request.args.get("type")
return {"token": realtime.call_token(me, to, type=kind)}// http.HandleFunc("GET /api/call-token", callToken)
func callToken(w http.ResponseWriter, r *http.Request) {
me := userOf(r)
to := r.URL.Query().Get("to")
// Your own check, whatever your app needs.
if me == "" || !mayCall(me, to) {
w.WriteHeader(403)
return
}
kind := r.URL.Query().Get("type")
reply(w, map[string]string{
"token": app.CallToken(me, to, kind, profile(me)),
})
}Hookovi i komponente za svaku React aplikaciju, uz bilo koji poslužitelj gore.
import { connect } from '@wordplus/realtime';
const rt = await connect();
// The ring and the call window.
await rt.callScreen();
// And in the page:
// <call-button to="34" token-url="/api/call-token"
// type="video" name="Ann">
// Call Ann
// </call-button>import { connect } from '@wordplus/realtime';
const rt = await connect();
// The ring and the call window.
await rt.callScreen();
// And in the page:
// <call-button to="34" token-url="/api/call-token"
// type="video" name="Ann">
// Call Ann
// </call-button>import { connect } from '@wordplus/realtime';
const rt = await connect();
// The ring and the call window.
await rt.callScreen();
// And in the page:
// <call-button to="34" token-url="/api/call-token"
// type="video" name="Ann">
// Call Ann
// </call-button>import { connect } from '@wordplus/realtime';
const rt = await connect( window.wordplusRealtimeConfig );
// The ring and the call window.
await rt.callScreen();
// And in the page:
// <call-button to="34" token-url="/api/call-token"
// type="video" name="Ann">
// Call Ann
// </call-button><call-button to="34" token-url="/api/call-token"
type="video" name="Ann">
Call Ann
</call-button>
<script type="module">
import { connect } from '@wordplus/realtime';
const rt = await connect( window.wordplusRealtimeConfig );
// The ring and the call window.
await rt.callScreen();
</script><call-button to="34" token-url="/api/call-token"
type="video" name="Ann">
Call Ann
</call-button>
<script type="module">
import { connect } from '@wordplus/realtime';
const rt = await connect( window.wordplusRealtimeConfig );
// The ring and the call window.
await rt.callScreen();
</script><call-button to="34" token-url="/api/call-token"
type="video" name="Ann">
Call Ann
</call-button>
<script type="module">
import { connect } from '@wordplus/realtime';
const rt = await connect( window.wordplusRealtimeConfig );
// The ring and the call window.
await rt.callScreen();
</script><call-button to="34" token-url="/api/call-token"
type="video" name="Ann">
Call Ann
</call-button>
<script type="module">
import { connect } from '@wordplus/realtime';
const rt = await connect( window.wordplusRealtimeConfig );
// The ring and the call window.
await rt.callScreen();
</script>import { connect } from '@wordplus/realtime';
const settings = await fetch( '/api/realtime/config' );
const rt = await connect( await settings.json() );
// The ring and the call window.
await rt.callScreen();
// And in the page:
// <call-button to="34" token-url="/api/call-token"
// type="video" name="Ann">
// Call Ann
// </call-button><call-button to="34" token-url="/api/call-token"
type="video" name="Ann">
Call Ann
</call-button>
<script type="module">
// The ring and the call window.
await window.Echo.connector.rt.callScreen();
</script>'use client'; // in Next.js
import { CallButton, CallScreen } from '@wordplus/realtime/react';
// Inside <RealtimeProvider>, once for the whole app.
export function CallAnn() {
return (
<>
<CallScreen />
<CallButton to={ 34 } tokenUrl="/api/call-token"
type="video" name="Ann">
Call Ann
</CallButton>
</>
);
}<script setup>
import { onMounted } from 'vue';
// realtime.js, one connection for the whole app:
// export const realtime = connect();
import { realtime } from './realtime';
onMounted( async () => {
// The ring and the call window.
( await realtime ).callScreen();
} );
</script>
<!-- isCustomElement for these tags, in vite.config.js -->
<template>
<call-button to="34" token-url="/api/call-token"
type="video" name="Ann">
Call Ann
</call-button>
</template><script>
import { onMount } from 'svelte';
// realtime.js, one connection for the whole app:
// export const realtime = connect();
import { realtime } from './realtime';
onMount( async () => {
// The ring and the call window.
( await realtime ).callScreen();
} );
</script>
<call-button to="34" token-url="/api/call-token"
type="video" name="Ann">
Call Ann
</call-button>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
// realtime.ts, one connection for the whole app:
// export const realtime = connect();
import { realtime } from './realtime';
@Component( {
selector: 'app-call-ann',
schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
template: `
<call-button to="34" token-url="/api/call-token"
type="video" name="Ann">
Call Ann
</call-button>
`,
} )
export class CallAnnComponent {
async ngOnInit() {
// The ring and the call window.
( await realtime ).callScreen();
}
}import WordPlusRealtimeCalls
import WordPlusRealtimeUI
// Rings for every call coming in.
CallScreen.shared.attach(rt.calls)
// Your own request to your route.
let token = try await api.callToken(to: "34")
let call = try await rt.startCall(token)
CallScreen.shared.show(call, name: "Ann")import cloud.wordplus.realtime.calls.calls
import cloud.wordplus.realtime.calls.startCall
import cloud.wordplus.realtime.ui.CallScreen
// Rings for every call coming in.
CallScreen.attach(context, rt.calls(context))
// Your own request to your route.
val token = api.callToken(to = "34")
val call = rt.startCall(context, token)
CallScreen.show(context, call, name = "Ann")import {
CallButton, CallScreen, RealtimeProvider,
} from '@wordplus/realtime-react-native';
// Your server, in full, as an app has no address of its own.
const API = 'https://app.example.com/api';
const options = {
app: 's1500000007',
endpoint: API + '/realtime',
headers: { Authorization: 'Bearer ' + session.token },
};
export function App() {
return (
<RealtimeProvider options={ options }>
<CallScreen />
<CallButton to="34" tokenUrl={ API + '/call-token' }
type="video" name="Ann">
Call Ann
</CallButton>
</RealtimeProvider>
);
}import 'package:flutter/material.dart';
import 'package:wordplus_realtime/wordplus_realtime.dart';
// Your server, in full, as an app has no address of its own.
const api = 'https://app.example.com/api';
// Once, as your app starts.
final rt = await WordPlusRealtime.connect(
app: 's1500000007',
endpoint: '$api/realtime',
headers: {'Authorization': 'Bearer ${session.token}'},
);
// Rings for every call coming in, and shows it once answered.
await rt.callScreen();
// In your build:
CallButton(
rt: rt,
to: '34',
tokenUrl: '$api/call-token',
name: 'Ann',
child: const Text('Call Ann'),
)
Isprobajte video poziv
Pokrenite poziv ovdje, a javite se s mobitela ili iz drugog prozora. Račun nije potreban.
Ovo su zasloni koje SDK daje vašoj aplikaciji. Preglednik traži kameru i mikrofon, ništa se ne snima, a demo završava nakon 10 minuta.
Pozivi između dviju osoba
Svaki poziv se spaja
Poziv zvoni u svakoj kartici i aplikaciji koju pozvana osoba ima otvorenu i prestaje zvoniti posvuda čim se javi u jednoj od njih. Zatim ide najboljim putem koji dvije mreže dopuštaju, bez vašeg TURN poslužitelja koji biste morali održavati.
- IzravnoIzmeđu dvaju uređaja, na većini mreža. Najbrži put.
- Preko naših relejaKad vatrozid blokira izravni put. Odgovaraju na portovima weba, pa poziv prolazi svugdje gdje prolaze web stranice.
- Preko naših medijskih poslužiteljaKad ni releji ne mogu proći. Poziv prelazi tamo i nastavlja se, bez prekidanja.
Šifrirani s kraja na kraj na svakom putu i uključeni u svaki plan.
Gdje se pozivi spajaju
Naši releji i medijski poslužitelji rade blizu vaših korisnika, a svaki poziv ide preko onog koji je najbliži njegovim sudionicima.
Odlučuje vaš poslužitelj
Pokrenite, primite i vodite poziv
Tko smije zvati koga ovisi o vašoj aplikaciji. Vaš poslužitelj daje stranici token za svaki poziv koji dopušta, a stranica njime pokreće poziv, gumbom ili vašim vlastitim kodom. Evo poziva za Ann, zadatak po zadatak.
Next.js na poslužitelju i React na stranici.
Dajte stranici token
Tko smije zvati koga stvar je logike vaše aplikacije, pa to stoji u vašoj vlastitoj ruti. Provjerite što god vaša aplikacija treba, a zatim odgovorite tokenom. Token pokreće jedan poziv, a bez njega ništa ne zvoni. mayCall je vaša vlastita provjera.
export async function GET( request: Request ) {
const me = await currentUserId();
const ask = new URL( request.url ).searchParams;
const to = ask.get( 'to' )!;
// Your own check, whatever your app needs.
if ( ! me || ! await mayCall( me, to ) ) {
return new Response( null, { status: 403 } );
}
const token = await realtime.callToken( me, to, {
type: ask.get( 'type' ),
} );
return Response.json( { token } );
}app.get( '/api/call-token', async ( req, res ) => {
const me = userOf( req );
const { to, type } = req.query;
// Your own check, whatever your app needs.
if ( ! me || ! await mayCall( me, to ) ) {
return res.sendStatus( 403 );
}
const token = await realtime.callToken( me, to, { type } );
res.json( { token } );
} );import { createServer } from 'node:http';
createServer( async ( req, res ) => {
const url = new URL( req.url, 'http://localhost' );
if ( url.pathname === '/api/call-token' ) {
const me = userOf( req );
const to = url.searchParams.get( 'to' );
// Your own check, whatever your app needs.
if ( ! me || ! await mayCall( me, to ) ) {
res.writeHead( 403 );
return res.end();
}
const token = await realtime.callToken( me, to, {
type: url.searchParams.get( 'type' ),
} );
res.writeHead( 200, { 'Content-Type': 'application/json' } );
return res.end( JSON.stringify( { token } ) );
}
// Your pages, and realtime.node( userOf ) for the SDK's routes.
} ).listen( 3000 );use Illuminate\Http\Request;
use WordPlus\Realtime\Laravel\Facades\Realtime;
Route::get( '/api/call-token', function ( Request $request ) {
$me = $request->user()->id;
$to = $request->query( 'to' );
// Your own check, whatever your app needs.
abort_unless( may_call( $me, $to ), 403 );
return [ 'token' => Realtime::callToken( $me, $to, [
'type' => $request->query( 'type' ),
] ) ];
} )->middleware( 'auth' );require __DIR__ . '/../src/realtime.php';
$me = current_user_id();
$to = $_GET['to'] ?? '';
// Your own check, whatever your app needs.
if ( ! $me || ! may_call( $me, $to ) ) {
http_response_code( 403 );
exit;
}
header( 'Content-Type: application/json' );
echo json_encode( [
'token' => $realtime->callToken( $me, $to, [
'type' => $_GET['type'] ?? null,
] ),
] );from django.contrib.auth.decorators import login_required
from django.http import HttpResponseForbidden, JsonResponse
from .realtime import realtime
# In urls.py: path("api/call-token", views.call_token)
@login_required
def call_token(request):
me = request.user.id
to = request.GET["to"]
# Your own check, whatever your app needs.
if not may_call(me, to):
return HttpResponseForbidden()
token = realtime.call_token(me, to, type=request.GET.get("type"))
return JsonResponse({"token": token})from fastapi import Depends, HTTPException
from realtime import realtime
@app.get("/api/call-token")
def call_token(
to: str,
type: str = "video",
me: int = Depends(current_user_id),
):
# Your own check, whatever your app needs.
if not me or not may_call(me, to):
raise HTTPException(403)
return {"token": realtime.call_token(me, to, type=type)}from flask import abort, request, session
from realtime import realtime
@app.get("/api/call-token")
def call_token():
me = session.get("user_id")
to = request.args["to"]
# Your own check, whatever your app needs.
if not me or not may_call(me, to):
abort(403)
kind = request.args.get("type")
return {"token": realtime.call_token(me, to, type=kind)}// http.HandleFunc("GET /api/call-token", callToken)
func callToken(w http.ResponseWriter, r *http.Request) {
me := userOf(r)
to := r.URL.Query().Get("to")
// Your own check, whatever your app needs.
if me == "" || !mayCall(me, to) {
w.WriteHeader(403)
return
}
kind := r.URL.Query().Get("type")
reply(w, map[string]string{
"token": app.CallToken(me, to, kind, profile(me)),
})
}Dodajte gumb za poziv
Gotov zaslon: gumb, zvonjenje s Javi se i Odbij te prozor poziva, bez koda za poziv. Gumb od vaše rute traži svoj token. Pokrenite zaslon na svakoj stranici na kojoj netko može biti pozvan, jer poziv zvoni samo tamo gdje on radi.
Hookovi i komponente za svaku React aplikaciju, uz bilo koji poslužitelj gore.
import { connect } from '@wordplus/realtime';
const rt = await connect();
// The ring and the call window, on every page someone may be called on.
await rt.callScreen();
// And in the page. The button asks your route for its token.
// <call-button to="34" token-url="/api/call-token" type="video" name="Ann">
// Call Ann
// </call-button>import { connect } from '@wordplus/realtime';
const rt = await connect();
// The ring and the call window, on every page someone may be called on.
await rt.callScreen();
// And in the page. The button asks your route for its token.
// <call-button to="34" token-url="/api/call-token" type="video" name="Ann">
// Call Ann
// </call-button>import { connect } from '@wordplus/realtime';
const rt = await connect();
// The ring and the call window, on every page someone may be called on.
await rt.callScreen();
// And in the page. The button asks your route for its token.
// <call-button to="34" token-url="/api/call-token" type="video" name="Ann">
// Call Ann
// </call-button>import { connect } from '@wordplus/realtime';
const rt = await connect();
// The ring and the call window, on every page someone may be called on.
await rt.callScreen();
// And in the page. The button asks your route for its token.
// <call-button to="34" token-url="/api/call-token" type="video" name="Ann">
// Call Ann
// </call-button>import { connect } from '@wordplus/realtime';
const rt = await connect();
// The ring and the call window, on every page someone may be called on.
await rt.callScreen();
// And in the page. The button asks your route for its token.
// <call-button to="34" token-url="/api/call-token" type="video" name="Ann">
// Call Ann
// </call-button>import { connect } from '@wordplus/realtime';
const rt = await connect();
// The ring and the call window, on every page someone may be called on.
await rt.callScreen();
// And in the page. The button asks your route for its token.
// <call-button to="34" token-url="/api/call-token" type="video" name="Ann">
// Call Ann
// </call-button>import { connect } from '@wordplus/realtime';
const rt = await connect();
// The ring and the call window, on every page someone may be called on.
await rt.callScreen();
// And in the page. The button asks your route for its token.
// <call-button to="34" token-url="/api/call-token" type="video" name="Ann">
// Call Ann
// </call-button>import { connect } from '@wordplus/realtime';
const rt = await connect();
// The ring and the call window, on every page someone may be called on.
await rt.callScreen();
// And in the page. The button asks your route for its token.
// <call-button to="34" token-url="/api/call-token" type="video" name="Ann">
// Call Ann
// </call-button>import { connect } from '@wordplus/realtime';
const rt = await connect();
// The ring and the call window, on every page someone may be called on.
await rt.callScreen();
// And in the page. The button asks your route for its token.
// <call-button to="34" token-url="/api/call-token" type="video" name="Ann">
// Call Ann
// </call-button><call-button to="34" token-url="/api/call-token" type="video" name="Ann">
Call Ann
</call-button>
<script type="module">
// The ring and the call window, on every page someone may be called on.
await window.Echo.connector.rt.callScreen();
</script>'use client'; // in Next.js
import { CallButton, CallScreen } from '@wordplus/realtime/react';
// Inside <RealtimeProvider>, once for the whole app.
export function CallAnn() {
return (
<>
<CallScreen />
<CallButton to={ 34 } tokenUrl="/api/call-token" type="video" name="Ann">
Call Ann
</CallButton>
</>
);
}<script setup>
import { watchEffect } from 'vue';
import { useRealtime } from '@wordplus/realtime/vue';
// provideRealtime() once, in your root component.
const rt = useRealtime();
// The ring and the call window, on every page someone may be called on.
watchEffect( () => rt.value?.callScreen() );
</script>
<!-- isCustomElement for this tag, in vite.config.js -->
<template>
<call-button to="34" token-url="/api/call-token" type="video" name="Ann">
Call Ann
</call-button>
</template><script>
import { useRealtime } from '@wordplus/realtime/svelte';
// provideRealtime() once, in your root component.
const rt = useRealtime();
// The ring and the call window, on every page someone may be called on.
$effect( () => { rt.current?.callScreen(); } );
</script>
<call-button to="34" token-url="/api/call-token" type="video" name="Ann">
Call Ann
</call-button>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
// realtime.ts, one connection for the whole app:
// export const realtime = connect();
import { realtime } from './realtime';
@Component( {
selector: 'app-call-ann',
schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
template: `<call-button to="34" token-url="/api/call-token" type="video" name="Ann">Call Ann</call-button>`,
} )
export class CallAnnComponent {
async ngOnInit() {
const rt = await realtime;
// The ring and the call window, on every page someone may be called on.
await rt.callScreen();
}
}import WordPlusRealtimeCalls
import WordPlusRealtimeUI
// Rings for every call coming in, and shows it once answered.
CallScreen.shared.attach(rt.calls)
let token = try await api.callToken(to: "34") // your own request to your route
let call = try await rt.startCall(token)
CallScreen.shared.show(call, name: "Ann")import cloud.wordplus.realtime.calls.calls
import cloud.wordplus.realtime.calls.startCall
import cloud.wordplus.realtime.ui.CallScreen
// Rings for every call coming in, and shows it once answered.
CallScreen.attach(context, rt.calls(context))
val token = api.callToken(to = "34") // your own request to your route
val call = rt.startCall(context, token)
CallScreen.show(context, call, name = "Ann")import {
CallButton, CallScreen, RealtimeProvider,
} from '@wordplus/realtime-react-native';
// Your server, in full, as an app has no address of its own.
const API = 'https://app.example.com/api';
const options = {
app: 's1500000007',
endpoint: API + '/realtime',
headers: { Authorization: 'Bearer ' + session.token },
};
export function App() {
return (
<RealtimeProvider options={ options }>
<CallScreen />
<CallButton to="34" tokenUrl={ API + '/call-token' }
type="video" name="Ann">
Call Ann
</CallButton>
</RealtimeProvider>
);
}import 'package:flutter/material.dart';
import 'package:wordplus_realtime/wordplus_realtime.dart';
// Your server, in full, as an app has no address of its own.
const api = 'https://app.example.com/api';
// Once, as your app starts.
final rt = await WordPlusRealtime.connect(
app: 's1500000007',
endpoint: '$api/realtime',
headers: {'Authorization': 'Bearer ${session.token}'},
);
// Rings for every call coming in, and shows it once answered.
await rt.callScreen();
// In your build:
CallButton(
rt: rt,
to: '34',
tokenUrl: '$api/call-token',
name: 'Ann',
child: const Text('Call Ann'),
)Zovite iz vlastitog koda
Za zaslon koji sami crtate: dohvatite token od svoje rute i njime pokrenite poziv. Poziv zvoni u svakoj kartici i aplikaciji koju druga osoba ima otvorenu i prestaje zvoniti posvuda čim se javi u jednoj od njih.
Hookovi i komponente za svaku React aplikaciju, uz bilo koji poslužitelj gore.
import { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your server for a token: your route from the first step.
async function callToken( to ) {
const answer = await fetch( '/api/call-token?to=' + to );
if ( ! answer.ok ) throw new Error( 'Your server said no' );
return ( await answer.json() ).token;
}
const call = await rt.startCall( await callToken( 34 ) );
call.on( 'state', ( state ) => showState( state ) ); // ringing, connecting, connected, ended
call.on( 'remote', () => {
call.remote.camera?.attach( video ); // a <video> of yours
call.remote.microphone?.attach( audio ); // an <audio> of yours
} );
await call.setMicrophone( true );
await call.setCamera( true );
hangUp.onclick = () => call.end();import { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your server for a token: your route from the first step.
async function callToken( to ) {
const answer = await fetch( '/api/call-token?to=' + to );
if ( ! answer.ok ) throw new Error( 'Your server said no' );
return ( await answer.json() ).token;
}
const call = await rt.startCall( await callToken( 34 ) );
call.on( 'state', ( state ) => showState( state ) ); // ringing, connecting, connected, ended
call.on( 'remote', () => {
call.remote.camera?.attach( video ); // a <video> of yours
call.remote.microphone?.attach( audio ); // an <audio> of yours
} );
await call.setMicrophone( true );
await call.setCamera( true );
hangUp.onclick = () => call.end();import { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your server for a token: your route from the first step.
async function callToken( to ) {
const answer = await fetch( '/api/call-token?to=' + to );
if ( ! answer.ok ) throw new Error( 'Your server said no' );
return ( await answer.json() ).token;
}
const call = await rt.startCall( await callToken( 34 ) );
call.on( 'state', ( state ) => showState( state ) ); // ringing, connecting, connected, ended
call.on( 'remote', () => {
call.remote.camera?.attach( video ); // a <video> of yours
call.remote.microphone?.attach( audio ); // an <audio> of yours
} );
await call.setMicrophone( true );
await call.setCamera( true );
hangUp.onclick = () => call.end();import { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your server for a token: your route from the first step.
async function callToken( to ) {
const answer = await fetch( '/api/call-token?to=' + to );
if ( ! answer.ok ) throw new Error( 'Your server said no' );
return ( await answer.json() ).token;
}
const call = await rt.startCall( await callToken( 34 ) );
call.on( 'state', ( state ) => showState( state ) ); // ringing, connecting, connected, ended
call.on( 'remote', () => {
call.remote.camera?.attach( video ); // a <video> of yours
call.remote.microphone?.attach( audio ); // an <audio> of yours
} );
await call.setMicrophone( true );
await call.setCamera( true );
hangUp.onclick = () => call.end();import { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your server for a token: your route from the first step.
async function callToken( to ) {
const answer = await fetch( '/api/call-token?to=' + to );
if ( ! answer.ok ) throw new Error( 'Your server said no' );
return ( await answer.json() ).token;
}
const call = await rt.startCall( await callToken( 34 ) );
call.on( 'state', ( state ) => showState( state ) ); // ringing, connecting, connected, ended
call.on( 'remote', () => {
call.remote.camera?.attach( video ); // a <video> of yours
call.remote.microphone?.attach( audio ); // an <audio> of yours
} );
await call.setMicrophone( true );
await call.setCamera( true );
hangUp.onclick = () => call.end();import { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your server for a token: your route from the first step.
async function callToken( to ) {
const answer = await fetch( '/api/call-token?to=' + to );
if ( ! answer.ok ) throw new Error( 'Your server said no' );
return ( await answer.json() ).token;
}
const call = await rt.startCall( await callToken( 34 ) );
call.on( 'state', ( state ) => showState( state ) ); // ringing, connecting, connected, ended
call.on( 'remote', () => {
call.remote.camera?.attach( video ); // a <video> of yours
call.remote.microphone?.attach( audio ); // an <audio> of yours
} );
await call.setMicrophone( true );
await call.setCamera( true );
hangUp.onclick = () => call.end();import { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your server for a token: your route from the first step.
async function callToken( to ) {
const answer = await fetch( '/api/call-token?to=' + to );
if ( ! answer.ok ) throw new Error( 'Your server said no' );
return ( await answer.json() ).token;
}
const call = await rt.startCall( await callToken( 34 ) );
call.on( 'state', ( state ) => showState( state ) ); // ringing, connecting, connected, ended
call.on( 'remote', () => {
call.remote.camera?.attach( video ); // a <video> of yours
call.remote.microphone?.attach( audio ); // an <audio> of yours
} );
await call.setMicrophone( true );
await call.setCamera( true );
hangUp.onclick = () => call.end();import { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your server for a token: your route from the first step.
async function callToken( to ) {
const answer = await fetch( '/api/call-token?to=' + to );
if ( ! answer.ok ) throw new Error( 'Your server said no' );
return ( await answer.json() ).token;
}
const call = await rt.startCall( await callToken( 34 ) );
call.on( 'state', ( state ) => showState( state ) ); // ringing, connecting, connected, ended
call.on( 'remote', () => {
call.remote.camera?.attach( video ); // a <video> of yours
call.remote.microphone?.attach( audio ); // an <audio> of yours
} );
await call.setMicrophone( true );
await call.setCamera( true );
hangUp.onclick = () => call.end();import { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your server for a token: your route from the first step.
async function callToken( to ) {
const answer = await fetch( '/api/call-token?to=' + to );
if ( ! answer.ok ) throw new Error( 'Your server said no' );
return ( await answer.json() ).token;
}
const call = await rt.startCall( await callToken( 34 ) );
call.on( 'state', ( state ) => showState( state ) ); // ringing, connecting, connected, ended
call.on( 'remote', () => {
call.remote.camera?.attach( video ); // a <video> of yours
call.remote.microphone?.attach( audio ); // an <audio> of yours
} );
await call.setMicrophone( true );
await call.setCamera( true );
hangUp.onclick = () => call.end();const rt = window.Echo.connector.rt; // the connection Echo made
// Asks your server for a token: your route from the first step.
async function callToken( to ) {
const answer = await fetch( '/api/call-token?to=' + to );
if ( ! answer.ok ) throw new Error( 'Your server said no' );
return ( await answer.json() ).token;
}
const call = await rt.startCall( await callToken( 34 ) );
call.on( 'state', ( state ) => showState( state ) ); // ringing, connecting, connected, ended
call.on( 'remote', () => {
call.remote.camera?.attach( video ); // a <video> of yours
call.remote.microphone?.attach( audio ); // an <audio> of yours
} );
await call.setMicrophone( true );
await call.setCamera( true );
hangUp.onclick = () => call.end();'use client'; // in Next.js
import { AudioTrack, useCall, VideoTrack } from '@wordplus/realtime/react';
// Asks your server for a token: your route from the first step.
async function callToken( to ) {
const answer = await fetch( '/api/call-token?to=' + to );
if ( ! answer.ok ) throw new Error( 'Your server said no' );
return ( await answer.json() ).token;
}
// Inside <RealtimeProvider>, once for the whole app.
export function Call() {
const { call, state, remote, camera, start, end } = useCall();
if ( ! call ) {
return <button onClick={ async () => start( await callToken( 34 ) ) }>Call Ann</button>;
}
return (
<>
<p>{ state }</p>
<VideoTrack track={ remote?.camera } />
<AudioTrack track={ remote?.microphone } />
<VideoTrack track={ camera } />
<button onClick={ end }>Hang up</button>
</>
);
}<script setup>
import { AudioTrack, useCall, VideoTrack } from '@wordplus/realtime/vue';
// Asks your server for a token: your route from the first step.
async function callToken( to ) {
const answer = await fetch( '/api/call-token?to=' + to );
if ( ! answer.ok ) throw new Error( 'Your server said no' );
return ( await answer.json() ).token;
}
// provideRealtime() once, in your root component.
const { call, state, remote, camera, start, end } = useCall();
</script>
<template>
<button v-if="! call" @click="async () => start( await callToken( 34 ) )">Call Ann</button>
<template v-else>
<p>{{ state }}</p>
<VideoTrack :track="remote?.camera" />
<AudioTrack :track="remote?.microphone" />
<VideoTrack :track="camera" />
<button @click="end">Hang up</button>
</template>
</template><script>
import { track, useCall } from '@wordplus/realtime/svelte';
// Asks your server for a token: your route from the first step.
async function callToken( to ) {
const answer = await fetch( '/api/call-token?to=' + to );
if ( ! answer.ok ) throw new Error( 'Your server said no' );
return ( await answer.json() ).token;
}
// provideRealtime() once, in your root component.
const current = useCall();
</script>
{#if ! current.call}
<button onclick={ async () => current.start( await callToken( 34 ) ) }>Call Ann</button>
{:else}
<p>{ current.state }</p>
<video use:track={ current.remote?.camera } muted autoplay playsinline></video>
<audio use:track={ current.remote?.microphone } autoplay></audio>
<video use:track={ current.camera } muted autoplay playsinline></video>
<button onclick={ current.end }>Hang up</button>
{/if}import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
// realtime.ts, one connection for the whole app:
// export const realtime = connect();
import { realtime } from './realtime';
@Component( {
selector: 'app-call',
schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
template: `<video #video autoplay playsinline></video>`,
} )
export class CallComponent {
async ngOnInit() {
const rt = await realtime;
// Asks your server for a token: your route from the first step.
async function callToken( to ) {
const answer = await fetch( '/api/call-token?to=' + to );
if ( ! answer.ok ) throw new Error( 'Your server said no' );
return ( await answer.json() ).token;
}
const call = await rt.startCall( await callToken( 34 ) );
call.on( 'state', ( state ) => showState( state ) ); // ringing, connecting, connected, ended
call.on( 'remote', () => {
call.remote.camera?.attach( video ); // a <video> of yours
call.remote.microphone?.attach( audio ); // an <audio> of yours
} );
await call.setMicrophone( true );
await call.setCamera( true );
hangUp.onclick = () => call.end();
}
}let token = try await api.callToken(to: "34") // your own request to your route
let call = try await rt.startCall(token)
call.onState { state in label.text = state.rawValue } // ringing, connecting, connected, ended
call.onRemote { remoteView.show(call.remoteCamera) } // a CallVideoView of yours
ownView.show(call.localCamera)
hangUp.addAction(UIAction { _ in call.end() }, for: .touchUpInside)val token = api.callToken(to = "34") // your own request to your route
val call = rt.startCall(context, token)
call.onState { state -> label.text = state.wire } // ringing, connecting, connected, ended
call.onRemote { remoteView.show(call.remoteCamera) } // a CallVideoView of yours
ownView.show(call.localCamera)
hangUp.setOnClickListener { call.end() }import { Button, Text, View } from 'react-native';
import { CallVideo, useCall, useRealtime } from '@wordplus/realtime-react-native';
const API = 'https://app.example.com/api'; // your server, in full
// Inside <RealtimeProvider>, once for the whole app.
export function Call() {
const rt = useRealtime();
const { call, state, start, end } = useCall();
// Asks your route from the first step, then starts with its token.
const callAnn = async () => {
start( await rt.tokenFrom( API + '/call-token', { to: 34, type: 'video' } ) );
};
if ( ! call ) return <Button title="Call Ann" disabled={ ! rt } onPress={ callAnn } />;
return (
<View style={ { flex: 1 } }>
<Text>{ state?.state }</Text>
<CallVideo call={ call } style={ { flex: 1 } } />
<CallVideo call={ call } source="own" mirrored style={ { height: 120 } } />
<Button title="Hang up" onPress={ end } />
</View>
);
}// Asks your route from the first step, then starts with its token.
final token = await rt.tokenFrom('$api/call-token', {'to': 34, 'type': 'video'});
final call = await rt.startCall(token);
// ringing, connecting, connected, reconnecting, ended
call.onState((state) => showState(state));
// In your build, where you lay them out:
CallVideo(call: call) // the other side
CallVideo(call: call, source: CallVideoSource.own, mirrored: true) // your own
FilledButton(onPressed: call.end, child: const Text('Hang up'))Javite se na poziv
Stranica koja čeka pozive drži liniju svog korisnika, na kojoj njegovi pozivi zvone 45 sekundi. Za javljanje ne treba token, jer onaj pozivatelja već pokazuje da je vaš poslužitelj rekao da. Javite se ili odbijte, i njegove ostale kartice prestaju zvoniti.
Hookovi i komponente za svaku React aplikaciju, uz bilo koji poslužitelj gore.
import { connect } from '@wordplus/realtime';
const rt = await connect();
// From now on their calls ring on this page.
rt.onIncomingCall( ( incoming ) => {
showRing( incoming.info?.name, incoming.type );
answer.onclick = () => incoming.accept(); // gives the call, as rt.startCall() does
decline.onclick = () => incoming.decline(); // or decline( 'busy' )
incoming.on( 'over', hideRing ); // answered elsewhere, or the caller gave up
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
// From now on their calls ring on this page.
rt.onIncomingCall( ( incoming ) => {
showRing( incoming.info?.name, incoming.type );
answer.onclick = () => incoming.accept(); // gives the call, as rt.startCall() does
decline.onclick = () => incoming.decline(); // or decline( 'busy' )
incoming.on( 'over', hideRing ); // answered elsewhere, or the caller gave up
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
// From now on their calls ring on this page.
rt.onIncomingCall( ( incoming ) => {
showRing( incoming.info?.name, incoming.type );
answer.onclick = () => incoming.accept(); // gives the call, as rt.startCall() does
decline.onclick = () => incoming.decline(); // or decline( 'busy' )
incoming.on( 'over', hideRing ); // answered elsewhere, or the caller gave up
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
// From now on their calls ring on this page.
rt.onIncomingCall( ( incoming ) => {
showRing( incoming.info?.name, incoming.type );
answer.onclick = () => incoming.accept(); // gives the call, as rt.startCall() does
decline.onclick = () => incoming.decline(); // or decline( 'busy' )
incoming.on( 'over', hideRing ); // answered elsewhere, or the caller gave up
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
// From now on their calls ring on this page.
rt.onIncomingCall( ( incoming ) => {
showRing( incoming.info?.name, incoming.type );
answer.onclick = () => incoming.accept(); // gives the call, as rt.startCall() does
decline.onclick = () => incoming.decline(); // or decline( 'busy' )
incoming.on( 'over', hideRing ); // answered elsewhere, or the caller gave up
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
// From now on their calls ring on this page.
rt.onIncomingCall( ( incoming ) => {
showRing( incoming.info?.name, incoming.type );
answer.onclick = () => incoming.accept(); // gives the call, as rt.startCall() does
decline.onclick = () => incoming.decline(); // or decline( 'busy' )
incoming.on( 'over', hideRing ); // answered elsewhere, or the caller gave up
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
// From now on their calls ring on this page.
rt.onIncomingCall( ( incoming ) => {
showRing( incoming.info?.name, incoming.type );
answer.onclick = () => incoming.accept(); // gives the call, as rt.startCall() does
decline.onclick = () => incoming.decline(); // or decline( 'busy' )
incoming.on( 'over', hideRing ); // answered elsewhere, or the caller gave up
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
// From now on their calls ring on this page.
rt.onIncomingCall( ( incoming ) => {
showRing( incoming.info?.name, incoming.type );
answer.onclick = () => incoming.accept(); // gives the call, as rt.startCall() does
decline.onclick = () => incoming.decline(); // or decline( 'busy' )
incoming.on( 'over', hideRing ); // answered elsewhere, or the caller gave up
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
// From now on their calls ring on this page.
rt.onIncomingCall( ( incoming ) => {
showRing( incoming.info?.name, incoming.type );
answer.onclick = () => incoming.accept(); // gives the call, as rt.startCall() does
decline.onclick = () => incoming.decline(); // or decline( 'busy' )
incoming.on( 'over', hideRing ); // answered elsewhere, or the caller gave up
} );const rt = window.Echo.connector.rt; // the connection Echo made
// From now on their calls ring on this page.
rt.onIncomingCall( ( incoming ) => {
showRing( incoming.info?.name, incoming.type );
answer.onclick = () => incoming.accept(); // gives the call, as rt.startCall() does
decline.onclick = () => incoming.decline(); // or decline( 'busy' )
incoming.on( 'over', hideRing ); // answered elsewhere, or the caller gave up
} );// In the component that holds the call, on the same useCall().
const { incoming } = useCalls(); // those ringing now
const ring = incoming[ 0 ];
if ( ! call && ring ) {
return (
<>
<p>{ ring.info?.name } is calling</p>
<button onClick={ () => answer( ring ) }>Answer</button>
<button onClick={ () => ring.decline() }>Decline</button>
</>
);
}<script setup>
// In the component that holds the call, on the same useCall().
const { incoming } = useCalls(); // those ringing now
</script>
<template>
<template v-if="! call && incoming[ 0 ]">
<p>{{ incoming[ 0 ].info?.name }} is calling</p>
<button @click="answer( incoming[ 0 ] )">Answer</button>
<button @click="incoming[ 0 ].decline()">Decline</button>
</template>
</template><script>
// In the component that holds the call, on the same useCall().
const calls = useCalls(); // those ringing now
</script>
{#if ! current.call && calls.incoming[ 0 ]}
<p>{ calls.incoming[ 0 ].info?.name } is calling</p>
<button onclick={ () => current.answer( calls.incoming[ 0 ] ) }>Answer</button>
<button onclick={ () => calls.incoming[ 0 ].decline() }>Decline</button>
{/if}import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
// realtime.ts, one connection for the whole app:
// export const realtime = connect();
import { realtime } from './realtime';
@Component( {
selector: 'app-ring',
schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
template: `<!-- Your ring here -->`,
} )
export class RingComponent {
async ngOnInit() {
const rt = await realtime;
// From now on their calls ring on this page.
rt.onIncomingCall( ( incoming ) => {
showRing( incoming.info?.name, incoming.type );
answer.onclick = () => incoming.accept(); // gives the call, as rt.startCall() does
decline.onclick = () => incoming.decline(); // or decline( 'busy' )
incoming.on( 'over', hideRing ); // answered elsewhere, or the caller gave up
} );
}
}rt.calls.onIncoming { incoming in
showRing(incoming.info["name"], incoming.type)
incoming.onOver { _ in hideRing() } // answered elsewhere, or the caller gave up
Task { @MainActor in
switch try await incoming.accept() { // or try await incoming.decline(busy: true)
case let .call(call): show(call)
case let .group(group): show(group)
}
}
}calls.onIncoming { incoming ->
showRing(incoming.info["name"], incoming.type)
incoming.onOver { hideRing() } // answered elsewhere, or the caller gave up
viewModelScope.launch {
when (val answered = incoming.accept()) { // or incoming.decline(busy = true)
is IncomingCall.Answered.ToCall -> show(answered.call)
is IncomingCall.Answered.ToGroup -> show(answered.group)
}
}
}// In the component that holds the call, on the same useCall().
const { incoming } = useCalls(); // those ringing now
const ring = incoming[ 0 ];
if ( ! call && ring ) {
return (
<View>
<Text>{ ring.info?.name } is calling</Text>
<Button title="Answer" onPress={ () => answer( ring ) } />
<Button title="Decline" onPress={ () => ring.decline() } />
</View>
);
}rt.onIncomingCall((incoming) async {
showRing(incoming.info?['name'], incoming.type);
incoming.onOver((reason) => hideRing()); // answered elsewhere, or the caller gave up
// On your Answer button, or incoming.decline(), decline(busy: true) if busy.
switch (await incoming.accept()) {
case ToCall(:final call):
showCall(call);
case ToGroup(:final group):
showGroup(group);
}
});Kamera, mikrofon i zaslon
Iste naredbe u pozivu, grupnom pozivu i prijenosu uživo, pa vaš zaslon nema uređaj o kojem mora voditi računa. Kamera se zaustavlja, a njezino se svjetlo gasi, kad se isključi ili kad poziv završi.
Hookovi i komponente za svaku React aplikaciju, uz bilo koji poslužitelj gore.
import { connect } from '@wordplus/realtime';
const rt = await connect();
await call.setMicrophone( false ); // muted
await call.setCamera( false ); // stopped, and the light goes off
const shared = await call.setScreenShare( true ); // false if they picked nothing
// Move to another camera with no gap on the other side.
const { cameras } = await ( await rt.calls() ).devices();
await call.setCamera( true, { deviceId: cameras[ 1 ].id } );import { connect } from '@wordplus/realtime';
const rt = await connect();
await call.setMicrophone( false ); // muted
await call.setCamera( false ); // stopped, and the light goes off
const shared = await call.setScreenShare( true ); // false if they picked nothing
// Move to another camera with no gap on the other side.
const { cameras } = await ( await rt.calls() ).devices();
await call.setCamera( true, { deviceId: cameras[ 1 ].id } );import { connect } from '@wordplus/realtime';
const rt = await connect();
await call.setMicrophone( false ); // muted
await call.setCamera( false ); // stopped, and the light goes off
const shared = await call.setScreenShare( true ); // false if they picked nothing
// Move to another camera with no gap on the other side.
const { cameras } = await ( await rt.calls() ).devices();
await call.setCamera( true, { deviceId: cameras[ 1 ].id } );import { connect } from '@wordplus/realtime';
const rt = await connect();
await call.setMicrophone( false ); // muted
await call.setCamera( false ); // stopped, and the light goes off
const shared = await call.setScreenShare( true ); // false if they picked nothing
// Move to another camera with no gap on the other side.
const { cameras } = await ( await rt.calls() ).devices();
await call.setCamera( true, { deviceId: cameras[ 1 ].id } );import { connect } from '@wordplus/realtime';
const rt = await connect();
await call.setMicrophone( false ); // muted
await call.setCamera( false ); // stopped, and the light goes off
const shared = await call.setScreenShare( true ); // false if they picked nothing
// Move to another camera with no gap on the other side.
const { cameras } = await ( await rt.calls() ).devices();
await call.setCamera( true, { deviceId: cameras[ 1 ].id } );import { connect } from '@wordplus/realtime';
const rt = await connect();
await call.setMicrophone( false ); // muted
await call.setCamera( false ); // stopped, and the light goes off
const shared = await call.setScreenShare( true ); // false if they picked nothing
// Move to another camera with no gap on the other side.
const { cameras } = await ( await rt.calls() ).devices();
await call.setCamera( true, { deviceId: cameras[ 1 ].id } );import { connect } from '@wordplus/realtime';
const rt = await connect();
await call.setMicrophone( false ); // muted
await call.setCamera( false ); // stopped, and the light goes off
const shared = await call.setScreenShare( true ); // false if they picked nothing
// Move to another camera with no gap on the other side.
const { cameras } = await ( await rt.calls() ).devices();
await call.setCamera( true, { deviceId: cameras[ 1 ].id } );import { connect } from '@wordplus/realtime';
const rt = await connect();
await call.setMicrophone( false ); // muted
await call.setCamera( false ); // stopped, and the light goes off
const shared = await call.setScreenShare( true ); // false if they picked nothing
// Move to another camera with no gap on the other side.
const { cameras } = await ( await rt.calls() ).devices();
await call.setCamera( true, { deviceId: cameras[ 1 ].id } );import { connect } from '@wordplus/realtime';
const rt = await connect();
await call.setMicrophone( false ); // muted
await call.setCamera( false ); // stopped, and the light goes off
const shared = await call.setScreenShare( true ); // false if they picked nothing
// Move to another camera with no gap on the other side.
const { cameras } = await ( await rt.calls() ).devices();
await call.setCamera( true, { deviceId: cameras[ 1 ].id } );const rt = window.Echo.connector.rt; // the connection Echo made
await call.setMicrophone( false ); // muted
await call.setCamera( false ); // stopped, and the light goes off
const shared = await call.setScreenShare( true ); // false if they picked nothing
// Move to another camera with no gap on the other side.
const { cameras } = await ( await rt.calls() ).devices();
await call.setCamera( true, { deviceId: cameras[ 1 ].id } );// In the component that holds the call, on the same useCall().
const { camera, microphone, screen, setCamera, setMicrophone, setScreenShare } = useCall();
return (
<>
<button onClick={ () => setMicrophone( ! microphone ) }>Microphone</button>
<button onClick={ () => setCamera( ! camera ) }>Camera</button>
<button onClick={ () => setScreenShare( ! screen ) }>Share screen</button>
</>
);<script setup>
// In the component that holds the call, on the same useCall().
const { camera, microphone, screen, setCamera, setMicrophone, setScreenShare } = useCall();
</script>
<template>
<button @click="setMicrophone( ! microphone )">Microphone</button>
<button @click="setCamera( ! camera )">Camera</button>
<button @click="setScreenShare( ! screen )">Share screen</button>
</template><!-- In the component that holds the call, on the same useCall(). -->
<button onclick={ () => current.setMicrophone( ! current.microphone ) }>Microphone</button>
<button onclick={ () => current.setCamera( ! current.camera ) }>Camera</button>
<button onclick={ () => current.setScreenShare( ! current.screen ) }>Share screen</button>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
// realtime.ts, one connection for the whole app:
// export const realtime = connect();
import { realtime } from './realtime';
@Component( {
selector: 'app-controls',
schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
template: `<!-- Your buttons here -->`,
} )
export class ControlsComponent {
async ngOnInit() {
const rt = await realtime;
await call.setMicrophone( false ); // muted
await call.setCamera( false ); // stopped, and the light goes off
const shared = await call.setScreenShare( true ); // false if they picked nothing
// Move to another camera with no gap on the other side.
const { cameras } = await ( await rt.calls() ).devices();
await call.setCamera( true, { deviceId: cameras[ 1 ].id } );
}
}call.microphone = false // muted
call.camera = false // stops sending the camera
call.flipCamera() // the front one to the back, and back
// Puts up the system's picker, in an app built with the broadcast extension.
await call.setScreenShare(true)call.microphone = false // muted
call.camera = false // stops sending the camera
call.flipCamera() // the front one to the back, and back
// answer is what the system's dialog gave: ScreenShare.permissionIntent(activity).
call.setScreenShare(true, answer.data)// In the component that holds the call, on the same useCall().
const { call, state } = useCall();
// Sharing the phone's screen isn't in React Native yet.
return (
<>
<Button title="Microphone" onPress={ () => call.setMicrophone( ! state.microphone ) } />
<Button title="Camera" onPress={ () => call.setCamera( ! state.camera ) } />
<Button title="Flip camera" onPress={ () => call.flipCamera() } />
</>
);await call.setMicrophone(false); // muted
await call.setCamera(false); // stopped, and the light goes off
await call.flipCamera(); // the front one to the back, and back
// Android asks with the system's dialog, iOS needs the broadcast extension.
final shared = await call.setScreenShare(true); // false if they said noDodajte treću osobu
Kad poziv krene, bilo koja strana može pozvati još nekoga, i nastavlja se kao grupni poziv, a da nitko ne prekida. Vaša ruta odlučuje koga, kao i za svaki poziv, a stranica joj kaže o kojem je pozivu riječ. mayAdd je vaša vlastita provjera.
// Your route from the first step. call is the page's call.ref.
if ( ! await mayAdd( me, to ) ) return refuse();
const token = await realtime.callToken( me, to, { into: call } );// Your route from the first step. call is the page's call.ref.
if ( ! await mayAdd( me, to ) ) return refuse();
const token = await realtime.callToken( me, to, { into: call } );// Your route from the first step. call is the page's call.ref.
if ( ! await mayAdd( me, to ) ) return refuse();
const token = await realtime.callToken( me, to, { into: call } );// Your route from the first step. The page's call.ref comes as call.
abort_unless( may_add( $me, $to ), 403 );
$token = Realtime::callToken( $me, $to, [ 'into' => $request->query( 'call' ) ] );// Your route from the first step. The page's call.ref comes as call.
if ( ! may_add( $me, $to ) ) {
http_response_code( 403 );
exit;
}
$token = $realtime->callToken( $me, $to, [ 'into' => $_GET['call'] ] );# Your route from the first step. call is the page's call.ref.
if not may_add(me, to):
return refuse()
token = realtime.call_token(me, to, into=call)# Your route from the first step. call is the page's call.ref.
if not may_add(me, to):
return refuse()
token = realtime.call_token(me, to, into=call)# Your route from the first step. call is the page's call.ref.
if not may_add(me, to):
return refuse()
token = realtime.call_token(me, to, into=call)// Your route from the first step. The page's call.ref comes as call.
if !mayAdd(me, to) {
w.WriteHeader(403)
return
}
token, err := app.AddToCallToken(me, to, r.URL.Query().Get("call"), profile(me))Hookovi i komponente za svaku React aplikaciju, uz bilo koji poslužitelj gore.
import { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your route with the call, so it rings them into this one.
const answer = await fetch( '/api/call-token?to=56&call=' + call.ref );
const invite = await call.add( ( await answer.json() ).token ); // rings them everywhere they are
// Both sides go on in a group call, with no one hanging up.
call.on( 'group', ( group ) => showGroup( group ) );
invite.on( 'state', ( state ) => showState( state ) ); // answered, rejected, busy, no_answerimport { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your route with the call, so it rings them into this one.
const answer = await fetch( '/api/call-token?to=56&call=' + call.ref );
const invite = await call.add( ( await answer.json() ).token ); // rings them everywhere they are
// Both sides go on in a group call, with no one hanging up.
call.on( 'group', ( group ) => showGroup( group ) );
invite.on( 'state', ( state ) => showState( state ) ); // answered, rejected, busy, no_answerimport { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your route with the call, so it rings them into this one.
const answer = await fetch( '/api/call-token?to=56&call=' + call.ref );
const invite = await call.add( ( await answer.json() ).token ); // rings them everywhere they are
// Both sides go on in a group call, with no one hanging up.
call.on( 'group', ( group ) => showGroup( group ) );
invite.on( 'state', ( state ) => showState( state ) ); // answered, rejected, busy, no_answerimport { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your route with the call, so it rings them into this one.
const answer = await fetch( '/api/call-token?to=56&call=' + call.ref );
const invite = await call.add( ( await answer.json() ).token ); // rings them everywhere they are
// Both sides go on in a group call, with no one hanging up.
call.on( 'group', ( group ) => showGroup( group ) );
invite.on( 'state', ( state ) => showState( state ) ); // answered, rejected, busy, no_answerimport { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your route with the call, so it rings them into this one.
const answer = await fetch( '/api/call-token?to=56&call=' + call.ref );
const invite = await call.add( ( await answer.json() ).token ); // rings them everywhere they are
// Both sides go on in a group call, with no one hanging up.
call.on( 'group', ( group ) => showGroup( group ) );
invite.on( 'state', ( state ) => showState( state ) ); // answered, rejected, busy, no_answerimport { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your route with the call, so it rings them into this one.
const answer = await fetch( '/api/call-token?to=56&call=' + call.ref );
const invite = await call.add( ( await answer.json() ).token ); // rings them everywhere they are
// Both sides go on in a group call, with no one hanging up.
call.on( 'group', ( group ) => showGroup( group ) );
invite.on( 'state', ( state ) => showState( state ) ); // answered, rejected, busy, no_answerimport { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your route with the call, so it rings them into this one.
const answer = await fetch( '/api/call-token?to=56&call=' + call.ref );
const invite = await call.add( ( await answer.json() ).token ); // rings them everywhere they are
// Both sides go on in a group call, with no one hanging up.
call.on( 'group', ( group ) => showGroup( group ) );
invite.on( 'state', ( state ) => showState( state ) ); // answered, rejected, busy, no_answerimport { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your route with the call, so it rings them into this one.
const answer = await fetch( '/api/call-token?to=56&call=' + call.ref );
const invite = await call.add( ( await answer.json() ).token ); // rings them everywhere they are
// Both sides go on in a group call, with no one hanging up.
call.on( 'group', ( group ) => showGroup( group ) );
invite.on( 'state', ( state ) => showState( state ) ); // answered, rejected, busy, no_answerimport { connect } from '@wordplus/realtime';
const rt = await connect();
// Asks your route with the call, so it rings them into this one.
const answer = await fetch( '/api/call-token?to=56&call=' + call.ref );
const invite = await call.add( ( await answer.json() ).token ); // rings them everywhere they are
// Both sides go on in a group call, with no one hanging up.
call.on( 'group', ( group ) => showGroup( group ) );
invite.on( 'state', ( state ) => showState( state ) ); // answered, rejected, busy, no_answerconst rt = window.Echo.connector.rt; // the connection Echo made
// Asks your route with the call, so it rings them into this one.
const answer = await fetch( '/api/call-token?to=56&call=' + call.ref );
const invite = await call.add( ( await answer.json() ).token ); // rings them everywhere they are
// Both sides go on in a group call, with no one hanging up.
call.on( 'group', ( group ) => showGroup( group ) );
invite.on( 'state', ( state ) => showState( state ) ); // answered, rejected, busy, no_answer// In the component that holds the call, on the same useCall().
const { call, group } = useCall(); // group: the call goes on as this group call
async function addCara() {
// Asks your route with the call, so it rings them into this one.
const answer = await fetch( '/api/call-token?to=56&call=' + call.ref );
await call.add( ( await answer.json() ).token );
}
return <button onClick={ addCara }>Add Cara</button>;<script setup>
// In the component that holds the call, on the same useCall().
const { call, group } = useCall(); // group: the call goes on as this group call
async function addCara() {
// Asks your route with the call, so it rings them into this one.
const answer = await fetch( '/api/call-token?to=56&call=' + call.value.ref );
await call.value.add( ( await answer.json() ).token );
}
</script>
<template>
<button @click="addCara">Add Cara</button>
</template><script>
// In the component that holds the call, on the same useCall(). current.group: the call goes on as this group call.
async function addCara() {
// Asks your route with the call, so it rings them into this one.
const answer = await fetch( '/api/call-token?to=56&call=' + current.call.ref );
await current.call.add( ( await answer.json() ).token );
}
</script>
<button onclick={ addCara }>Add Cara</button>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
// realtime.ts, one connection for the whole app:
// export const realtime = connect();
import { realtime } from './realtime';
@Component( {
selector: 'app-add-person',
schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
template: `<!-- Your button here -->`,
} )
export class AddPersonComponent {
async ngOnInit() {
const rt = await realtime;
// Asks your route with the call, so it rings them into this one.
const answer = await fetch( '/api/call-token?to=56&call=' + call.ref );
const invite = await call.add( ( await answer.json() ).token ); // rings them everywhere they are
// Both sides go on in a group call, with no one hanging up.
call.on( 'group', ( group ) => showGroup( group ) );
invite.on( 'state', ( state ) => showState( state ) ); // answered, rejected, busy, no_answer
}
}// Both sides go on in a group call, with no one hanging up.
call.onGroup { group in follow(group) }
// Your own request to your route, with the call.
let token = try await api.callToken(to: "56", call: call.ref)
let invite = try await call.add(token) // rings them everywhere they are
invite.onState { state in label.text = state } // answered, rejected, busy, no_answer// Both sides go on in a group call, with no one hanging up.
call.onGroup { group -> follow(group) }
// Your own request to your route, with the call.
val token = api.callToken(to = "56", call = call.ref)
val invite = call.add(token) // rings them everywhere they are
invite.onState { state -> label.text = state } // answered, rejected, busy, no_answer// In the component that holds the call, on the same useCall().
const rt = useRealtime();
const { call, group } = useCall(); // group: the call goes on as this group call
async function addCara() {
// Asks your route with the call, so it rings them into this one.
await call.add( await rt.tokenFrom( API + '/call-token', { to: 56, call: call.ref } ) );
}
return <Button title="Add Cara" onPress={ addCara } />;// Both sides go on in a group call, with no one hanging up.
call.onGroup((group) => showGroup(group));
// Asks your route with the call, so it rings them into this one.
final token = await rt.tokenFrom('$api/call-token', {'to': 56, 'call': call.ref});
final invite = await call.add(token); // rings them everywhere they are
invite.onState((state) => showInvite(state)); // answered, rejected, busy, no_answerPogledajte zašto je poziv završio
Svaki poziv kaže zašto je završio, kako bi vaš zaslon ponudio pravi sljedeći korak, na primjer ostavljanje poruke kad se nitko nije javio.
Hookovi i komponente za svaku React aplikaciju, uz bilo koji poslužitelj gore.
import { connect } from '@wordplus/realtime';
const rt = await connect();
call.on( 'state', ( state ) => {
if ( state !== 'ended' ) return;
// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
if ( call.endReason === 'no_answer' ) offerMessage();
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
call.on( 'state', ( state ) => {
if ( state !== 'ended' ) return;
// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
if ( call.endReason === 'no_answer' ) offerMessage();
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
call.on( 'state', ( state ) => {
if ( state !== 'ended' ) return;
// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
if ( call.endReason === 'no_answer' ) offerMessage();
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
call.on( 'state', ( state ) => {
if ( state !== 'ended' ) return;
// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
if ( call.endReason === 'no_answer' ) offerMessage();
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
call.on( 'state', ( state ) => {
if ( state !== 'ended' ) return;
// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
if ( call.endReason === 'no_answer' ) offerMessage();
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
call.on( 'state', ( state ) => {
if ( state !== 'ended' ) return;
// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
if ( call.endReason === 'no_answer' ) offerMessage();
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
call.on( 'state', ( state ) => {
if ( state !== 'ended' ) return;
// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
if ( call.endReason === 'no_answer' ) offerMessage();
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
call.on( 'state', ( state ) => {
if ( state !== 'ended' ) return;
// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
if ( call.endReason === 'no_answer' ) offerMessage();
} );import { connect } from '@wordplus/realtime';
const rt = await connect();
call.on( 'state', ( state ) => {
if ( state !== 'ended' ) return;
// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
if ( call.endReason === 'no_answer' ) offerMessage();
} );const rt = window.Echo.connector.rt; // the connection Echo made
call.on( 'state', ( state ) => {
if ( state !== 'ended' ) return;
// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
if ( call.endReason === 'no_answer' ) offerMessage();
} );// In the component that holds the call, on the same useCall().
const { endReason } = useCall();
// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
return endReason === 'no_answer' ? <OfferMessage /> : null;<script setup>
// In the component that holds the call, on the same useCall().
const { endReason } = useCall();
</script>
<template>
<!-- hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group -->
<OfferMessage v-if="endReason === 'no_answer'" />
</template><!-- In the component that holds the call, on the same useCall(). -->
<!-- hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group -->
{#if current.endReason === 'no_answer'}
<OfferMessage />
{/if}import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
// realtime.ts, one connection for the whole app:
// export const realtime = connect();
import { realtime } from './realtime';
@Component( {
selector: 'app-call-end',
schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
template: `<!-- Your message here -->`,
} )
export class CallEndComponent {
async ngOnInit() {
const rt = await realtime;
call.on( 'state', ( state ) => {
if ( state !== 'ended' ) return;
// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
if ( call.endReason === 'no_answer' ) offerMessage();
} );
}
}// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
call.onEnded { reason in
if reason == "no_answer" { offerMessage() }
}// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
call.onEnded { reason ->
if (reason == "no_answer") offerMessage()
}// In the component that holds the call, on the same useCall().
const { endReason } = useCall();
// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
return endReason === 'no_answer' ? <OfferMessage /> : null;// hangup, cancelled, rejected, busy, no_answer, page_closed, peer_lost, group
call.onEnded((reason) {
if (reason == 'no_answer') offerMessage();
});Naplaćujte po minuti
Vaš poslužitelj saznaje koliko je trajao svaki poziv, izbrojeno na našim poslužiteljima, kako biste mogli naplatiti svojim korisnicima. Događaj može stići dvaput, pa naplatite jednom za svaki id. charge je vaša vlastita funkcija.
// The caller, for the time talked, by the minute begun. Charge once for each id.
realtime.on( 'call.ended', async ( { id, from, seconds } ) => {
if ( seconds > 0 ) await charge( id, from, Math.ceil( seconds / 60 ) );
} );// The caller, for the time talked, by the minute begun. Charge once for each id.
realtime.on( 'call.ended', async ( { id, from, seconds } ) => {
if ( seconds > 0 ) await charge( id, from, Math.ceil( seconds / 60 ) );
} );// The caller, for the time talked, by the minute begun. Charge once for each id.
realtime.on( 'call.ended', async ( { id, from, seconds } ) => {
if ( seconds > 0 ) await charge( id, from, Math.ceil( seconds / 60 ) );
} );$this->callAfterResolving( Realtime::class, function ( Realtime $realtime ) {
// The caller, for the time talked, by the minute begun. Charge once for each id.
$realtime->on( 'call.ended', function ( array $e ) {
if ( $e['seconds'] > 0 ) {
charge( $e['id'], $e['from'], (int) ceil( $e['seconds'] / 60 ) );
}
} );
} );// The caller, for the time talked, by the minute begun. Charge once for each id.
$realtime->on( 'call.ended', function ( array $e ) {
if ( $e['seconds'] > 0 ) {
charge( $e['id'], $e['from'], (int) ceil( $e['seconds'] / 60 ) );
}
} );# The caller, for the time talked, by the minute begun. Charge once for each id.
def call_ended(e):
if e["seconds"] > 0:
charge(e["id"], e["from"], math.ceil(e["seconds"] / 60))
realtime.on("call.ended", call_ended)# The caller, for the time talked, by the minute begun. Charge once for each id.
def call_ended(e):
if e["seconds"] > 0:
charge(e["id"], e["from"], math.ceil(e["seconds"] / 60))
realtime.on("call.ended", call_ended)# The caller, for the time talked, by the minute begun. Charge once for each id.
def call_ended(e):
if e["seconds"] > 0:
charge(e["id"], e["from"], math.ceil(e["seconds"] / 60))
realtime.on("call.ended", call_ended)// In your webhook route, once its signature is checked as the docs say.
// The caller, for the time talked, by the minute begun. Charge once for each id.
if event.Type == "call.ended" && event.Seconds > 0 {
charge(event.ID, event.From, (event.Seconds+59)/60)
}Pozivi u svakom stacku, s cijelim postavljanjem:
Videopozivi u Next.js
Videopozivi u Express
Videopozivi u Laravel
Videopozivi u PHP
Videopozivi u Django
Videopozivi u FastAPI
Videopozivi u Flask
Videopozivi u iOS
Videopozivi u Android
Ili korak po korak, u pravoj aplikaciji: Kako ugraditi videopozive u Next.js aplikaciju
Gotovo ili vaše
Zaslon poziva spreman za upotrebu, ili vaš vlastiti
Zaslon poziva spreman je za upotrebu: gumbi za pozive, zvonjenje i prozor poziva, na webu, iOS-u i Androidu. Promijenite njegove boje i tekstove, zamijenite jedan njegov dio svojim ili izgradite vlastito sučelje na istom SDK-u.

Pozivi između dviju osoba šifrirani su s kraja na kraj na svakom putu, a grupni poziv onda kad tako kaže vaš poslužitelj.
Više od dvije osobe? Grupni pozivi rade na našim medijskim poslužiteljima, s domaćinima, govornicima i slušateljima.
Primjeri upotrebe
Što se gradi s pozivima
Svaki je cijela aplikacija u dokumentaciji, s poslužiteljem u Node.js-u, PHP-u i Pythonu.
Pozivi jednim gumbom
Gumb Nazovi podršku koji zvoni agentu u svakoj kartici koju ima otvorenu.
Konzultacije po dogovoru
Videopregled kod liječnice, odvjetnika, instruktorice ili trenera, otvoren samo dvjema osobama koje su ga rezervirale, u svoje vrijeme.
Sastanci tima
Videosastanak za svaki tim ili događaj, uz dijeljenje zaslona, koji voditelj završava za sve.
Nastava i audiosobe
Nastavnik ili panel govori, a ostali slušaju i dižu ruku da bi govorili.
Čekaonice i manje sobe
Gosti čekaju dok ih domaćin ne pusti unutra, a domaćin šalje ljude u manje sobe i vraća ih natrag.
Naplata poziva
Vaš poslužitelj saznaje koliko je dugo svaka osoba razgovarala, izbrojeno na našim poslužiteljima, za naplatu po minuti.
Cijene
Cijena prema vezama, nikad prema porukama
Od $11.99 mjesečno za 1.000 istodobnih veza uz godišnju naplatu, ili $14.99 uz mjesečnu naplatu.
Grupni pozivi iznad vašeg plana: $0.20 za 1.000 minuta, $0.10 sa zvukom.
Jedna cijena pri svakoj razlučivosti. Propusnost, releji i poruke nikad se ne naplaćuju, a pozivi između dvije osobe su uključeni. Sami vodimo svoje releje i medijske poslužitelje, pa su ove cijene niske.
Cijena prema istodobnim vezama, od 1000 naviše, mjesečna ili godišnja naplata. Pozivi između dvije osobe su neograničeni.
S 1.000 veza grupni pozivi nisu obračunati do 32 sudionika s videom istodobno, a osoba sa zvukom računa se kao pola, bez ograničenja broja osoba u pozivu. Svakih daljnjih 1.000 veza dodaje 12 sudionika s videom. Iznad toga svaka dodatna osoba s videom troši kredit po minuti, sa zvukom pola, a vaš plan dodaje 5.000 kredita mjesečno na svakih 1.000 veza.
Pitanja
Česta pitanja
Trebam li vlastite TURN ili medijske poslužitelje?
Ne. Poziv između dviju osoba ide izravno između dvaju uređaja kad može, preko naših releja kad vatrozid blokira izravan put, i preko naših medijskih poslužitelja kad ni releji do njega ne mogu doći. Grupni pozivi rade na našim medijskim poslužiteljima u nekoliko regija. Ništa ne morate sami hostati.
Koji stackovi mogu koristiti SDK za videopozive?
Next.js i Express, Laravel i čisti PHP, Django, FastAPI i Flask, Capacitor, iOS i Android, svaki s vodičem. Poslužitelj u bilo kojem drugom jeziku koristi HTTP API. Aplikacije u Flutteru imaju pozive na iOS-u i Androidu, a aplikacije u React Nativeu zasad na iOS-u.
Koliko se osoba može pridružiti grupnom pozivu?
Nema ograničenja broja osoba u pozivu. S 1.000 veza do 32 sudionika s videom istodobno ne troši kredite, a osoba sa zvukom računa se kao pola, i svakih daljnjih 1.000 veza dodaje 12. Iznad toga svaka dodatna osoba s videom troši kredit po minuti.
Jesu li pozivi šifrirani?
Da. Mediji poziva između dviju osoba šifrirani su s kraja na kraj na svakom putu, i kad ih prenose naši releji ili medijski poslužitelji. Grupni poziv šifriran je s kraja na kraj kad tako kaže vaš poslužitelj, ključem koji daje samo vaš poslužitelj.
Gdje su vaši poslužitelji?
Naši releji i medijski poslužitelji rade u ovim zemljama: Njemačka, Francuska, Ujedinjeno Kraljevstvo, Poljska, Kanada i Singapur. Svaki poziv ide preko onog koji je najbliži njegovim sudionicima. Uskoro: Sjedinjene Američke Države, Australija, Indija i Italija. Poslužitelji za rad u stvarnom vremenu koji prenose vaše događaje rade u Njemačkoj.
Tko odlučuje tko smije zvati koga?
Vaša aplikacija. Vaš poslužitelj daje stranici token za svaki poziv koji dopušta i za svaku osobu koja se pridruži grupnom pozivu, a token kaže tko govori, a tko samo sluša, i tko je domaćin. Dakle, tko što smije stvar je vaše vlastite logike, a bez tokena ništa ne počinje. Oblak provodi svaki token, a vaš poslužitelj može u svakom trenutku oduzeti pristup.
Mogu li izgraditi vlastito sučelje za pozive?
Da. Zaslon poziva nije obavezan. Promijenite njegove boje i tekstove ili sami pokrećite, primajte i prikazujte pozive na SDK-u, sve do svake osobe u grupnom pozivu.
Mogu li svojim korisnicima naplaćivati pozive?
Da. WordPlus Cloud putem webhooka javlja vašem poslužitelju koliko je trajao svaki poziv i kad se svaka osoba pridružila grupnom pozivu i napustila ga, izbrojeno na vlastitim poslužiteljima, kako bi vaša aplikacija mogla naplaćivati po minuti.
Pitanja o vašoj integraciji? Pišite nam: pomažemo sa SDK-ovima, zaslonom poziva i vašim stackom.