Web Player¶
Table of Contents
The web player is a special application for rendering models and scenes in a demonstration mode.
Desktop version:
Mobile version:
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.
- show / hide control panel;
- fullscreen mode on / off;
- stereo rendering on / off;
- set the scene quality;
- sound on / off;
- camera auto rotation mode on / off;
- run / stop the engine;
- open the help window;
- tweet;
- share via Facebook;
- share via Google+;
- share via VK;
- share via Weibo.
Attributes¶
Web player accepts attributes from the browser address line:
- the special attribute
load
is used to load the scene, this attribute contains relative path to a JSON file. - in case of a WebGL error the optional
fallback_image
attribute is used to setup the background image instead of 3D content. - 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. - the optional
show_fps
attribute is used to display the FPS counter in the player’s top right corner. - optional parameter
autorotate
is used to enable automatic camera rotation just after the scene loads. - the
compressed_textures
optional parameter is used to enable loading of minified and compressed textures (in DDS format). - the
compressed_textures_pvr
optional parameter is used to enable loading of textures compressed in PVRTC format. This parameter is used with thecompressed_textures
parameter. - 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”. - optional
alpha
parameter is used to enable transparency for the rendering area. - the optional
no_social
attribute is used to disable social networks buttons on the control panel. - the optional
socials
attribute is used to selectively enable and disable social network buttons on the control panel. This attribute should look likesocials=<...>
, 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 andg
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.
Scene Errors¶
If the player is used incorrectly it displays the corresponding errors.
- The
load
attribute specifies a wrong path to the JSON file or the file is corrupt.
- The
load
attribute is not found or is void.
- WebGL initialization error. Please, look at this page for the solution.