Skip to content

Instantly share code, notes, and snippets.

@TBertuzzi
Last active September 12, 2019 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TBertuzzi/7b511459b09bae0b91322425531bf74e to your computer and use it in GitHub Desktop.
Save TBertuzzi/7b511459b09bae0b91322425531bf74e to your computer and use it in GitHub Desktop.
opentok
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.OpenTok.Service;
namespace OpenTokExemplo
{
// Learn more about making custom code visible in the Xamarin.Forms previewer
// by visiting https://aka.ms/xamarinforms-previewer
[DesignTimeVisible(false)]
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void OnEndCall(object sender, EventArgs e)
{
CrossOpenTok.Current.EndSession();
CrossOpenTok.Current.MessageReceived -= OnMessageReceived;
Navigation.PopAsync();
}
private void OnMessage(object sender, EventArgs e)
{
CrossOpenTok.Current.SendMessageAsync($"Path.GetRandomFileName: {Path.GetRandomFileName()}");
}
private void OnSwapCamera(object sender, EventArgs e)
{
CrossOpenTok.Current.CycleCamera();
}
private void OnMessageReceived(string message)
{
DisplayAlert("Random message received", message, "OK");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment