BigVideo.js icon indicating copy to clipboard operation
BigVideo.js copied to clipboard

Need explanation : BigVideo.js and Grunt...

Open monkeymonk opened this issue 12 years ago • 6 comments

Hi there,

I'm trying to use BigVideo.js in a workflow with grunt...

But, and I don't know exactly why, I just have some error (eg. "Uncaught TypeError: undefined is not a function")...

Here the Gruntfile.js uglify section :

video: {
    files: {
        'js/video.min.js': [
            'packages/jquery-ui/ui/jquery-ui/minified/jquery-ui.min.js',
            'packages/imagesloaded/imagesloaded.js',
            'packages/video.js/video.js',
            'packages/BigVideo.js/lib/bigvideo.js',
        ]
    }
}, // video

The main script :

$('div.background')
.each(function () {
    var $el = $(this), data = $el.data();

    if (data.src) {
        var BV = new $.BigVideo();
        BV.init();
        BV.show(data.src);
    }
});

Did I miss something ?

Thank's for your help!

Br, Mk

monkeymonk avatar Dec 06 '13 16:12 monkeymonk

Same here.

Error similar to @monkeymonk.

uglify: {
      dist: {
        files: {
            'js/video.min.js': [
              'bower_components/video.js/video.js',
              'bower_components/BigVideo.js/lib/bigvideo.js',
              'bower_components/jquery-ui/ui/jquery-ui.js',
              'bower_components/jquery-ui/ui/jquery.ui.slider.js',
              'bower_components/imagesloaded/imagesloaded.js',
              'bower_components/eventErmitter/EventErmitter.js',
              'bower_components/eventie/eventie.js',
            ],
            'js/bowercomps.min.js': [
              'bower_components/jquery-backstretch/jquery.backstretch.js',
              'bower_components/jquery-mousewheel/jquery.mousewheel.js'
            ],
            'js/all.min.js': [
              'js/vendor/bootstrap.min.js',
              'js/fancybox/fancybox.pack.js',
              'js/plugins.js',
              'js/main.js'
            ]
        }
      }
    }

jeremyzahner avatar Dec 12 '13 10:12 jeremyzahner

did you find a solution?

Did you try breaking BigVideo js files/dependencies out of grunt and into just linked scripts?

I was have a similar issue and I ignored them from grunt/uglify and they seemed to work fine once i linked them.

My origin thought is that uglify is doing something weird.

knynkwl avatar Mar 13 '14 16:03 knynkwl

@knynkwl Actually i did not. My solution in this case was to completely abandon VideoJS and build my own Wrapper for the Video. I'd provide you with the code if you'd like.

jeremyzahner avatar Mar 21 '14 08:03 jeremyzahner

@jeremyzahner Very much so! :)

d-simon avatar Mar 31 '14 06:03 d-simon

@jeremyzahner would love to see what you got!

knynkwl avatar Apr 02 '14 21:04 knynkwl

I am not using Bower, but I had this exact same issue. I solved it by downloading EventEmitter.js from https://github.com/Wolfy87/EventEmitter and including it in my project.

larsekman avatar Mar 16 '15 14:03 larsekman