Displaying Videos
Displaying Videos
Section titled “Displaying Videos”Videos can be displayed in place of a message. When specified, the default Dialog size will switch to 900x600 to accomodate a 16:9 ratio video. Custom sizes can be specified using the --width and --height modifiers.
--video <file> | <url> Display a video instead of a message. Videos will be resized to fit the available display area (depending on video resolution, some letterboxing may occur)
--videocaption <text> Text that will appear underneath the displayed video.
--autoplay Video will start playing automatically on launch without requiring the user to press playAny video format supported by Quicktime should be viewable. If using a URL, the full path to the video resource must be used.
Example: --title "Video Demo" --video /Users/Shared/Videos/day4session3.mp4

YouTube and Vimeo support (requires swiftDialog v2.0 or newer)
Section titled “YouTube and Vimeo support (requires swiftDialog v2.0 or newer)”To embed a YouTube or Vimeo video, you can pass in the video ID as a parameter to the --video command using the youtubeid= or vimeoid= prefix
The ID can usually be found in the URL on either YouTube or Vimeo
YouTube Example:
dialog --video youtubeid=XXXXXXXXXX
Vimeo example:
dialog --video vimeoid=XXXXXXXXXX
Note: for ID’s of private Vimeo videos, you may also need to capture the additional information in the embed URL. This will be represented as additional h=YYYYYYYY - the full embed command for swiftDialog would therefore be dialog --video "vimeoid=XXXXXXXXXX?h=YYYYYYYY".
Updating a running dialog with new web or video content
Section titled “Updating a running dialog with new web or video content”Send the following commands to update a dialog with new web or video content
echo "webcontent: https://some.website.com" >> /var/tmp/dialog.logecho "video: https://some.website.com/video.mov" >> /var/tmp/dialog.logecho "video: /path/to/file.mov" >> /var/tmp/dialog.logSome caveats though: Currently you can’t update web or video content in place. To switch to another website you will need to clear the contents and then send the new content.
echo "webcontent: none" >> /var/tmp/dialog.logecho "webcontent: https://some.new.website.com" >> /var/tmp/dialog.logyou can string those together though so echo "webcontent: none" >> /var/tmp/dialog.log && echo "webcontent: https://some.new.website.com" >> /var/tmp/dialog.log also works.