TACTIC Open Source
Loading Tweak RV - Printable Version

+- TACTIC Open Source (http://forum.southpawtech.com)
+-- Forum: TACTIC Open Source (http://forum.southpawtech.com/forumdisplay.php?fid=3)
+--- Forum: TACTIC Discussion (http://forum.southpawtech.com/forumdisplay.php?fid=4)
+--- Thread: Loading Tweak RV (/showthread.php?tid=218)

Pages: 1 2 3


Loading Tweak RV - aixzhou - 06-10-2021

Hello
I have a question.When I click Play RV button ,

that video was downloaded,but keep showing this prompt without playing

What should happen after clicking the button
I check the play rv column definition,shows 

<element name="play_rv" title="Play RV" edit="false" color="false">
  <display widget="button">

    <path>rv/play</path>

    <icon>MOVIE_VIEW</icon>

  </display>
</element>


How can I make the video playing?
thanks

RV player install on my computer,but tactic server isn't.


RE: Loading Tweak RV - Diego - 06-10-2021

Hi aixzhou,
that is very old code from the VFX template.

If you check in widget configs (Admin view->Project Essentials->widget config) you'll see the button "RV Play" configuration for view Definition for stype sthpw/snapshot.
the button calls a script called rv/play

open the script editor (Admin view->Project ->  script editor) and open script rv/play

the script runs in your browser and uses the old java applet to launch local commands and open RV on your computer (var applet = spt.Applet.get()Wink.

Java applets are no longer supported by any modern browser and the script can't work, to my knowledge there is no simple solution to this but writing a browser extension or running a local service listening to commands on a TCP port and sending this commands from the tactic server


RE: Loading Tweak RV - aixzhou - 06-11-2021

Hi Diego,
Thank you for your detailed reply。
Yes, the core problem is that the browser does not allow any shell commands to run, so the local player like RV will not be able to start.

Are there plug-ins or other ways to watch videos on tactics? For example, tools like video.js can play videos on tactic pages?


RE: Loading Tweak RV - Diego - 06-11-2021

Yes check the VideoWdg: tactic.ui.widget.VideoWdg()

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.


RE: Loading Tweak RV - aixzhou - 06-11-2021

I seem to understand the whole process, but there is a detailed question。
How to get the path of mov, because this needs to be set in the column definition, do I need to use an expression?
I mean how to edit this line.
<sources>your_video.mov</sources>


RE: Loading Tweak RV - Diego - 06-11-2021

It depends on where you are using it, usually you get it from a snapshot, check the script i added to may last reply:

path = server.get_path_from_snapshot(snapshot_code, {'mode': 'web'})

Anyway if you just put my script in place of rv/play you should be able to play videos with the "old" play rv button.

I just made a PR, if Remko approves it the VFX plugin will use VideoWdg instead of RV


RE: Loading Tweak RV - Nachogor - 07-07-2021

Excuse, this is for video reviews?
We need to have a solution for video Review like Syncsketch, Frameio, or Shotgun video review, until now we used https://www.kinovea.org/ locally to generate thumbnails with notes and add them as attaches to the notes in Tactic, but supervisors are asking for something more interactive like the ones I mentioned.

If this is the case we are really interested in contributing to having a solution for this!

Cheers!
Nacho.


RE: Loading Tweak RV - Diego - 07-08-2021

Something similar to Shotgrid (shotgun) video review would be very very very useful.

I've been doing some research:
Tactic uses a powerful and popular HTML5 video player: VideoJs (https://videojs.com/)
VideoJs has a plugin API
There is a plugin for taking snapshots and draw over them https://github.com/tetzank/videojs-snapshot these snapshots can then be saves a jpg

I think we could try to work on this plugin and instead of saving images add them to a tactic note, this would give us a basic review tool


RE: Loading Tweak RV - Nachogor - 07-08-2021

Diego this is awesome! The result would be similar to what we did with kinovea and notes, but all inside the browser and it would become part of Tactic.


RE: Loading Tweak RV - remkonoteboom - 07-08-2021

We have a tool that already does this directly inside of TACTIC however, I think it could use some work.  We never made it up to VFX standards (or at least we though so).  Would a video/image review tool built directly into TACTIC is better than using some 3rd party solution?

I would be willing to open source it, it people are willing to help out making it better.

It does need some updating, however it's a good start
1) It does use video.js
2) It can draw on images and video files.
3) You can write a note and submit and it will extract the image with the drawing and add it as a note with an attachment

Attached is a screenshot.