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 [10.07.2024 12:41] (current) – [Optimated Embedding] admin | ||
---|---|---|---|
Line 37: | Line 37: | ||
===== Incorporating audio files ===== | ===== Incorporating audio files ===== | ||
- | 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. | + | 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, | **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, | ||
Line 124: | Line 124: | ||
</ | </ | ||
+ | **Tip:** If the embedded video does not play correctly, take a look at your [[en: | ||
+ | |||
+ | ==== Notes on listening studies ==== | ||
+ | |||
+ | If the audio stimulus is not only intended to convey music or speech, but also the finest nuances, then lossy mp3 compression can become a problem. This is not optimised to compress the knocking of a woodpecker, for example. | ||
+ | |||
+ | However, lossless audio compression is not so trivial in the context of an online survey: | ||
+ | |||
+ | * The uncompressed PCM format (WAV files) is not supported by the outdated Internet Explorer (which is nevertheless frequently used) ([[https:// | ||
+ | * A lossless compressed alternative to the WAV format is FLAC ([[https:// | ||
+ | * A third option is mp3 files that are compressed at a very high quality (e.g. 320kbps). These are played by all browsers and with a high bit rate, far fewer aspects of the audio signal are removed than with standard compression at 128kbps. | ||
+ | |||
+ | Please note that there are further limits to authentic reproduction in online surveys. As a rule, the work computer is not a recording studio. | ||
+ | |||
+ | * Some respondents cannot hear any audio signal at all, e.g. because they are in an open-plan office or because no speakers or headphones are connected to the computer. | ||
+ | * Other respondents can only hear the audio with relevant background noise, for example on public transport. And even at home, undisturbed listening enjoyment is often not guaranteed: Family members are present, the neighbour is mowing the lawn or the parcel carrier is ringing... | ||
+ | * Most respondents will only have poor audio hardware at home that cannot reproduce low tones and does not deliver a straight frequency response. | ||
+ | * If Bluetooth headphones are used, the signal between the computer and the headphones is potentially compressed again with a loss. | ||
===== Embedding videos ===== | ===== Embedding videos ===== | ||
Line 129: | Line 147: | ||
**Important: | **Important: | ||
+ | **Note:** If a video does not play correctly, the instructions for [[en: | ||
==== The special case of YouTube videos ==== | ==== The special case of YouTube videos ==== | ||
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). | 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 | + | To do this, open the video on YouTube, click on the //Share// button, then //Embed//. MArk the option for " |
<code html> | <code html> | ||
Line 141: | Line 160: | ||
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. | 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: | + | **Warning: |
+ | |||
+ | **Warning: | ||
**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. | **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. | ||
Line 152: | Line 173: | ||
**Important: | **Important: | ||
- | To convert the video to mp4, ogg and webm formats, you can use different software. It works quite comfortable with [[https:// | + | To convert the video to mp4, webm and ogg formats, you can use different software. It works quite comfortable with [[https:// |
In SoSci Survey, you create a new [[: | In SoSci Survey, you create a new [[: | ||
<code html> | <code html> | ||
- | <video width=" | + | <video width=" |
- | <source src="filename.ogg" | + | |
<source src=" | <source src=" | ||
<source src=" | <source src=" | ||
+ | <source src=" | ||
</ | </ | ||
</ | </ | ||
- | Obviously, you can use the '' | + | Obviously, you can use the '' |
+ | <code html> | ||
+ | <video style=" | ||
+ | <source src=" | ||
+ | <source src=" | ||
+ | <source src=" | ||
+ | </ | ||
+ | </ | ||
- | ==== Optimierte Einbindung ==== | + | Other options allow you to start the video automatically ('' |
- | 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. | + | The '' |
- | **Tipp:** Erlauben Sie die Bedienelemente auch dann, wenn Sie '' | + | ==== Play automatically (mute) ==== |
+ | |||
+ | Most mobile devices (smartphones, | ||
+ | |||
+ | One option is to start the videos'' | ||
+ | |||
+ | <code html> | ||
+ | <video width=" | ||
+ | <source src=" | ||
+ | <source src=" | ||
+ | <source src=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Another option is to use JavaScript to try to start the video (possibly only after interaction with the page) and display the play button if this does not work. | ||
+ | ==== Optimated Embedding ==== | ||
+ | |||
+ | HTML5 videos can be controlled in a very differentiated way using JavaScript and can react to events in the video. The following example of HTML code (for the video element) and JavaScript code ensures that (a) the next button is hidden as long as the video is playing and (b) the controls (pause, rewind, ...) disappear once the participant has started the video. | ||
+ | |||
+ | **Tip:** Allow the controls even if you use '' | ||
<code html> | <code html> | ||
- | < | + | < |
- | <source src="dateiname.ogg" type=" | + | <source src="filename.mp4" type=" |
- | <source src="dateiname.mp4" type=" | + | <source src="filename.webm" type=" |
- | <source src="dateiname.webm" type=" | + | <source src="filename.ogg" type=" |
</ | </ | ||
Line 186: | Line 233: | ||
var video = document.getElementById(" | var video = document.getElementById(" | ||
- | // Bedienelemente ausblenden, sobald es abspielt | + | // Hide controls once it plays |
SoSciTools.attachEvent(video, | SoSciTools.attachEvent(video, | ||
- | | + | |
}); | }); | ||
- | // Weiter-Knopf ausblenden | + | // Hide next button |
SoSciTools.attachEvent(window, | SoSciTools.attachEvent(window, | ||
SoSciTools.submitButtonsHide(); | SoSciTools.submitButtonsHide(); | ||
}); | }); | ||
- | // Weiter-Knopf am Ende des Videos wieder anzeigen | + | // Show next button at the end of the video again |
- | SoSciTools.attachEvent(stimulus, " | + | SoSciTools.attachEvent(video, " |
SoSciTools.submitButtonsDisplay(); | SoSciTools.submitButtonsDisplay(); | ||
}); | }); | ||
Line 203: | Line 250: | ||
</ | </ | ||
+ | ==== Control playback ==== | ||
+ | You can control the playback of the video with relatively little effort. The following [[: | ||
+ | |||
+ | * Create an [[: | ||
+ | * Click on the variable in the navigation for editing and select that the data should be transmitted periodically in the background (this way, people who close the questionnaire window are also recorded). | ||
+ | * Drag the question with the internal variable to the questionnaire page with the video. | ||
+ | * Make sure that the ''< | ||
+ | * Insert the following JavaScript code under Video and internal variable within a ''< | ||
+ | |||
+ | <code javascript> | ||
+ | window.setInterval(function() { | ||
+ | var video = document.getElementById(" | ||
+ | var intVar = document.getElementById(" | ||
+ | intVar.value = video.currentTime; | ||
+ | }, 100); | ||
+ | </ | ||
+ | |||
+ | The identifiers " | ||
==== Problems with the Web Storage Space ==== | ==== Problems with the Web Storage Space ==== | ||
At www.soscisurvey.de, | At www.soscisurvey.de, | ||
+ | |||
+ | === Survey server of the university === | ||
+ | |||
+ | **Tip:** Check whether your university operates its own survey server ([[https:// | ||
+ | |||
+ | === Online storage space of the university === | ||
Ideally, you can access online storage at your own university or company and upload the video files there. In the HTML code, simply enter the complete URL of the video file, e.g. | Ideally, you can access online storage at your own university or company and upload the video files there. In the HTML code, simply enter the complete URL of the video file, e.g. | ||
<code html> | <code html> | ||
- | <source src=" | + | <video width=" |
+ | | ||
+ | </video> | ||
</ | </ | ||
**Important: | **Important: | ||
- | If you have access to Sync& | + | === Cloud storage === |
- | <code html> | + | If you have access to [[https:// |
- | <source src="https:// | + | |
- | </code> | + | |
- | If you do not have access to your own online storage, you can use the provider [[https:// | ||
<code html> | <code html> | ||
- | <source src=" | + | <video width=" |
+ | | ||
+ | </video> | ||
</ | </ | ||
- | **Warning:** In Safari (Apple/ | + | **Important:** Most cloud storage systems |
- | **Warning:** Dropbox may restrict the possibility of direct | + | |
+ | | ||
- | **Warning: | + | === Google Drive, |
+ | |||
+ | 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 (see above) or cloud storage services. | ||
+ | |||
+ | If you store videos on Google Drive or Dropbox and share them from there, these services integrate their own video players. So you don't get the video itself, but only a website that plays the video. Such an external website can be integrated into the questionnaire (as with YouTube) using ''< | ||
+ | |||
+ | <code html> | ||
+ | <iframe width=" | ||
+ | </ | ||
+ | **Warning: | ||
+ | **Warning: | ||
===== Technical hurdles ===== | ===== Technical hurdles ===== | ||