Located in ExampleScripts\- Virtual 2D Screen or Multi-User in Multi User ExamplesScripts\Virtual 2D Screen
Note there are also additional Mixed Reality versions in the ExampleScripts\- Mixed Reality folder
In the ExampleScripts\- Virtual 2D Screen folder you can find a few examples related to using a virtual screen within a SightLab script. There are examples for both single and multi-user, as well as using either a stereo or mono screen. Also a example with an optional video player that lets you more easily cycle through a series of videos. Here's a brief overview of the examples and how to use them. Note that K-Lite Codec pack may be needed to play back some video files. https://codecguide.com/download_kl.htm (an alternative is FFDShow as well)
In the VideoScreenConfig file you can choose the following (note there is also a VideoScreenConfig2 that is configured for the STIM file screen):
# Choose environment, use empty for mixed realityENVIRONMENT_MODEL="sightlab_resources/environments/Stimulus.osgb"EMPTY_ENVIROMENT_MODEL="sightlab_resources/environments/empty.osgb"# Choose stereo or Mono and Stereo Video TypeVIDEO_TYPE="Mono"# VIDEO_TYPE ='Stereo'# STEREO_VIDEO_FORMAT ='Left_Right'STEREO_VIDEO_FORMAT="Top_Bottom"# Choose location of MediaUSE_DIRECTORY=FalseUSE_SPECIFIC_VIDEO_PATH=FalsePASSTHROUGH=FalseLINK_TO_HEAD=FalseSAVE_CONDITION_TO_FILE=FalseifUSE_DIRECTORY==True:video_directory=r"C:Path_To_Video"video_files=[fforfinos.listdir(video_directory)iff.endswith((".mp4",".avi",".mov",".wmv"))]current_video_index=0MEDIA_FILE=viz.addVideo(os.path.join(video_directory,video_files[0]))elifUSE_SPECIFIC_VIDEO_PATH==True:video_file=r"C:Path_To_Video"MEDIA_FILE=viz.addVideo(os.path.join(video_file))else:MEDIA_FILE=viz.addVideo("sightlab_resources/media_2D/droneShots.mp4")STEREO_MEDIA_FILE=viz.addVideo("sightlab_resources/media_2D/SBS.mp4")# These can swap out the default keys used for play/pause and restarting of the videoVIDEO_PLAYBACK_KEY="v"VIDEO_RESET_KEY="k"FAST_FORWARD_KEY="f"NEXT_VIDEO_KEY="c"USE_HIGHLIGHTER=FalseHIDE_CONTROLLERS=FalseGRAB_SCREEN=True
Running the Session
Press either the spacebar or the right trigger to start the video and exit the fadequad (this will also start recording data files in Sightlab)
For multi-user this is just the spacebar on the server
Default to pause/play video is the 'v' key, or use the highlighter tool by pressing the right grip button to bring up the highlighter and then the right trigger to play and pause the video.
Default to start video from beginning is the 'k' key
See how to use a STIM file to choose the videos and options per trial (set up with VideoScreenConfig2). Access the STIM files in stim_files. Can edit video_sequence.csv or create a new one. See here for more information on STIM files.
Note to save and load the video from the STIM file use this code (this will also save the current video filename to the experiment summary file)