I'm trying to use videojs 7.2.0 with videojs-youtube 2.5.0 but I'm getting this error: Cannot read property 'IS_IOS' of undefined
It refers to a line of code on videojs-youtube:
var _isOnMobile = videojs.browser.IS_IOS || videojs.browser.IS_NATIVE_ANDROID;
When I do it using cdn it works correctly:
http://jsfiddle.net/victorpfm/yendv5g2/
But when I try to use it inside a vue single file compoonent (SFC) I get that error.
It works when I downgrade to videojs 6.12
When I try to render this component in a test using mount from vue-utils and mocha-webpack the error I get is:
TypeError: Cannot read property 'parentNode' of undefined
Compile this vue SFC:
<template>
<div>
<video ref="player" class="video-js vjs-default-skin" controls></video>
</div>
</template>
<script>
import videojs from 'video.js';
require('videojs-youtube');
export default {
props: ['src'],
mounted() {
let video = videojs(this.$refs.player, {techOrder: ['youtube']});
video.src({type: 'video/youtube', src: 'https://www.youtube.com/watch?v=q4Gj3zoN3MY'})
}
}
</script>
It should render properly since the cdn version works.
When I compile that component and open it in the browser, I get an error in the console and the video player doesnt get rendered
Cannot read property 'IS_IOS' of undefined
Please include any additional information necessary here. Including the following error
videojs 7.2.0
videojs-youtube 2.5.0
just tried with chrome
just tried on windows 10
videojs-youtube 2.5.0
I'm getting the same error message using Yarn as my package manager. Safari and Chrome (MacOS 10.13.6) both throw the same errors.
I can confirm the same with:
[email protected][email protected]Edit: rolling back to [email protected] was the easy fix w/o forking and debugging
Same here.
This is most likely has to do with babel ES6 / ES5 usage and should be fixed via https://github.com/videojs/videojs-youtube/pull/512 in the new videojs-youtube version 2.5.1 which is now out.
Most helpful comment
I can confirm the same with:
[email protected][email protected]Edit: rolling back to
[email protected]was the easy fix w/o forking and debugging