Commit 58a4a83d authored by Mukul's avatar Mukul Committed by Vincent Bechu

[erp5_officejs][erp5_mutlimedia] Adds auto play feature in officejs media player.

/reviewed-on nexedi/erp5!632
parent 47be0acf
......@@ -6,12 +6,13 @@
"use strict";
rJS(window)
.setState({ play: false, mute: false })
.setState({ play: false, mute: false, auto_play: false })
//////////////////////////////////////////////
// Acquire Method
//////////////////////////////////////////////
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("redirect", "redirect")
/////////////////////////////////////////////
// Declare Method
......@@ -27,6 +28,9 @@
})
.allowPublicAcquisition('onEnd', function () {
if (this.state.auto_play) {
return this.redirect({ command: 'selection_next' });
}
return this.changeState({ play: false, mute: false });
})
......@@ -86,6 +90,11 @@
id: params.value,
name: params.name
});
})
.push(function () {
if (params.auto_play) {
return gadget.changeState({ play: true, auto_play: true });
}
});
})
......
......@@ -113,7 +113,7 @@
"key": "player_content",
"hidden": 0,
"type": "GadgetField",
"renderjs_extra": '{"name": "data"}',
"renderjs_extra": '{"name": "data", "auto_play": true}',
"url": "gadget_custom_player.html",
"sandbox": "public"
}
......
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.42272.6476.33348</string> </value>
<value> <string>966.48813.59167.24098</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1519294814.86</float>
<float>1523286693.67</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment