0

Is there a way to embed my videos on other people's web pages?

Specifically, I would like for my students to go through an online tutorial that someone else created (Kotlin Koans) and be able to see my instructional videos on those pages. I know there are tools that let people annotate web pages. Are there any that allow embedding videos in arbitrary web pages? I understand that my students would have to install third-party code.

I'm sure this could be done with TamperMonkey, but I don't see any ready-made scripts to do what I want. While I could roll my own, I would prefer to use an existing solution.

0

I figured out how to embed YouTube videos into the Kotlin Koans by creating the following GreaseMonkey/TamperMonkey script:

// ==UserScript==
// @name         Embed my videos
// @namespace    http://example.com
// @version      0.1
// @description  show my videos
// @author       Ellen
// @match        https://play.kotlinlang.org/koans/*
// @grant        none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==

(function() {
    'use strict';
    let re = new RegExp('https://play.kotlinlang.org/koans/([^/]+)/([^/]+)/Task.kt');
    var url = window.location.href;
    var groups = re.exec(url);
    var level = groups[1];
    var task = groups[2];
    var d = $("div.editor-content");
    var iframe = $('<iframe>', {
        width: 560,
        height: 315,
        src: "https://www.youtube.com/embed/NIVFgU5f2Rs",
        frameborder: 0
    });
    d.append(iframe);
})();

The video it currently embeds is not mine. I plan to add a mapping from levels and tasks (e.g., "introduction" and "Hello, world!") to my videos.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.