Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Controlling Frame Rate and Resolution

Sean Perkins edited this page Sep 6, 2016 · 1 revision

Note: This implementation is only valid as of release 1.5.0 and above. Lower revisions do not have this implementation available.

Access Publisher Object

Utilizing the Page class through the constructor, access the publisher object by looking up the element by the id that you supplied in the view.

import {TNSOTSession, TNSOTPublisher} from 'nativescript-opentok';

private publisher: TNSOTPublisher;

constructor(private page: Page) {
    super();
    this.session = TNSOTSession.initWithApiKeySessionId(this._apiKey, this.sessionId);
    this.publisher = <TNSOTPublisher> this.page.getViewById('publisher');
    this.initPublisher();
}

initPublisher() {
    this.session.connect(this.publisherToken);
    this.publisher.publish(this.session, '', 'HIGH', '30');
}

Notice the additional parameters with this line:

this.publisher.publish(this.session, '', 'HIGH', '30');
session name resolution fps
The underlying TNSOTSession instance. optional: The name to display on the video stream. optional: The resolution to display the stream in. Available options: LOW, MEDIUM, and HIGH. optional: The frames per second (fps) to display the stream in. Available options: 30, 15, 7, and 1.
Clone this wiki locally