Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <img src=",w_200/v1/logo/for_white_bg/cloudinary_vertical_logo_for_white_bg.png">
<p>Take a screen recording on the web and upload it to Cloudinary</p>

<div class="container">
  <button id="recorder">
    Capture screen for 2 seconds and Upload to Cloudinary
  <video id="videoElement" autoplay></video>


  display: flex;
  flex-direction: column;
  align-items: center;

  width: 50%;
  padding: 30px;

  display: flex;
  flex-direction: column;
  align-items: center;


                let recorder = document.getElementById('recorder')

let videoElement = document.getElementById('videoElement')

recorder.onclick = async () => {
    let mStream = await navigator.getDisplayMedia({ 'video': true })

    videoElement.srcObject = mStream

    let opts = { mimeType: 'video/webm; codecs=vp9' };
    let rec = new MediaRecorder(videoElement.srcObject, opts);
    let blobs = [];

    rec.ondataavailable = (e) => ( && > 0) ? blobs.push( : null;
    rec.onstop = () => {
        //  get the image blob
        let finalBlob = new Blob(blobs, { type: 'video/mp4' });
        // create form data for submission         
        let formData = new FormData();
        formData.append('upload_preset', 'CLOUDINARY_UPLOAD_PRESET');
        formData.append('api_key', "CLOUDINARY_API_KEY");
        formData.append('file', finalBlob);
        var xhr = new XMLHttpRequest();"POST", '');

        xhr.onreadystatechange = function () {
            if (this.readyState == XMLHttpRequest.DONE && this.status == 200) {
                alert("Video uploaded to your cloudinary media library");


    setTimeout(() => rec.stop(), 2000)