Skip to main content

AngularJS - Tables

Table data is normally repeatable by nature. ng-repeat directive can be used to draw table easily.  Following example states the use of ng-repeat directive to draw a table. <table> <tr> <th> Name </th> <th> Marks </th> </tr> <tr ng-repeat = "subject in student.subjects" > <td> {{ subject.name }} </td> <td> {{ subject.marks }} </td> </tr> </table> Table can be styled using CSS Styling. <style> table , th , td { border : 1px solid grey ; border - collapse : collapse ; padding : 5px ; } table tr : nth - child ( odd ) { background - color : #f2f2f2; } table tr : nth - child ( even ) { background - color : #ffffff; } </style> Example Following example will showcase all the above mentioned directive. <html> <head> <

Audio Conference Call Demo Application(iOS) by voxeet

Download Demo Application

Voxeet iOS SDK

Voxeet SDK logo
The Voxeet SDK is a Swift library allowing users to:
  • Create demo/normal conferences
  • Join conferences
  • Change sounds angle and direction for each conference user
  • Broadcast messages to other participants
  • Send and receive video stream

Table of contents

  1. Requirements
  2. Sample Application
  3. Installing the iOS SDK
  4. SDK Initialization
  5. SDK Usage
  6. VTAudioSound Usage
  7. Available delegates / callbacks

Requirements

  • iOS 8.0+
  • Xcode 7.3+

Sample Application

A sample application is available on this public repository on GitHub.

Installing the iOS SDK

You need to disable Bitcode in your Xcode target settings: 'Build Settings' -> 'Enable Bitcode' -> No
To enable background mode, go to your target settings -> 'Capabilities' -> 'Background Modes'
Turn on 'Audio, AirPlay and Picture in Picture'
Turn on 'Voice over IP'

Installation with CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To integrate VoxeetSDK into your Xcode project using CocoaPods, specify it in your Podfile:
use_frameworks!

target "YourTarget" do
       pod 'VoxeetSDK', '~> 1.0'
end
Then, run the following command:
$ pod install

Installation with Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
To integrate VoxeetSDK into your Xcode project using Carthage, specify it in your Cartfile:
github "voxeet/ios-sdk-sample" ~> 1.0
Run carthage update to build the framework and drag the built VoxeetSDK.framework into your Xcode project.

SDK Initialization

Initialize the SDK in the AppDelegate.swift of your application:
import VoxeetSDK

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

        // Initialization of the Voxeet SDK.
        VoxeetSDK.sharedInstance.initializeSDK("consumerKey", consumerSecret: "consumerSecret")

        return true
    }

    ...
}

SDK Usage

Initializing

VoxeetSDK.sharedInstance.initializeSDK("consumerKey", consumerSecret: "consumerSecret")
If you use external login like O365, LDAP, or custom login to retrieve contact details it's now possible to also add your contact ID with the display name and the photo URL avatar.
This allows you to ask guest users to introduce themselves and provide their display name and for your authenticated users in your enterprise or for your clients the ID that can be retrieved from O365 (name, department, etc).
VoxeetSDK.sharedInstance.initializeSDK("consumerKey", consumerSecret: "consumerSecret", externalID: "ID", name: "name", avatarURL: "URL")

Creating a demo conference

VoxeetSDK.sharedInstance.conference.createDemo { (error) in 
}

Creating a conference

VoxeetSDK.sharedInstance.conference.create(success: { (confID, confAlias) in
    }, fail: { (error) in
})

Joining a conference

VoxeetSDK.sharedInstance.conference.join(conferenceID: confID) { (error) in
}
VoxeetSDK.sharedInstance.conference.join(conferenceAlias: confAlias) { (error) in
}

Leaving a conference

VoxeetSDK.sharedInstance.conference.leave { (error) in
}

Getting a specific conference status

VoxeetSDK.sharedInstance.conference.status(conferenceID: "", success: { (json) in
    }) { (error) in
}

Getting own users

let ownUser = VoxeetSDK.sharedInstance.conference.getOwnUser()

Getting current conference users

let users = VoxeetSDK.sharedInstance.conference.getUsers()

Getting a specific user's information

let infos = VoxeetSDK.sharedInstance.conference.getUserInfo("userID")

Changing user position

// Values for angle and distance are between: angle = [-1, 1] and distance = [0, 1]
VoxeetSDK.sharedInstance.conference.setUserPosition("userID", angle: 0, distance: 0)
VoxeetSDK.sharedInstance.conference.setUserAngle("userID", angle: 0)
VoxeetSDK.sharedInstance.conference.setUserDistance("userID", distance: 0)

Getting a specific user position

let (angle, distance) = VoxeetSDK.sharedInstance.conference.getUserPosition("userID")

Sending broadcast message in a conference

VoxeetSDK.sharedInstance.conference.sendBroadcastMessage("message", completion: { (error) in
})

Muting / Unmuting a user

VoxeetSDK.sharedInstance.conference.muteUser("userID", mute: true)

Checking if a user is muted

let isMute = VoxeetSDK.sharedInstance.conference.isUserMuted("userID")

Changing output device

if VoxeetSDK.sharedInstance.conference.setOutputDevice(VTOutputDeviceType.BuildInReceiver) {
    print("The output device has been changed.")
}

Getting output devices

let (currentOutputDevice, availableOutputDevices) = VoxeetSDK.sharedInstance.conference.getOutputDevices()

Connecting the SDK with the API (manually)

This optional method is automatically called before a regular request anyway. For example 'createDemoConference' calls internally 'connect'.
VoxeetSDK.sharedInstance.connect { (error) in
}

Disonnecting the SDK with the API (manually)

This optional method can help to disconnect the SDK if you don't use it anymore.
VoxeetSDK.sharedInstance.disconnect { (error) in
}

Available delegates / callbacks

Session

class myClass: VTSessionStateDelegate {
    init() {
        // Session delegate.
        VoxeetSDK.sharedInstance.sessionStateDelegate = self
    }

    func sessionStateChanged(state: VTSessionState) {
    }
}
or
VoxeetSDK.sharedInstance.sessionStateChanged = { state in
}

Conference

class myClass: VTConferenceDelegate {
    init() {
        // Conference delegate.
        VoxeetSDK.sharedInstance.conference.delegate = self
    }

    func userJoined(userID: String, userInfo: [String: AnyObject]) {
    }

    func userLeft(userID: String, userInfo: [String: AnyObject]) {
    }

    func messageReceived(userID: String, userInfo: [String: AnyObject], message: String) {
    }
}
or
VoxeetSDK.sharedInstance.conference.userJoined = { (userID, userInfo) in
}

VoxeetSDK.sharedInstance.conference.userLeft = { (userID, userInfo) in
}

VoxeetSDK.sharedInstance.conference.messageReceived = { (userID, userInfo, message) in
}

Conference media

class myClass: VTConferenceMediaDelegate {
    @IBOutlet weak var videoRenderer: VideoRenderer!

    init() {
        // Conference media delegate.
        VoxeetSDK.sharedInstance.conference.mediaDelegate = self
    }

    func streamAdded(stream: MediaStream, peerID: String) {
        // Attaching a video stream to a renderer.
        VoxeetSDK.sharedInstance.conference.attachMediaStream(videoRenderer, stream: stream)
    }

    func streamRemovedForPeer(peerID: String) {
    }

    func streamScreenShareAdded(stream: MediaStream, peerID: String) {
        // Attaching a video stream to a renderer.
        VoxeetSDK.sharedInstance.conference.attachMediaStream(videoRenderer, stream: stream)
    }

    func streamScreenShareRemoved(peerID: String) {
    }
}
or
VoxeetSDK.sharedInstance.conference.streamAdded = { (stream: MediaStream, peerID: String) in
}

VoxeetSDK.sharedInstance.conference.streamRemoved = { (peerID: String) in
}

VoxeetSDK.sharedInstance.conference.streamScreenShareAdded = { (stream: MediaStream, peerID: String) in
}

VoxeetSDK.sharedInstance.conference.streamScreenShareRemoved = { (peerID: String) in
}

Available enums

Session state:

public enum VTSessionState {
    case NotConnected
    case Connected
    case Connecting
    case Reconnecting
}

Output devices:

public enum VTOutputDeviceType: Int {
    case BuildInReceiver
    case BuiltInSpeaker
    case Headset
    case LineOut
    case Bluetooth
    case CarAudio
    case HDMI
    case AirPlay
}

Error handler:

public enum VTErrorType: ErrorType {
    case Credential(String)
    case InternalServer
    case AccessToken
    case NoLiveConference
    case LeaveConference
    case CreateConference
    case JoinConference
    case SendBroadcastMessage
    case ServerError(String?)
    case Error(ErrorType?)
}

VTAudioSound Usage

VTAudioSound helps you to play a TrueVoice 3D audio sound into your application.
The sound must be encoded in mono to be played spatialized.

Initializing

var sound: VTAudioSound?

if let path = NSBundle.mainBundle().pathForResource("myFile", ofType: "mp3") {
    do {
        sound = try VTAudioSound(url: NSURL(fileURLWithPath: path))
    } catch let error {
        // Debug.
        print("::DEBUG:: \(error)")
    }
}

Playing sound

try? sound?.play() {
    // Debug.
    print("::DEBUG:: The sound has finished being played.")
}

Stopping sound

sound?.stop()

Checking if the sound is playing

let isPlaying = sound?.isPlaying

Looping on the current sound

sound?.loop = true

Getting filename of the sound

let filename = sound?.filename

Setting / Getting volume

// The range of valid values are from 0.0 to 1.0.
sound?.volume = 1
let volume = sound?.volume

Setting / Getting angle

// The range of valid values are from -1.0 to 1.0.
sound?.angle = 0
let angle = sound?.angle

Setting / Getting distance

// The range of valid values are from 0.0 to 1.0.
sound?.distance = 0
let distance = sound?.distance

Version

1.0.1.9

Tech

The Voxeet iOS SDK uses a number of open source projects to work properly:
  • Starscream - Starscream is a conforming WebSocket (RFC 6455) client library in Swift for iOS and OSX.
  • Alamofire - Alamofire is an HTTP networking library written in Swift.
  • SwiftyJSON - SwiftyJSON makes it easy to deal with JSON data in Swift.
  • CryptoSwift - Crypto related functions and helpers for Swift implemented in Swift.

Comments

Popular posts from this blog

AngularJS - Tables

Table data is normally repeatable by nature. ng-repeat directive can be used to draw table easily.  Following example states the use of ng-repeat directive to draw a table. <table> <tr> <th> Name </th> <th> Marks </th> </tr> <tr ng-repeat = "subject in student.subjects" > <td> {{ subject.name }} </td> <td> {{ subject.marks }} </td> </tr> </table> Table can be styled using CSS Styling. <style> table , th , td { border : 1px solid grey ; border - collapse : collapse ; padding : 5px ; } table tr : nth - child ( odd ) { background - color : #f2f2f2; } table tr : nth - child ( even ) { background - color : #ffffff; } </style> Example Following example will showcase all the above mentioned directive. <html> <head> <

How to Password Protect a Directory on Your Website

Password protecting a directory on your site is actually fairly easy. Webmasters typically want to protect a directory if they have information that they want to make available only to a selected number of people. This guide teaches how you can make a folder on  your website  accessible only to people with the appropriate password. If Your Web Host Has a Control Panel Before you dive into the task of manually password-protecting a directory using Apache's built-in facilities, you might want to check out your web host's control panel to see if they already provide the facility for protecting directories. In my experience, many commercial web hosts already provide an easy way for you to password-protect your directories. If such facility is already available, it's probably best to use it since it will save you time, particularly if you are not familiar with shell command lines and editing of .htaccess files. Otherwise, read on. System Requirements You wi

Apple iOS 10.2 Is Now Available: What Is Included In The Update?

Apple has released iOS 10.2 to the general public today. The last time that Apple launched an iOS update was on October 31st with iOS 10.1.1. On that same day, Apple released the developer preview of iOS 10.2. To work out the kinks, Apple iOS 10.2 went through seven beta tests before the public release. This update includes several major features and many bug fixes. You can install iOS 10.2 by connecting your device to iTunes or downloading it by going to  Settings > General > Software Update . The iOS 10.2 update is available for the following devices: iPhone 5 and later, iPad 4th generation and later and iPod touch 6th generation and later. What Is Included In The Update? iOS 10.2 has several features worth pointing out: - New TV App Apple released a new TV app that provides recommendations for new movies and TV shows in the "Watch Now" section and to discover new apps and new iTunes releases in the "Store" section. The "Up Next"