I dare you ;p: Github repo: fix the non working tooltip preview video

if someone is good at it and kind enough to look at it and if not fixing it point in the right direction, that woul be greatly appreciated

Related How Can I Add video to Tooltip

This seems to be working for me.
In Coreutils>ribbon.py

from Autodesk.Windows import RibbonToolTip

    def set_tooltip_video(self, tooltip_video):
        try:
            adwindows_obj = self.get_adwindows_object()
            if isinstance(self.get_rvtapi_object().ToolTip, str):
                exToolTip = self.get_rvtapi_object().ToolTip
            else:
                exToolTip = None
            adwindows_obj.ToolTip = RibbonToolTip()
            if adwindows_obj and adwindows_obj.ToolTip:
                adwindows_obj.ToolTip.Title = self.ui_title
                adwindows_obj.ToolTip.Content = exToolTip
                _StackPanel = System.Windows.Controls.StackPanel()
                _video = System.Windows.Controls.MediaElement()
                _video.Source = Uri(tooltip_video)
                _StackPanel.Children.Add(_video)
                adwindows_obj.ToolTip.ExpandedContent = _StackPanel
                adwindows_obj.ResolveToolTip()
            else:
                self.tooltip_video = tooltip_video
        except Exception as ttvideo_err:
            raise PyRevitUIError('Error setting tooltip video {} | {} '
                                 .format(tooltip_video, ttvideo_err))
3 Likes

Should I Add this def to a py file ? or should i create it ? I can’t find the “Coreutils>ribbon.py” , in which folder may i find it ? Thank you Martin.

This would be a change to the pyrevit master branch. If you wanted to try to change it on your end you can find this file here:
{Pyrevit core install location}\pyrevitlib\pyrevit\coreutils\ribbon.py

The function above should already exist in that file, I’ve just made a few changes to it.

1 Like

Capture d’écran 2023-02-21 165910
Worked perfectly ! Thank you Martin

Fixed by Fix Tooltip videos by dvdgnz · Pull Request #1742 · eirannejad/pyRevit · GitHub
Installer should be ready here in a bit Merge pull request #1742 from odehengineers/fixtooltipvideos · eirannejad/pyRevit@d8f3a68 · GitHub

Thanks @martin.servold and @deddolo for picking that one up, you guys did a great job!
:rocket:

Next “I dare you” coming up soon then :stuck_out_tongue_winking_eye:

3 Likes