06-11-2021, 09:11 AM
Yes check the VideoWdg: tactic.ui.widget.VideoWdg()
These are the accepted args:
Here a simple configuration example:
If you want to use it in place of the RV button I made a replacement for to rv/play script that uses a popup with a VideoWdg in it :
just overwrite rv/play with this script..
I'm going to make Poll Request to change this in the VFX plugin.
These are the accepted args:
Code:
ARGS_KEYS = {
"sources": {
'description': 'List of URLs representing the sources for the videos, separate by "|"',
'type': 'TextAreaWdg',
'category': 'Options',
},
'width': 'The width to display the video',
'height': 'The height to display the video',
'poster': 'Link to an image for the poster representing the video',
'autoplay': {
'description': 'Start playing video immediately',
'type': 'SelectWdg',
'values': 'true|false',
'order': 10,
'category': 'Options'
},
'loop': {
'description': 'Play video in loop mode',
'type': 'SelectWdg',
'values': 'true|false',
'order': 11,
'category': 'Options'
}
}
Here a simple configuration example:
Code:
<element name="VideoPlayer" title="VideoPlayer>
<display class="tactic.ui.widget.VideoWdg">
<sources>your_video.mov</sources>
<width>500</width>
</display>
</element>
If you want to use it in place of the RV button I made a replacement for to rv/play script that uses a popup with a VideoWdg in it :
Code:
// Setup the classes
var server = TacticServerStub.get();
// Setup the sources list
var sources = []
// Get the selected items or the one that was clicked on
var table = bvr.src_el.getParent(".spt_table");
var search_keys = spt.dg_table.get_selected_search_keys(table);
if (search_keys.length == 0) {
search_keys[0] = bvr.search_key;
}
for (i=0; i<search_keys.length; i++) {
// Check if the imcoming sObject is a snapshot
// If not get the first snapshot.
if (search_keys[i].indexOf("sthpw/snapshot") == -1) {
var snapshot_expr = "@SOBJECT(sthpw/snapshot)"
var snapshots = server.eval(snapshot_expr, {'search_keys': search_keys[i]})
var snapshot_sk = snapshots[0].__search_key__;
}
else {
var snapshot_sk = search_keys[i]
}
// Get the path for the incoming snapshot
var snapshot = server.get_by_search_key(snapshot_sk)
var snapshot_code = snapshot.code;
var path = server.get_path_from_snapshot(snapshot_code, {'mode': 'web'})
// If not path is returned, check for a dependant snapshot
if (path.length > 0) {
sources.push(path);
}
else {
var dep = server.get_all_dependencies(snapshot_code)
var path = server.get_path_from_snapshot(dep[0].code, {'mode': 'web'})
sources.push(path)
}
}
// Setup VideoWdg
var values = {};
values.sources = sources.join("|")
values.width = 500;
// Open a player popup
var popup = spt.panel.load_popup("Video player", "tactic.ui.widget.VideoWdg", values);
just overwrite rv/play with this script..
I'm going to make Poll Request to change this in the VFX plugin.