Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

how to import the library using es6 #577

Closed
vpezeshkian opened this issue Mar 2, 2016 · 11 comments
Closed

how to import the library using es6 #577

vpezeshkian opened this issue Mar 2, 2016 · 11 comments

Comments

@vpezeshkian
Copy link

So I'm using es6 and use imports. video.js itself is working but when I want to import 'videojs-contrib-hls' it doesn't see the module.
import vjs from 'videojs-contrib-hls' throws error.

any suggestion?

@gkatsev
Copy link
Member

gkatsev commented Mar 2, 2016

What version are you using currently? The current versions do not allow this. But will soon be available. See #490, #509, and #250. Thanks.

@gkatsev gkatsev closed this as completed Mar 2, 2016
@vpezeshkian
Copy link
Author

Version 2.0.0
Do you have ETA?

@dmlap
Copy link
Member

dmlap commented Mar 2, 2016

When it's ready? ;) Rough guess: a week or so.

@vpezeshkian
Copy link
Author

👍
Could you please notify me on this thread?
Thank you.

@gaglage
Copy link

gaglage commented Jul 28, 2016

solved? any news?

@forbesjo
Copy link
Contributor

This should be working, here's an example

var videojs = require('video.js');
require('videojs-contrib-hls');

var videoEl = document.createElement('video');
videoEl.id = 'vid';
videoEl.setAttribute('controls', '');
videoEl.setAttribute('width', '600');
videoEl.setAttribute('height', '300');
videoEl.className = 'video-js vjs-default-skin';
document.body.appendChild(videoEl);

var player = videojs('vid');

player.ready(function() {
  player.src({
    src: '//d1sh0fycs31s5a.cloudfront.net/eleph/index.m3u8',
    type: 'application/x-mpegURL'
  });
});

@gaglage
Copy link

gaglage commented Jul 29, 2016

Thansk for the answer.
I'm getting an error (Uncaught TypeError: Cannot convert undefined or null to object, var cacheKeys = Object.keys(cache);). Maybe webpack configuration. I'll try to find the solution! thanks

@gkatsev
Copy link
Member

gkatsev commented Jul 29, 2016

See #600 for issues with webpack and solutions around it in the meantime.

@nehakhandelwal
Copy link

I too facing the same issue .

@AdamTyler
Copy link

@gaglage did you find a workaround for your issue? I'm seeing the same error

@gaglage
Copy link

gaglage commented Nov 29, 2016

Hi @AdamTyler I fixed the issue via #600

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants