How NOT to add a Youtube Player to VSC

The truth of being a creative technologist is that raw creativity is oft constrained by the reality of technology available to you.[click to tweet]

This actually isn't the case in the impractical, since you could build anything that isn't disallowed by physics from scratch given infinite time and resources. The problem is, I don't know anyone with infinite time and resources.

Approximation

Often an idea can be realized by approximation, meaning that you don't create exactly what your vision is but you make something close. The Pareto Principle is at play here, masked as experience. People who are driven and curious enough will create heuristics in the mind that effectively serve as processing shortcuts.

All of my projects are done in this way. I set a goal that is slightly out of my comfort zone, and then see if I can flail my way to a solution that satifies my creative vision and the constraints of reality.

The conservative British columnist Christopher Booker says that “when we embark on a course of action which is unconsciously driven by wishful thinking, all may seem to go well for a time”—but that because “this make-believe can never be reconciled with reality,” it will inevitably lead to what he describes as a multi-stage breakdown: “dream,” “frustration,” “nightmare,” “explosion.” Computer science paints a dramatically rosier view. Then again, as an optimization technique, relaxation is all about being consciously driven by wishful thinking. Perhaps that’s partly what makes the difference. -- Algorithms to Live By

Ocassionally I meet my match. A project that would require mountains to be moved to be completed, and the best course of action is to...quit.

YouTube in VSC

As an avid code writer/project management junkie and self proclaimed YouTube connoisseur, it was only a matter of time until I came across the idea of putting YouTube into VSC.

As all my projects start I try and put into words or really simple pictures what I see in my head. Sometimes I head directly into the code editor, if I feel confident enough about my proposed solution to the problem.

Then I enter the coding and research phase, a phase consumed by metal music and Google, scouring the wisdom of the sages of people who had run into walls similar to mine.

Later, when Ged thought back upon that night, he knew that had none touched him when he lay thus spirit-lost, had none called him back in some way, he might have been lost for good. It was only the dumb instinctive wisdom of the beast who licks his hurt companion to comfort him, and yet in that wisdom Ged saw something akin to his own power, something that went as deep as wizardry. From that time forth he believed that the wise man is one who never sets himself apart from other living things, whether they have speech or not, and in later years he strove long to learn what can be learned, in silence, from the eyes of animals, the flight of birds, the great slow gestures of trees. -- A Wizard of Earthsea

The Fatal Blow

I was dealing with an issue where iFrames would not load YouTube vids. I tried the API, manual HTML, skipping CSP, adding layers of CSP, nothing worked. The errors were vague and there seemed to be no way to fix them or even address them directly!

Here's the code I settled with on adding a security policy to the website. This means that it will only allow certain types of data to be used on the site.

Then I came across another poor soul who seems to have attempted the same task as me.[click to tweet]

That's the way the cookie crumbles! VSC itself doesn't support video 😵‍💫

MFW electron doesn't support ffmpeg

Read These Next

Turn YouTube videos into searchable text

Voila, now you can search through timestamped YouTube videos

A List of Good Matts

While surely there are bad Matts out there (and ive met a few!!), these are not them.

Stay in Touch

Each week, I send out something that looks like this. Sign up below if you want in!