This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:create:media [20.12.2019 17:37] – admin | en:create:media [26.09.2025 09:33] (current) – admin | ||
|---|---|---|---|
| Line 20: | Line 20: | ||
| - | ===== Linking  | + | ===== Linking  | 
| Most text and image contents in a questionnaire are formatted as text elements with HTML and directly embedded. However, longer documents (such as multiple-page instructions) may need to be linked as a downloadable file. A widely-used file format is PDF. | Most text and image contents in a questionnaire are formatted as text elements with HTML and directly embedded. However, longer documents (such as multiple-page instructions) may need to be linked as a downloadable file. A widely-used file format is PDF. | ||
| Line 34: | Line 34: | ||
| **Note:** Whether the PDF file is opened in the browser or downloaded depends on the browser, or rather, the participant’s settings, and can’t be controlled by the researcher. | **Note:** Whether the PDF file is opened in the browser or downloaded depends on the browser, or rather, the participant’s settings, and can’t be controlled by the researcher. | ||
| + | ===== Music, Audio Files and Videos ===== | ||
| - | ===== Incorporating  | + | In many studies, embedding  | 
| - | There are several file formats that are suitable for use online. Usually, mp3 is used because this is the format compatible with the most browsers. | + |   * [[: | 
| + |   * [[: | ||
| + |   * [[: | ||
| - | **Note:** The solutions below will play the audio file on one specific questionnaire page. When clicking to the next page, it stops. If you need to bypass this restriction, | ||
| - | ==== Simple embedding of an mp3 ==== | + | ===== Using HTML files ===== | 
| - | If an audio file is saved in mp3 format and uploaded  | + | SoSci Survey allows you to upload web pages (HTML, CSS and JS files) that can be used for information or as stimuli. The instructions [[:en: | 
| + | The following examples assume that you have uploaded a file called '' | ||
| - | ====Embedding of an mp3 using HTML5==== | + | **Important: | 
| - | Since the HTML5 tag ''< | + | HTML pages can be linked  | 
| - | + | ||
| - | In order to make sure the audio file is played in all contemporary browsers, it should  | + | |
| - | + | ||
| - | To embed a file, create  | + | |
| <code html> | <code html> | ||
| - | <audio id="audio_with_controls" | + | <a href="stimulus.html"  | 
| - | controls controlsList=" | + | |
| - |   <source src=" | + | |
| - |   <source src=" | + | |
| - | Your browser is not able to play this audio file | + | |
| - | </audio> | + | |
| </ | </ | ||
| - | The file name(s) are entered in the ''< | + | HTML pages can also be embedded directly into the questionnaire as ''< | 
| - | + | ||
| - | CSS formatting can be used to either adjust player size or to hide the player entirely. Please keep in mind that some browsers might ignore the autoplay setting, e.g. on mobile devices with limited data usage). | + | |
| <code html> | <code html> | ||
| - | <audio id="audio02"  | + | <iframe src="stimulus.html"  | 
| - |   <source src="audio.mp3"  | + | |
| - | </audio> | + | |
| </ | </ | ||
| - | <code html> | + | Please note that the width adapts to the screen (display on mobile devices), but the height is fixed. This can result in part of the content being cut off at the bottom or only being visible by scrolling. | 
| - | <audio id=" | + | |
| - |   <source src=" | + | |
| - | </ | + | |
| - | </ | + | |
| - | **Note:** Most mobile devices (smartphones, | + | The following HTML code embeds  | 
| <code html> | <code html> | ||
| - | <audio id=" | + | <iframe  | 
| - |   < | + | |
| - | </ | + | |
| - | <script type="text/ | + | |
| - | <!-- | + | |
| - | window.addEventListener(" | + | |
| - | window.setTimeout(function() { | + | |
| - |     var audio = document.getElementById("audio04" | + | |
| - | if (audio.paused) { | + | |
| - |       audio.setAttribute(" | + | |
| - | } | + | |
| - | }, 250); | + | |
| - | }); | + | |
| - | // --> | + | |
| - | </script> | + | |
| </ | </ | ||
| - | JavaScript can be used to further refine  | + | It is more difficult  | 
| - | <code html> | + | **Tip:** If possible, save the HTML code of the stimulus directly as **Text**, setting  | 
| - | <audio id=" | + | |
| - |   <source src=" | + | |
| - | </audio> | + | |
| - | <script type=" | + | |
| - | <!-- | + | |
| - | window.addEventListener(" | + | |
| - | window.setTimeout(function() { | + | |
| - |      | + | |
| - | var audio = document.getElementById("audio05"); | + | |
| - | // Show controls if the video does not start automatically | + | |
| - | if (audio.paused) { | + | |
| - |       audio.setAttribute(" | + | |
| - | } | + | |
| - | // Automatically continues to the next page after playback | + | |
| - |     audio.addEventListener(" | + | |
| - | }, 250); | + | |
| - | }); | + | |
| - | // --> | + | |
| - | </ | + | |
| - | </ | + | |
| - | ===== Embedding videos ===== | ||
| - | **Important: | + | ===== Problems with the Web Storage Space ===== | 
| - | ==== The special case of YouTube  | + | At www.soscisurvey.de, | 
| - | Users who upload videos to YouTube (and similar platforms) transfer a whole series of usage rights to the platform. This can be very useful in survey studies because YouTube offers the possibility of embedding videos directly into external websites (such as your online questionnaire).  | ||
| - | To do this, open the video on YouTube, click on the //Share// button, then //Embed//: Copy the HTML code into a text element (**Text Elements and Labels**) and drag it into the questionnaire (**Compose Questionnaire**). If necessary, replace '' | + | ==== Survey server of the University ==== | 
| - | <code html> | + | **Tip:** Check whether your university operates its own survey server ([[https:// | 
| - | <iframe width=" | + | |
| - | </ | + | |
| - | With this HTML code, a (mostly invisible) YouTube website is opened within the questionnaire and the YouTube player is loaded. The user does not have to upload the file, nor deal with copyright laws. In exchange, YouTube is permitted to blend their own advertisements into the video. | ||
| - | **Warning: | + | ==== Online storage space of the university ==== | 
| - | **Note:** Browser will access www.soscisurvey.de via secured (encrypted) HTTPS protocol. Some browsers deny including content from non-encrypted sources via iframe. When including external content, make sure, this content is available via HTTPS. Also use the HTTPS URL. | + | Ideally, you can access online storage at your own university or company and upload  | 
| - | + | ||
| - | + | ||
| - | ====Embedding videos using HTML5==== | + | |
| - | + | ||
| - | If you want to make sure your video can be displayed correctly for virtually all participants, | + | |
| - | + | ||
| - | **Important: | + | |
| - | + | ||
| - | To convert the video to mp4, ogg and webm formats, you can use different software. It works quite comfortable with [[https:// | + | |
| - | + | ||
| - | In SoSci Survey, you create a new [[: | + | |
| <code html> | <code html> | ||
| - | <video width=" | + | <video width=" | 
| - |   <source src="filename.ogg"  | + |   <source src="https://www.example.com/projectXYZ/filename.mp4" type=" | 
| - |   <source src="filename.mp4" type=" | + | |
| - |   <source src="filename.webm" type=" | + | |
| </ | </ | ||
| </ | </ | ||
| - | Obviously, you can use the '' | + | **Important:** The online memory must (!) be accessible via HTTPS. If you try to include unencrypted HTTP content in a questionnaire page that was transmitted encrypted via HTTPS, most browsers block this. | 
| - | ==== Optimierte Einbindung  | + | ==== Cloud storage  | 
| - | HTML5-Videos kann man mittels JavaScript sehr differenziert ansteuern bzw. auf Ereignisse im Video reagieren. Das folgende Beispiel aus HTML-Code (für das Video-Element) und JavaScript-Code sorgt dafür, dass (a) der Weiter-Knopf ausgeblendet wird, solange das Video spielt und (b) die Bedienelemente (Pause, Spulen, ...) verschwinden, sobald der Teilnehmer das Video gestartet hat. | + | If you have access to [[https:// | 
| - | **Tipp:** Erlauben Sie die Bedienelemente auch dann, wenn Sie '' | ||
| <code html> | <code html> | ||
| - | <video width=" | + | <video width=" | 
| - |   <source src="dateiname.ogg" type=" | + |     <source src="https:// | 
| - |   <source src=" | + | |
| - |   <source src=" | + | |
| </ | </ | ||
| - | |||
| - | |||
| - | <script type=" | ||
| - | <!-- | ||
| - | |||
| - | var video = document.getElementById(" | ||
| - | |||
| - | // Bedienelemente ausblenden, sobald es abspielt | ||
| - | SoSciTools.attachEvent(video, | ||
| - |   stimulus.removeAttribute(" | ||
| - | }); | ||
| - | // Weiter-Knopf ausblenden | ||
| - | SoSciTools.attachEvent(window, | ||
| - |   SoSciTools.submitButtonsHide(); | ||
| - | }); | ||
| - | // Weiter-Knopf am Ende des Videos wieder anzeigen | ||
| - | SoSciTools.attachEvent(stimulus, | ||
| - |   SoSciTools.submitButtonsDisplay(); | ||
| - | }); | ||
| - | |||
| - | // --> | ||
| - | </ | ||
| </ | </ | ||
| + | **Important: | ||
| - | ==== Problems with the Web Storage Space ==== | + |   * Link to display  | 
| + |   * Link to download and integrate the file\\ '' | ||
| - | At www.soscisurvey.de, | ||
| - | Ideally, you can access online storage at your own university or company  | + | ==== Google Drive, Dropbox  | 
| - | <code html> | + | If you do not need to access the video using JavaScript -- e.g. to play or pause the video depending on certain events or to record timestamps -- then you can also use external storage services that do not deliver the mp4 file directly. This can be YouTube  | 
| - | <source src=" | + | |
| - | </ | + | |
| - | + | ||
| - | **Important: | + | |
| - | If you have access to Sync& | + | If you store videos  | 
| <code html> | <code html> | ||
| - | <source  | + | <iframe width=" | 
| </ | </ | ||
| - | If you do not have access to your own online storage, you can use the provider [[https:// | + | **Warning: | 
| - | <code html> | + | **Warning: | 
| - | <source src=" | + | |
| - | </ | + | |
| - | + | ||
| - | **Warning: | + | |
| - | + | ||
| - | **Warning: | + | |
| - | + | ||
| - | **Warning: | + | |
| Line 239: | Line 137: | ||
| Regardless of whether audio files or videos are embedded following the directions above or directly from an external provider (e.g. YouTube), it can never guarantee that the participant can actually see the media file. | Regardless of whether audio files or videos are embedded following the directions above or directly from an external provider (e.g. YouTube), it can never guarantee that the participant can actually see the media file. | ||
| - | All options listed above (including YouTube) only work if the participant has a halfway up-to-date Flash Player. Flash is the most common media plug-in for browsers, but a relevant proportion of participants (depending on target population, 5-20%) will not have it installed. In addition, some participants use a Flash-Blocker to hide moving advertisements on some websites. | + | Embed a short test video/audio clip on the first page of the questionnaire. The participants can then be asked to test the display in advance. | 
| - | + | ||
| - | The solution to this problem is relatively simple: embed a short test video/audio clip on the first page of the questionnaire. The participants can then be asked to test the display in advance. I fit does not work properly, they should ... | + | |
| - | + | ||
| - | * check if the speakers are turned on, | + | |
| - | * possibly install the up-to-date Flash Player (include a link to the download page) and/or | + | |
| - | * temporarily disable an Flash blocker. | + | |
| **Tip:** Optionally, some information (such as a number) can be hidden in the media file by displaying or recording it. Only users who enter this information correctly into a text box can continue to the questionnaire (this is then checked via filter on the next page of the questionnaire). | **Tip:** Optionally, some information (such as a number) can be hidden in the media file by displaying or recording it. Only users who enter this information correctly into a text box can continue to the questionnaire (this is then checked via filter on the next page of the questionnaire). | ||