Giter VIP home page Giter VIP logo

furioos-sdk-js's Introduction

Furioos SDK JS

⚠️ if you are using the first version of the SDK, please refer to this documentation: Furioos SDK V1

Requirements

  • A Furioos Account on www.furioos.com.
  • Then choose the application you want to use with the SDK and create a SDK link.

Table of contents

About Furioos SDK

The Furioos SDK is composed of 2 parts:

  • one is on the website side
  • and the other one is on the application side

On the website side you have to use the Furioos SDK JS. It allows you to :

  • embed the Furioos player into your website and customize it
  • communicate with your Unity or Unreal application

Why cutomize your Furioos player

Here are some possible use cases for player customization (it's not an exhaustive list):

  • remove all Furioos branding
  • hide the play button
  • hide the player toolbar and build a new one from your website
  • create your own installation progress bar
  • trigger your own features once the stream has been started
  • ...

Note: For these examples you just need to have the Furioos SDK JS in your website.

Communication inbetween my website and my application

However, if you need to communication inbetween your website and your Unity or Unreal application, you will need to add the Furioos SDK (Unity or Unreal) into your application. This allows you to send and receive bidirectional messages.

Important: Before sending or receiving messages, the session must be launched. You can check it with ON_APP_START event

Here are some examples:

  • If you want to change the color of an object from your website, you can:
    • Send a message with the final color from your website
    • From your application, get the color in the message and assign the material with the new color
  • If you want to get the position of the player to display it on your website
    • Send a message with player coord from the application
    • From your website, get the coordinates and show it on your website

To implement a bidirectionnal communication you can find details below:

Example of application

Here is an example of an application that customizes the Furioos player and uses the message system for a complete integration with the website.
On the left, the menu is on the website side (html).
On the right, the house dispay is on the application side (Furious player).

Installation

Via NPM

npm install --save furioos-sdk

or

yarn add furioos-sdk

You can find a full example HERE

Via CDN

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/furioos.bundle.js"></script>

You can find a full example HERE

API

constructor(sdkShareLinkID, containerDivId, options)

Instanciate the player for a given application.

Property Type Description optional DefaultValue
sdkShareLinkID String Furioos SDK Link ID of the application you want to share. false null
containerDivId String The ID of the HTML container div that will host the render. false null
options Object The options to setup the player are these following : true {}
options:
Property Type Description optional DefaultValue
whiteLabel Boolean Remove all Furioos' Logo true false
hideToolbar Boolean Hide the toolbar to create your own true false
hideTitle Boolean Hide the title bar to create your own true false
hidePlayButton Boolean Hide the play button true false
debugAppMode Boolean Active local debug of your application. See Debug localy the SDK communication tunnel for more detail true false
inactiveTimeout Number Defines the inactivity time in a session before it closes (in ms) Min: 10s / Max: 24h true 60000 (ms)

Basic Example

import { Player, FS_SDK_EVENTS_NAME } from 'furioos-sdk';

const options = {
  whiteLabel: true,
  hideToolbar: false,
  hideTitle: true,
  hidePlayButton: false,
  inactiveTimeout: 60000,
};

const player = new Player("YOUR_SDK_LINK_ID" ,"containerDivId", options);

// Bind player loaded
player.on(FS_SDK_EVENTS_NAME.LOAD, function() {
  console.log("SDK client FIRED: Player loaded");
});

// Bind application install progress
player.on(FS_SDK_EVENTS_NAME.ON_APP_INSTALL_PROGRESS, function(data) {
  console.log("SDK client FIRED: App install progress", data);
});

// Bind application start
player.on(FS_SDK_EVENTS_NAME.ON_APP_START, function() {
  console.log("SDK client FIRED: App start");
});

// Bind stream start
player.on(FS_SDK_EVENTS_NAME.ON_STREAM_START, function() {
  console.log("SDK client FIRED: Stream start");
});

// Bind stream start
player.on(FS_SDK_EVENTS_NAME.ON_SDK_START, function() {
  console.log("SDK client FIRED: SDK start");
});

// Bind SDK messages
player.on(FS_SDK_EVENTS_NAME.ON_SDK_MESSAGE, function(data) {
  console.log("SDK Message Received:", data);
});

// Bind an event that lets you know if you can resume session
player.on(FS_SDK_EVENTS_NAME.ON_RESUME_SESSION, function({ canResumeSession }) {
  if(canResumeSession) {
    player.resumeSession();
  }
});

// Bind session stoppeds
player.on(FS_SDK_EVENTS_NAME.ON_SESSION_STOPPED, function() {
  console.log("SDK client FIRED: Session Stopped");
});

Properties

important These properties are only getters

quality: String

Get the current setted quality. Possible values : AUTO / LOW / MEDIUM / HIGH

volume: Number

Get the current setted volume. Value between 0 - 1

Methods

setThumbnailUrl(url)

Change the thumbnail of your app.

Property Type Description DefaultValue
url String A public url of the thumbnail you want to set null
getServerAvailability(function(data) {}, function(error) {})

Call this function to get an estimated time to get a session on Furioos.

data:

Property Type Description DefaultValue
assignTime Number Estimated time (minutes) to be assigned to a server 0
launchTime Number Estimated time (minutes) for your app to be ready (copied, extracted and launched) 0
availableMachines Number Number of ready VM waiting for a session 0
*maximumMachines Number Maximum machines setted on your campaign 0
*usedMachines Number Number of current used machines in your pool 0
*creatingMachines Number Number of creating machines (creating machine in the cloud) 0
*installingMachines Number Number of installing machine (installing your application on it) 0

* Those values are only available for an application running on a pre-allocated campaign.

Example:

  player.getServerAvailability(function(data) {
    console.log("Time to assign a server: ", data.assignTime);
    console.log("Time to copy, extract and launch your application: ", data.launchTime);
    console.log("Number of machines ready for a session: ", data.availableMachines);
    console.log("Total time to get session ready: ", data.assignTime + data.launchTime);
  }, function(error) {
    // Treat the error.
  });
getServerMetadata(function(metadata) {}, function(error) {})

Call this function to get unique VM informations. This function returns metadata only if a session is running.

metadata:

Property Type Description DefaultValue
publicIP String The VM public IP. ""
name String A unique name to identify a VM. ""

Example:

  player.getServerMetadata(function(metadata) {
    console.log("Public VM IP: ", metadata.publicIP);
    console.log("VM unique name: ", metadata.name);
  }, function(error) {
    // Treat the error.
  });
start(location)

Start a new session.

Property Type Description DefaultValue Optional
location String The VM public IP. "" true

Example:

  player.start(Player.regions.EUW);

stop()

Stop the session.

maximize()

Enable Full screen mode.

minimize()

Disable Full screen mode.

setQuality(quality)

Set the quality of the stream.
Use the new quality values by importing FS_QUALITY_VALUES
⚠️ You can access deprecated quality values by importing QUALITY_VALUES. However these value are no longer available.

Property Type Description DefaultValue Optional
quality QualityValue Use one of the static value FS_QUALITY_VALUES.AUTO / FS_QUALITY_VALUES.LOW / FS_QUALITY_VALUES.MEDIUM / FS_QUALITY_VALUES.HIGH Furioos App Quality false

Example:

  player.setQuality(FS_QUALITY_VALUES.HIGH);

restartStream()

Restart the streaming.

resumeSession()

Resume active session. You can only call this method after check the response value of ON_RESUME_SESSION event

setVolume(volume)

Set the volume of the stream.

Property Type Description DefaultValue Optional
volume Number Volume intensity between 0 - 1 1 false

Example:

  player.setVolume(0.5);

toggleMuted()

Mute the stream. You can call this method before the application is launched with the ON_APP_INSTALL_SUCCESS event.

setUserActive()

This function helps you to keep the session opened if your user does not interact with the interface.
Calling this function will fire onUserActive.

⚠️ important: We recommended to use inactiveTimeout in Player constructor instead of calling this function. If you always call it without checking if the user is really here the session will never end untill the user close their window.

Events

.on(FS_SDK_EVENTS_NAME, callback)

To be able to bind player events, you just need to call the .on function and give it an SDK events parameter and a callback to get the infos. All FS_SDK_EVENTS_NAME constants are accessible from the furioos-sdk package.

LOAD

Bind a callback that will be called when the player is ready.

Example

player.on(FS_SDK_EVENTS_NAME.LOAD, function(data) {
   // Here you know when the player is ready.
    console.log("SDK client FIRED: Player loaded");
})
ON_APP_INSTALL_PROGRESS

Bind a callback that will be called during your application installation. You'll receive the progress of the installation.

data:

Property Type Description Value
status String The current installation step "COPY" or "UNARCHIVE"
progress Number The progress value between 0 and 1

Example

player.on(FS_SDK_EVENTS_NAME.ON_APP_INSTALL_PROGRESS, function(data) {
  // Implement your own code.
  console.log(data.status + " the application : " + Math.round(data.progress*100) + "%");
})
ON_APP_INSTALL_SUCCESS

Bind a callback that will be called when your application installation has succeed.

Example

player.on(FS_SDK_EVENTS_NAME.ON_APP_INSTALL_SUCCESS, function() {
  // Implement your own code.
  console.log("My application is fully installed");
})
ON_APP_INSTALL_FAIL

Bind a callback that will be called when your application installation has failed.

Example

player.on(FS_SDK_EVENTS_NAME.ON_APP_INSTALL_FAIL, function() {
  // Implement your own code.
  console.log("Installation has failed");
})
ON_APP_START

Bind a callback that will be called when your application starts.

Example

player.on(FS_SDK_EVENTS_NAME.ON_APP_START, function() {
  // Implement your own code.
  console.log("Application started");
})
ON_STREAM_START

Bind a callback that will be called when the stream starts.

Example

player.on(FS_SDK_EVENTS_NAME.ON_STREAM_START, function() {
  // Implement your own code.
  console.log("Stream started");
})
ON_SDK_START

Bind a callback that will be called when the SDK start.

Example

player.on(FS_SDK_EVENTS_NAME.ON_SDK_START, function() {
  // Implement your own code.
  console.log("SDK started");
})
ON_USER_ACTIVE

Bind a callback that will be called when the user is **active** on your session (only fired when a session is running).

Example

player.on(FS_SDK_EVENTS_NAME.ON_USER_ACTIVE, function() {
  // Implement your own code.
  console.log("My user is active");
})
ON_USER_INACTIVE

Bind a callback that will be called when the user is **inactive** on your session (only fired when a session is running).

Example

player.on(FS_SDK_EVENTS_NAME.ON_USER_INACTIVE, function() {
  // Implement your own code.
  console.log("My user is inactive");
})
ON_SESSION_STOPPED

Bind a callback that will be called when the session is stopped (ex: stopped for inactivity).

Example

player.on(FS_SDK_EVENTS_NAME.ON_SESSION_STOPPED, function() {
  // Implement your own code.
  console.log("The session has been stopped");
})
ON_STATS

Bind a callback that will be called frequently during a running session with all stats.

stats:

Property Type Description DefaultValue
appHeight Number Height of the application screen on VM 0
appWidth Number Width of the application screen on VM 0
dataLatency Number Round trip network latency 0
dataMethod String events/data transmission method (value: "datachannel" or "ws") "datachannel"
packetsLost Number Percent of lost packets (value: 0 to 1) 0
serverCpuUsage Number Server CPU usage 0
serverEncodingMs Number Server encoding time (milliseconds) 0
serverFramerate Number Server framerate 0
serverGpuMemTotal Number Total GPU RAM available on server (byte) 0
serverGpuMemUsed Number Current GPU RAM used on server (byte) 0
serverGpuUsage Number Server GPU usage percent 0
serverGrabbingMs Number Server grabbing time (milliseconds) 0
serverRamTotal Number Total RAM available on serve (byte) 0
serverRamUsed Number Current RAM used on server (byte) 0
streamingEngine String Current streaming engine used (value: "Furioos" or "RenderStreaming") "Furioos"
userActive Boolean Define if the user is consider as active by the Furioos player 0
videoBitrate Number Received video bitrate (kbps) 0
videoFramerate Number Received video framerate 0
videoHeight Number Heigh of the received video 0
videoWidth Number Width of the received video 0
videoLatency Number Total video latency (round trip network latency + decoding time) 0

Example

player.on(FS_SDK_EVENTS_NAME.ON_STATS, function(stats) {
  // Implement your own code.
  console.log("Stats received: ", stats);
})
ON_SDK_MESSAGE

Bind a callback that will be called while your application is sending you data. Data can be a String or an Object.

Example

player.on(FS_SDK_EVENTS_NAME.ON_SDK_MESSAGE, function(data) {
  // Implement your own code.
  console.log("The application sent: " + data);
})
ON_CRASH_APP

Bind a callback that will be called when your application crashes.

Example

player.on(FS_SDK_EVENTS_NAME.ON_CRASH_APP, function() {
  // Implement your own code.
  console.log("The application crashed");
})
ON_RESUME_SESSION

Bind a callback that will be called when the player is initialized. It Lets you know if you can restart a session in progress.

data:

Property Type Description Value
canResumeSession Boolean Define if you can resume a session or not

Example

player.on(FS_SDK_EVENTS_NAME.ON_RESUME_SESSION, function(data) {
  // Implement your own code.
  if(data.canResumeSession) {
    player.resumeSession();
  }
  console.log("Can resume sesssion: " + data.canResumeSession);
})

Communicate with your application

Go deeper with your UI by creating your own data interpretation.
Those methods let you send/receive JSON data inbetween your application and the HTML page where you have implemented the JS SDK.

Requirements

.on(FS_SDK_EVENTS_NAME.ON_SDK_MESSAGE, function(data) {})

Bind a callback to receive messages from your application.

Property Type Description DefaultValue Optional
data Object The JSON that you send from your application. null false

Example:

  player.on(FS_SDK_EVENTS_NAME.ON_SDK_MESSAGE, function(data) {
    console.log("Message received from my application: ", data);
  });
sendSDKMessage(data)

Send data to your own application by using the Furioos SDK.

Property Type Description DefaultValue Optional
data Object The data you want to send to your app formated in JSON. null false

Example:

  player.sendSDKMessage({ "test": "test" }); 

Examples of implementation

Debug localy the SDK communication tunnel

The Furioos SDK Unity provides a local debug mode, to facilitate the debugging of sending and receiving messages.

Note: There will be no stream.

This feature opens a direct tunnel inbetween your website and your application running locally.
Only sendSDKMessage and onSDKMessage can be used here to test the communication.

How does it work ?

Webclient Side

To enable debugging mode you have to set the debugAppMode property to true.

import { Player } from 'furioos-sdk';

const options = {
  whiteLabel: true,
  hideToolbar: false,
  hideTitle: true,
  hidePlayButton: false,
  debugAppMode: true, // This enable the local debug mode.
};

const player = new Player("YOUR_SDK_LINK_ID", "containerDivId", options);

When you launch your site in debug mode, the stream is not displayed, the following message will appear on your player.

Unity Side

Nothing to configure. When you start your application(With last version of the Furioos SDK Unity) with the play button in the Unity Editor, the local debug mode is automatically enabled.

Unreal Engine Side

For the moment, it is not possible activate the debug mode. The new version of the Furioos SDK for Unreal is coming soon.

⚠️ Common Errors

  • Failed to execute 'postMessage' on 'DOMWindow': The target origin (http://....) provided does not match the recipient window's origin ('http://...')

    This error means that you do not have the correct website URL set on your SDK link, on Furioos side.
    Your player’s implementation url must match the website URL entered when creating your SDK link on the Furioos side. If you’re working locally, remind that you might need to change the URL on the SDK Link, example: http://localhost:8080.

furioos-sdk-js's People

Contributors

donjgo avatar julix91 avatar k-mick avatar ludocz avatar p-govaere avatar paul-govaere avatar rouxjulien avatar samuel-tranchet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

furioos-sdk-js's Issues

Furioos does not send the data

I'm trying to retrieve the data from a session to my app using the events specified in the documentation.
Even though I have set all the events and tried to log some data to the console, like in the examples, nothing appears in my logs.

Also, I think it is worth mentioning that when I import the 'furioos-sdk' module, it says that "Could not find a declaration file for module 'furioos-sdk'"

This is the code I have written, maybe there is a mistake in it:

FurioosCode

FS_SDK_EVENTS_NAME is undefined

I have been using furioos-sdk for a while,however, FS_SDK_EVENTS_NAME is undefined.
I cant access FS_SDK_EVENTS_NAME like this:
import { FS_SDK_EVENTS_NAME } from 'furioos-sdk'

Feature request: hideToasters

Hello there,

Would it be possible to add a parameter to hide toasters from furioos ?
Or maybe there is an option in the backoffice already ?

Thanks !

Capture d’écran 2022-05-24 à 09 38 50

Cursor locking issues

In our application we have the requirement to lock/unlock the cursor quite frequently.
As I do not want the user to constantly click on the iframe if the cursor is locked the remote application sends a cursor locking signal to the js frontend indicating that the cursor needs locking. This works fine basically, the cursor is hidden and locked as I only need an explicit user gesture the first time the cursor is locked (except if the escape key is pressed).

However the furioos player keeps displaying "click to lock cursor" in the lower right corner even if the cursor is already locked and after the cursor is locked no mouse input whatsoever is transmitted to the remote application.
Is there someway to tell the player that the cursor is locked? There are maximize()/minimize() methods but no cursor locking methods available.

The following code is executed whenever I receive a cursor lock request through the OnSDKMessage callback:

var iframe = document.getElementById("furioos-sdk-iframe");
iframe.requestPointerLock = iframe.requestPointerLock || iframe.mozRequestPointerLock ||  iframe.webkitRequestPointerLock;
iframe.requestPointerLock();

How to get screen captures

I have an app in which the user can take screen captures. When using this on desktop this simply saves JPGs to a folder. When streaming it through Furioos it seems I do not have access to any files created by the app. Is this correct?

I can think of a couple of other ways to get the image:

  • Use the SDK to send the JPG as a dataURI in JSON (depends if there’s a limit on the message size?)
  • Update the app to store the data to a cloud storage container instead

Just curious to see if there is a standard approach or if others have found a good solution to this?

OnSDKMessage was designed for debug only?

Hello there !
I'm trying to send a text string from my unreal app to furioos to tell the browser to open a new link in a new tab ! And I tried doing that using SendSDKMessage but looks like it was only designed to work in debug mode:
this.sdkDebug.onSDKMessage((data) => { // Here you can manage the received data. if (this._onSDKMessageCallback) { this._onSDKMessageCallback(data); }

support portrait mode (9:16 aspect ratio)

When can we expect more aspect ratios to be supported, as I understand for now only 16:9 , 16:10 and 4:3 is supported. Our application is mostly used by mobile users and we need to support both portrait and landscape mode.

Request for fullscreen was denied

I get the following error in Firefox :

Request for fullscreen was denied because Element.requestFullscreen() was not called from inside a short running user-generated event handler.

Uncaught (in promise) TypeError: Fullscreen request denied
    request https://portal.furioos.com/7f957b9e99457de541abce2bebcbe82199b1631a.js?meteor_js_resource=true:228
[...]

fullscreenerror { target: Restricted, isTrusted: true, srcElement: Restricted, eventPhase: 0, bubbles: true, cancelable: false, returnValue: true, defaultPrevented: false, composed: true, timeStamp: 127985, … }

Events do not get invoked, when player has been stopped once

Description

When the player is stopped and restarted, the events bound to the player are no longer invoked.

Expected behavior

Events are invoked each time.

Actual behavior

Events are only invoked before the player has been stopped once.

How to reproduce

  1. Enter a valid shared link in index.js
  2. Launch the application as described in README
  3. In the browser press the start session button
  4. Note that the logs from the events are logged to the console
  5. When the application has launched, press the stop session button
  6. Press the start session button again
  7. Note that no events are logged to the console this time

Autoplay Video blocked by Browser?

Hello,
I'm implementing Furioos player on a web page and I'm trying to get the video starting without the user has to click on the play button.

So as first step I've hidden the play button with the option "hidePlayButton: true".

Then, when player is loaded o the page I start the player
player.onLoad(function() { // Here you know when the player is ready. player.start(); })

Until here all good. Player is started.

But then I cannot see the "real video" starting, but I got a message from the browser (Chrome)

Screenshot 2020-12-02 at 10 57 01

I know this a normal behaviour from modern browser to avoid autoplaying.

Just wondering if there are:
1 some option to bypass it (in the player sdk itself)
2 or if my logic steps are correct
3 or there are some strategies you suggested for solving this issue.

Could you give me some support or tips? :)

Fullscreen focus method

I'm trying to fullscreen the container rather than use the maximize method. We are triggering from outside the app that contains other media so we need to fullscreen a parent iframe.

On OSX Safari, the keyboard controls don't register with the embed unless you click off and then click back on. Is there a way to force focus on the furioos player? Perhaps a focus method would help we can trigger from outside? Because of cross-domain issues, I can't target the element directly.

integration and support with ASP.NET Core

I'm trying to integrate furioos-sdk-js into web application built on ASP.NET Core .

The player initialization is unable to find the document object .

I'm calling the code like this

ViewData["player"] = await _nodeServices.InvokeAsync<ExpandoObject>("./node_modules/furioos-sdk/index.js", sdkId,divId);

Any thoughts and support on the integration would be highly appreciated.

JSON.Parse exception with debugAppMode: true

When testing the Furioos SDK with debugAppMode: true, an exception is thrown when the sign-in message ({"type" :"signIn","peerName" :"SDK_APP"}) is received from the application:

Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data
    _wsOnMessage SDKDebug.js:33
    onmessage SDKDebug.js:12
    SDKDebug SDKDebug.js:12
    Player Player.js:112
    [1]< index.js:6
    o _prelude.js:1
    r _prelude.js:1
    <anonymous> _prelude.js:1

It seems that JSON.parse is passed an ArrayBuffer instead of a string in _wsOnMessage

This can be fixed by decoding the ArrayBuffer before parsing its content:

  decoder = new TextDecoder()

  _wsOnMessage(event) {
    const str = this.decoder.decode(event.data);
    const msg = JSON.parse(str);
...

However, the message will be discarded because it is not recognized by the following test:

...
  if (msg.type == "furioos" && msg.task == "sdk") {
...

"onAppInstallProgress" event can not be trigger

"onAppInstallProgress" event can not be trigger after click play button.

this.player = new Player(this.appId, "main", this.options);
this.player.onAppInstallProgress((data) => {
  console.log("event onAppInstallProgress", data);
});

Then I debug info in Player.js, it has no onAppInstallProgress event

  _onLoad() {
    // Bind listener for the messages.
    window.addEventListener("message", (e) => {
      console.log(e.data.type)
      switch (e.data.type) {....

furioos version: 1.2.5

FurioosSDK class in not found

I tried to install it suing npm and didn't find the FurioosSDK class,
also tried the cdn and it gave me the same error

[Request] Documentation or example on Furioos Signalling and Furioos Render Stream Bridge

I couldnt find any documentation how to use furioos signalling or furioos bridge with unity apps that uses render streaming.
The example in samples package does not tell anything at all. I would like to learn more about these features.

I am trying to create a connection from a webapp which creates stream of user's webcam and sends it to the unity app working on furioos.

As far as I understand Furioos signalling or furioos bridge could help me achieve this problem.

Vivox is not an option at this point so please do not offer it.

Issue with session resume

Hi Furioos Team,

We've implemented Furioos JS SDK within our product to stream our serious games.
Currently we're running into an issue where the session resume is unreliable after a page refresh in a VueJS application.

Some of the times it works, and some of the times it doesn't.
Whenever the Resume Session menu is shown (see screenshot) we don't receive theFS_SDK_EVENTS_NAME.ON_RESUME_SESSION event which in turn then triggers our start stream method which restarts the stream that was enabled before.

It somehow looks like the event is sometimes triggered before we can bind the event to a function. Even with a timeout of 10 seconds we don't receive the event anymore.

Our code currently looks like this:

      this.player = new Player(furioosLinkId, "furioos_container", {
        whiteLabel: true,
        hideTitle: true,
        hideToolbar: false,
        hidePlayButton: true,
        debugAppMode: false,
        inactiveTimeout: 120000, // 2 minutes
      });

      const self = this;

      // Resume session when possible
      console.log("bind session resume event");
      this.player.on(
        FS_SDK_EVENTS_NAME.ON_RESUME_SESSION,
        function ({ canResumeSession }) {
          console.log("can resume session");
          self.canResumeSession = canResumeSession;
          if (canResumeSession) {
            self.player.resumeSession();
          }
        }
      );

      console.log("bind start game event");
      // Start game on load
      this.player.on(FS_SDK_EVENTS_NAME.LOAD, function () {
        setTimeout(() => {
          if (!self.canResumeSession) {
            console.log("can't resume session, player start");
            self.player.start();
          }
        }, 10000);
      });

Do you have some advice on the timing for resuming sessions?
Thanks!

image

Mouse event is not fired outside an iframe

When a user starts to drag mouse, releases it outside of the iframe, then moves the cursor back in the iframe the mouse event will be stuck on mousedown. This is a really annoying bug as in our application user can rotate objects via mouse drag. Weirdly, this bug does not occour on a Firefox browser and/or in the official furioos demos.

Restricted Domain

I've sent email directly to support@unity and a few individuals internally. We are getting intermittent messages that we are viewing a restricted domain when loading streams from Furioos via the SDK. The iframe that the library places on the page is pointing at the correct url at furioos; but instead of the streaming player we are getting the error below.

No further telemetry or debugging steps are available to us as consumers of the sdk.

image

onLoad callback takes very long to get called

Sometimes it happens that it takes a long time until the onLoad callback is called.

I call the Player constructor and register the onLoad callback directly afterwards.
In the onLoad callback method I invoke player.start() to automatically launch the player but it takes a long time until onload is called.

Is there something I am missing here?

Edit: The issue I was having that onLoad is not called at all was caused by an invalid share ID provided to the constructor. It still takes a while sometimes until onLoad is called so I keep this issue open.

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.