Skip to content

elusu/ti.vonage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vonage module for Appcelerator Titanium



Buy Me A Coke donate button

Requirements

  • Titanium SDK 9+
  • Vonage (formerly OpenTok) account

API

Properties

  • apiKey
  • sessionId
  • token
  • audioOnly (creation only)

Methods

  • connect
  • disconnect

Events

  • ready
  • disconnected
  • streamReceived
  • streamDropped
  • sessionError
  • streamCreated
  • streamDestroyed
  • error

Example

<modules>
    <module platform="android">ti.vonage</module>
</modules>

index.xml

<Alloy>
	<Window onOpen="onOpen">
		<VonageView module="ti.vonage" id="vonage"/>
		<TextField hintText="api key" id="tf_api" value=""/>
		<TextField hintText="session id" id="tf_session" value=""/>
		<TextField hintText="token" id="tf_token" value=""/>
		<Button id="btn" title="connect" onClick="onClickConnect"/>
        <Button id="btn" title="disconnect" onClick="onClickDisconnect"/>
	</Window>
</Alloy>

index.js

$.index.open();

function onOpen(e) {
	$.vonage.initialize();
}

$.vonage.addEventListener("ready", function() {
	console.log("ready");
})

function onClickConnect(e) {
	$.vonage.apiKey = $.tf_api.value;
	$.vonage.sessionId = $.tf_session.value;
	$.vonage.token = $.tf_token.value;

	$.vonage.connect();
}

function onClickDisconnect(e) {
	$.vonage.disconnect();
}

index.tss

".container" : {
	backgroundColor: "white"
}
"TextField" : {
	borderWidth: 1,
	borderColor: "#000",
	left: 10,
	right: 10,
	backgroundColor: "transparent",
	color: "#000"
}
"#vonage" : {
	height: 400,
	width: Ti.UI.FILL,
	top: 0
}

build.gradle

repositories {
	google()
	jcenter()
	mavenCentral()
}

dependencies {
	implementation 'com.opentok.android:opentok-android-sdk:2.21.5'
	implementation 'pub.devrel:easypermissions:3.0.0'
}

About

Vonage module for Appcelerator Titanium

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%