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 !632
parent 47be0acf
...@@ -6,12 +6,13 @@ ...@@ -6,12 +6,13 @@
"use strict"; "use strict";
rJS(window) rJS(window)
.setState({ play: false, mute: false }) .setState({ play: false, mute: false, auto_play: false })
////////////////////////////////////////////// //////////////////////////////////////////////
// Acquire Method // Acquire Method
////////////////////////////////////////////// //////////////////////////////////////////////
.declareAcquiredMethod("jio_get", "jio_get") .declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("redirect", "redirect")
///////////////////////////////////////////// /////////////////////////////////////////////
// Declare Method // Declare Method
...@@ -27,6 +28,9 @@ ...@@ -27,6 +28,9 @@
}) })
.allowPublicAcquisition('onEnd', function () { .allowPublicAcquisition('onEnd', function () {
if (this.state.auto_play) {
return this.redirect({ command: 'selection_next' });
}
return this.changeState({ play: false, mute: false }); return this.changeState({ play: false, mute: false });
}) })
...@@ -86,6 +90,11 @@ ...@@ -86,6 +90,11 @@
id: params.value, id: params.value,
name: params.name name: params.name
}); });
})
.push(function () {
if (params.auto_play) {
return gadget.changeState({ play: true, auto_play: true });
}
}); });
}) })
......
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
"key": "player_content", "key": "player_content",
"hidden": 0, "hidden": 0,
"type": "GadgetField", "type": "GadgetField",
"renderjs_extra": '{"name": "data"}', "renderjs_extra": '{"name": "data", "auto_play": true}',
"url": "gadget_custom_player.html", "url": "gadget_custom_player.html",
"sandbox": "public" "sandbox": "public"
} }
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.42272.6476.33348</string> </value> <value> <string>966.48813.59167.24098</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1519294814.86</float> <float>1523286693.67</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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