roundware-web-framework
TypeScript icon, indicating that this package has built-in type declarations

0.12.8-alpha1 • Public • Published

RoundwareJS

Introduction

Roundware is a location-based contributory audio platform. This framework provides a JavaScript SDK for interacting with the Roundware Server API. The goal is to enable the creation of browser-based contributory audio and audio augmented reality applications. The library is written in ES6 but is built to run in all modern browsers that support HTML5 audio.

This is currently alpha software; the code is in flux!

Build & Install Locally

//
git clone git@github.com:roundware/roundware-web-framework.git
npm run build && npm pack

// isstall tarbal in your app
cd roundware-web-template
npm i ../roundware-web-framework/roundware-web-framework-0.12.4.tgz
npm start

Development with Framework & Web Template

npm watch

// inside web project
npm link ../roundware-web-framework

Code Samples

<html>
  <body>
    <script type="text/javascript" src="https://unpkg.com/roundware-web-framework@0.9.0-alpha/dist/roundware.umd.min.js"></script>
    <script>
      var roundwareServerUrl = "http://localhost:8888/api/2";
      var roundwareProjectId = 1;

      var roundware = new Roundware({ serverUrl: roundwareServerUrl, projectId: roundwareProjectId });

      function handleListening(streamURL) {
        var streamPlayer = $("#streamplayer");
        var audioSource  = $("#audiosource");
        var pauseButton  = $("#pause");

        console.info("Starting to listen to " + streamURL);
        audioSource.prop("src",streamURL);

        streamPlayer.trigger("load");
        streamPlayer.trigger("play");

        pauseButton.click(function() {
          console.info("pausing");
          streamPlayer.trigger("pause");
        }).show();
      };

      $(function startApp() {
        roundware.start().then(handleListening);
      });
    </script>

    <audio id="streamplayer" style="border: solid 1px black;">
      <source id="audiosource" type="audio/mp3"></source>
    </audio>

    <button id="pause""display: none;">Pause</button>
  </body>
</html>

TypeScript

You can use TypeScript interfaces by prefixing the class name with I Example:

import { IRoundware } from "roundware-web-framework/types";

const roundware: IRoundware = new Roundware(options);

Installation

Node

npm install roundware-web-framework

Browser

Contributor Workflow

npm run devstart && open http://localhost:8080/ # open example/ app
npm run test                                    # execute Jasmine test suite
npm run deploy                                  # publish new version of package

See HOW_TO_CONTRIBUTE.md for further details.

Resources

References

Development

See HOW_TO_CONTRIBUTE.

Pieces of Flair

Build Status

Copyright and License

By Mike Subelsky and other authors. See COPYRIGHT.txt and LICENSE.txt for more details.

Dependents (0)

Package Sidebar

Install

npm i roundware-web-framework

Weekly Downloads

79

Version

0.12.8-alpha1

License

AGPL-3.0-only

Unpacked Size

1.26 MB

Total Files

85

Last publish

Collaborators

  • subelsky
  • halsey
  • probabble
  • loafofpiecrust