Skip to content

Webplayer

Overview

The Netzyn WebPlayer provides for streaming a cloud app into a web page via either a browser app or a WebView embedded in another app. This is in lieu of using a platform native Netzyn Player app or library.

The Netzyn WebPlayer consists of a single javascript file, which is about 100KB in size. To use on a HTML page, include the javascript file, create a /div and initiate the single WebPlayer API. The WebPlayer will communicate to the Netzyn servers which will launch the desired cloud app. The cloud app will stream into the supplied div. The WebPlayer takes care of all interaction with the user, i.e. touch, mouse, keyboard, audio, etc.

image

API

The WebPlayer API consists of

    NzPlayerWebBrowser(alt_name, webplayer_div, app, orientation, auth_id, user_id, future, playerStatus);
        alt_name - leave blank
        webplayer_div - the div of the webplayer
        app - cloud app id
        orientation - portrait or landscape
        auth_id - authentication string provided by Netzyn
        user_id - ID of current user
        future - leave blank ( "" or '' )
        playerStatus - callback function that takes a status param; may be null

Github Repository

The Netzyn WebPlayer repo provides sample code that can be used as a starting point for the actual implementations.

https://github.com/Netzyn/webplayer

In the repo are four directories: page, timer, launcher and ttg. Page and timer are web pages that display the cloud app either as the entire page (page) or portion of the page (timer). Launcher and TTG (Try the Games) are examples that use play and/or timer. To get started go to the repo's Releases page and download/untar the latest version and place on a web server. For the example launch lines below, the repo has been placed in a webplayer directory on the web server. Before you can use any of these, you need to obtain an auth id from Netzyn and place the auth_id in timer.html and page.html files. For most development timer.html is the file to copy and use as the basis for the webpage that displays the cloud app. The ttg.html file contains a table of valid app ids (url field) to test with. This is used for the app parm in timer/page and the app field in NZPlayerWebBrowser() API.

page/

A page that displays the cloud app covering the full page. It is invoked with a parm with the app name. Example: https://<server_url>/webplayer/page/page.html?app=draw

timer/

A page that displays the cloud app plus a tool bar. The toolbar contains a timer along with an install button. It is invoked with parms for the app name and a URL to launch when the Install button is clicked.

Example: https://<server_url>/webplayer/timer/timer.html?app=draw&install=<app_store_url>

ttg/

A full featured example that uses timer above.

Example: https://<server_url>/webplayer/ttg/ttg.html

launcher/

A simple example that uses both page and timer above.

Example: https://<server_url>/webplayer/launcher/launcher.html