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

ASCII-aRT

After writing systems, here is a quick intro into ASCII-aRT - the next evolutionary step of writing - and how it is integrated into LiaScript, such that you can integrate for example also formulas and animations to your image… You can use this this example as a basis for your own course by following this link … Or experiment with it in the LiveEditor below:

Read More

Collaborative drawings made with LiaScript

In this article we will explore how to create a collaborative drawing canvas (in other words a whiteboard) using LiaScript’s internal publish -subscribe mechanisms. This feature will allows multiple users to interact with the same LiaScript course in real-time, enabling collaborative drawing and marking, as demonstrated in the following video. 1. Publish-Subscribe (How does it work?) The publish-subscribe (pub-sub) pattern is a messaging paradigm where messages are sent by publishers to specific topics without the publisher knowing who, if anyone, will receive the message.

Read More

Serverless Online Education

The presentation at the Open Educa Berlin (OEB) Conference on November 24th 2023 focused on “Serverless Online Education” and emphasized the potential of decentralized, browser-based technologies in educational settings. See the agenda here. The recorded video tutorial elaborated on using LiaScript for creating interactive online courses, covering basics of markdown, progressive web apps, offline access, distributed education methods, classroom creation, and hardware sharing in the browser. You can repeat all the steps by your own by using the following URL as a bootstrap:

Read More