Git Product home page Git Product logo

jstream-externs's Introduction

JStream API externs for Haxe

This is extern for Haxe. A tool for controlling JStream video player with Javascript for everyone.

Example

This is extern.

If you use jstream.loadAPI(), loading JStream API with HTML is unnecessary.

Please refer to the following haxe code or example directory.

HTML code:

<div id="video" data-video-id="MjUw"></div>

Haxe code:

import js.Browser;
import js.html.Element;
import jStream.JStream;
import jStream.PlayerFactoryOBJ;

class Main {

  public static function main():Void {

    Browser.window.addEventListener('DOMContentLoaded',init);

  }

  private static function init():Void {

    var target:Element = Browser.document.getElementById('video');
    var jstream:JStream = new JStream('eqz989uscl', 'NDk2', '50');

    function onAPIReady() {

      var player:JMCPlayer = PlayerFactoryOBJ.create({
        b:jstream.BASE_URL,
        c:jstream.CONTACT_ID,
        m:target.dataset.videoId,
        s:{ wp:640,hp:480,sn:SNS.list([google,twitter]) }
      },target.id);

      player.accessor.addEventListener(EventType.landing, function(info:Event) {
        trace(player.flashVars.thumbnail_url);
        trace(info);
      });

      player.accessor.addEventListener(EventType.change_state, function(info:Event) {
        trace(info);
      });

      player.accessor.addEventListener(EventType.error, function(info:ErrorEvent) {
        trace(info);
      });

    }

    jstream.loadAPI(onAPIReady);

  }

}

References

Original API document: https://support.eq.stream.co.jp/hc/ja/sections/115001876908-%E3%83%97%E3%83%AC%E3%82%A4%E3%83%A4%E3%83%BCAPI%E3%81%AE%E4%BB%95%E6%A7%98

jstream-externs's People

Contributors

okawa-h avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.