Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gkatsev
Created July 17, 2016 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gkatsev/d50e24f6fe1cc0e4e07578b26f17a402 to your computer and use it in GitHub Desktop.
Save gkatsev/d50e24f6fe1cc0e4e07578b26f17a402 to your computer and use it in GitHub Desktop.
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNextbin Sketch</title>
<!-- put additional styles and scripts here -->
<link href="//vjs.zencdn.net/5.10/video-js.css" rel="stylesheet">
</head>
<body>
<!-- put markup and other contents here -->
</body>
</html>
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
import videojs from 'video.js';
import document from 'global/document';
var video = document.createElement('video');
var source = document.createElement('source');
source.src = '//vjs.zencdn.net/v/oceans.mp4';
source.type = 'video/mp4';
video.className = 'video-js';
video.appendChild(source);
document.body.appendChild(video);
var player = videojs(video);
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"video.js": "5.10.4",
"global": "4.3.0"
}
}
'use strict';
var _video = require('video.js');
var _video2 = _interopRequireDefault(_video);
var _document = require('global/document');
var _document2 = _interopRequireDefault(_document);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
var video = _document2.default.createElement('video');
var source = _document2.default.createElement('source');
source.src = '//vjs.zencdn.net/v/oceans.mp4';
source.type = 'video/mp4';
video.className = 'video-js';
video.appendChild(source);
_document2.default.body.appendChild(video);
var player = (0, _video2.default)(video);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment