From d8aadd5bee086dacbdc924e0c54c171a2a46fa73 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Mon, 13 Nov 2017 14:20:05 -0500 Subject: [PATCH] feat: allow embeds via element (#4640) Add the ability to initialize Video.js with an element named video-js. This is because sometimes, seeing the native element is undesirable, plus, it's cool to have our own element. Can be used just like the video embed. IE9 is supported but only with dynamic sources as the source element can only be used inside of the video element. --- docs/guides/embeds.md | 87 +++++++++++++++++++ docs/guides/setup.md | 2 + sandbox/embeds.html.example | 165 ++++++++++++++++++++++++++++++++++++ src/js/player.js | 40 +++++++-- src/js/setup.js | 7 ++ src/js/video.js | 1 + test/unit/video.test.js | 155 +++++++++++++++++++++++++++++++++ 7 files changed, 450 insertions(+), 7 deletions(-) create mode 100644 docs/guides/embeds.md create mode 100644 sandbox/embeds.html.example diff --git a/docs/guides/embeds.md b/docs/guides/embeds.md new file mode 100644 index 0000000000..928ec2e03e --- /dev/null +++ b/docs/guides/embeds.md @@ -0,0 +1,87 @@ +# How to Embed the Video.js player + +Video.js is meant to be an enhacement to the video element in HTML5 so for years, its embed code has been just a `