Web Player

The web player is a special application for rendering models and scenes in a demonstration mode.

Desktop version:

_images/web_player_example.png

Mobile version:

_images/web_player_example_mobile.png

Usage

You can copy the directory containing the web player files, namely deploy/apps/webplayer, from the Blend4Web SDK distribution and deploy it on your website. You can place the exported scene files on your website and specify the path to them (absolute or relative) with the load web player parameter.

When you export into a single HTML file the web player interface is integrated automatically into it.

Control Panel

The web player’s control panel is shown below.

_images/web_player_interface.png
  1. show / hide control panel;
  2. fullscreen mode on / off;
  3. stereo rendering on / off;
  4. set the scene quality;
  5. sound on / off;
  6. camera auto rotation mode on / off;
  7. run / stop the engine;
  8. open the help window;
  9. tweet;
  10. share via Facebook;
  11. share via Google+;
  12. share via VK;
  13. share via Weibo.

Attributes

Web player accepts attributes from the browser address line:

_images/player_params.png

  1. the special attribute load is used to load the scene, this attribute contains relative path to a JSON file.
  2. in case of a WebGL error the optional fallback_image attribute is used to setup the background image instead of 3D content.
  3. in case of a WebGL error the optional fallback_video attribute is used to setup the background video instead of 3D content. Can be used many times to add more video formats.
  4. the optional show_fps attribute is used to display the FPS counter in the player’s top right corner.
  5. optional parameter autorotate is used to enable automatic camera rotation just after the scene loads.
  6. the compressed_textures optional parameter is used to enable loading of minified and compressed textures (in DDS format).
  7. the compressed_textures_pvr optional parameter is used to enable loading of textures compressed in PVRTC format. This parameter is used with the compressed_textures parameter.
  8. the compressed_gzip optional parameter is used to enable loading of GZIP compressed resources such as ”.json.gz”, ”.bin.gz”, ”.dds.gz” and ”.pvr.gz”.
  9. optional alpha parameter is used to enable transparency for the rendering area.
  10. the optional no_social attribute is used to disable social networks buttons on the control panel.
  11. the optional socials attribute is used to selectively enable and disable social network buttons on the control panel. This attribute should look like socials=<...>, where <...> is a set of letters corresponding to the social network buttons you want to enable (f for Facebook, v for VK, t for Twitter, w for Weibo and g for Google+). The order of letters sets the order in which the buttons will appear on the screen.

Note

If both fallback_image and fallback_video parameters are specified, the fallback_image parameter is used.

Scene Name as Title

By default the Web Player has the Blend4Web Web Player title. Assigning the meta tag title on the scene in Blender you can change that value to something else.

_images/title.png

Scene Errors

If the player is used incorrectly it displays the corresponding errors.

  1. The load attribute specifies a wrong path to the JSON file or the file is corrupt.
_images/error_wrong_json_path.png

  1. The load attribute is not found or is void.
_images/error_not_load_attr.png

  1. WebGL initialization error. Please, look at this page for the solution.
_images/error_webgl.png