Forum

How to get rid of the play button on ios/android platform

16 February 2016 10:51
After load xx.json, a play button shows. If load just one .json file, that's fine, but I need dynamically load dozens xx.json file. After second load_callback, the play button shows again and the screen freeze.
any suggestion?
16 February 2016 21:41
Hi,

This looks like an issue, we'll investigate this tomorrow.
The Founder | Twitter | Facebook | Linkedin
17 February 2016 17:24
After load xx.json, a play button shows. If load just one .json file, that's fine, but I need dynamically load dozens xx.json file. After second load_callback, the play button shows again and the screen freeze.
any suggestion?

Hi! This button is shown up when a scene contains some media data (basically video textures and speakers). It is needed because this media files require a user action to start playing. If you want to get rid of this button only for the dynamically loaded scenes you should set the "media_auto_activation" config parameter to False after the main scene was loaded, for example, in your "load_callback" function:

...
m_data.load("main_scene.json", main_load_cb);
...
m_data.load("secondary_scene.json", sec_load_cb);
...

function main_load_cb(data_id, success) {
    m_config.set("media_auto_activation", false);
}


If you want to remove this button at all you can set this flag right at the app initialization:

exports.init = function() {
    m_app.init({
        ...
        media_auto_activation: false,
        ...
    });
}


But this media stuff still needs a user action, so you'll probably need to do something with it. For example, a custom button to start playing. There is also a special method for this purpose: data.activate_media. It should help to avoid some issues on those devices. It should be called at the moment the user input happens. This article is an example of the usage. The source code is here: https://github.com/TriumphLLC/Blend4Web/blob/master/deploy/tutorials/examples/web_page_integration/example.js
18 February 2016 05:55
Thank you for the crystal explanation.
I tried and I got:
Using b4w Engine(15.11)build date: Thu Nov 26 2015 18:58:04 GMT+0800 (CST)
b4w.min.js:321 B4W ERROR: Unknown config property: media_auto_activation
and then I download newest version(16.01), and it works…
18 February 2016 10:20
and then I download newest version(16.01), and it works…
Yes, it works since 15.12.
 
Please register or log in to leave a reply.