compact / angular-bootstrap-lightbox

An AngularJS lightbox built using UI Bootstrap Modal.
http://compact.github.io/angular-bootstrap-lightbox/
MIT License
306 stars 134 forks source link

Can't play video when calling openLightboxModal event #97

Open chanhnv91 opened 3 years ago

chanhnv91 commented 3 years ago
Screen Shot 2021-08-25 at 02 40 49

I get an error like the picture attached when I click on the thumbnail to open the video. Here is my code:

              _.each(element.files, function (file) {
                    var r = new FileReader();
                    r.onload = function (e) {
                        if (!vm.fileContainers) vm.fileContainers = [];
                        var newFileContainer = {
                            name: file.name,
                            type: file.type.split('/')[0],
                            url: this.result
                        };
                        vm.fileContainers.push(newFileContainer);
                        $scope.$apply();
                        vm.changeEvent(vm.fileContainers);
                    }
                    r.readAsDataURL(file);
                })
       function openLightboxModal(imageContainers, index) {

                Lightbox.openModal(imageContainers, index);
        };

Thanks