Importing a local WebCam-stream into a Presentation

Importing a local WebCam-stream into a Presentation

Sometimes you want to show a live video stream from a local WebCam in your presentation, without having to move to another application. This can be done with the following script and video-tag. It will ask for permission to access the camera and will display the video stream in a video element. If you click on the button again, the camera will be closed.

Simply copy both tags into your LiaScript document and you will be able to open and close the camera stream with the button.

How does it work?

The video-tag is the place for your video, it could be placed also below the script tag. The script tag will search for the video element and will try to access the camera stream. If the camera is not available, it will output an error message. If the camera is available, it will display the video stream within the video tag and switch its display style form none to block and change the button text to “Close Camera”. If you click on the button again, the camera will be closed. By using type submit as input, the button will be displayed as a submit button, which will trigger the script execution only if the button is clicked.

Additionally in order to have persistent slide, the persistent: true tag is used, which will keep the state of the video element and the camera stream, even if you switch to another slide and come back. If this is not defined, you will have to click onto the button again when you revisit the slide, to open the camera stream.

Related Posts

Liascript User Symposium (Recording)

Discover WHO is utilizing and creating free, open online courses using the user-friendly LiaScript Markdown and WHY. Learn about the role of AI in course development, and how Open Educational Resources (OER) can be enhanced through browser-based peer-to-peer technologies. Additionally, explore our latest advancements in collaborative features within LiaScript, as well as Edrys-Lite, which aids in developing and sharing interactive, peer-to-peer RemoteLabs as OER. Soon this functionality will be available in LiaScript too!

Read More

Fischbestimmer - FISHIDENTIFIER

This is an experiment of porting the FISHIDENTIFIER from the Deutsches Meeresmuseeum Stralsund to LiaScript. The original version can be found at: https://www.ostsee-fischbestimmer.de/en/bestimmer This port was done on the basis of the German version, but it was possible to translate the entire functionality into LiaScript. Visit the Fischbestimmer Usage About 80 species of fish regularly occur in the Baltic Sea. Roughly the same amount of species occasionally enters as vagrants from the the North Sea or via discharging rivers.

Read More

Freie Lehr-Lern-Materialien ohne Wenn und Aber I (German)

LiaScript erweitert Markdown um Elemente wie interaktive Animationen, Quizze, Text-To-Speech Elemente, out-of-the-box Programmierumgebungen usw., die für den Einsatz in der Lehre zwingend erforderlich sind. Gleichzeitig bleibt aber die einfache Syntax, die ohne spezifische Editoren bearbeitet werden kann, erhalten und kann gut für die gemeinsame Entwicklung von Lehrinhalten eingesetzt werden. Die Interpretation erfolgt unmittelbar im Browser, über SCORM 1.2 Schnittstellen können die Kurse aber auch direkt in die bekannten Learning Management Systeme (LMS) integriert werden.

Read More