yanwsh / videojs-panorama

a plugin for videojs run a full 360 degree panorama video.
http://yanwsh.github.io/videojs-panorama/
Other
483 stars 160 forks source link

Problem with the Markers #116

Closed davidboutet closed 6 years ago

davidboutet commented 6 years ago

Cant add Markers in the config, forEach is undefined

MarkerGroup.js:29 Uncaught TypeError: Cannot read property 'forEach' of undefined at new MarkerGroup (MarkerGroup.js:29) at new MarkerContainer (MarkerContainer.js:62) at b.handlePlay (Panorama.js:348) at HTMLDivElement.e (video.min.js:22) at HTMLDivElement.e (video.min.js:22) at HTMLDivElement.d.dispatcher.d.dispatcher (video.min.js:22) at Object.h [as trigger] (video.min.js:22) at b.a.trigger (video.min.js:14) at b.handleTechPlay_ (video.min.js:17) at b.e (video.min.js:22)

yanwsh commented 6 years ago

could you provide me your implementation code?

yanwsh commented 6 years ago

The input option for marker should be array.

like

            Markers: [
                {
                    location: {
                        lat: 20,
                        lon: 160
                    },
                    radius: 500,
                    element: "Marker 2",
                }
            ]

element could be DOM or string element: document.getElementById("a")

davidboutet commented 6 years ago

This is my configuration:

player.panorama({
                    clickToToggle: (!isMobile()),
                    clickAndDrag: true,
                    autoMobileOrientation: isMobile(),
                    initFov: 100,
                    VREnable: isMobile(),
                    backToInitLat: false,
                    backToInitLon: false,
                    Notice: {
                        Enabled: true,
                        Message: (isMobile())? "please drag and drop the video" : "please use your mouse drag and drop the video"
                    },
                    Markers: [
                        {
                            location: {
                                lat: 20,
                                lon: 160
                            },
                            radius: 500,
                            element: "Marker 2"
                        }
                    ],
                    ready: function () {
                        if(!isMobile()) player.play();
                    }
                });

and I still have the same issue "Cannot read property 'forEach' of undefined"

yanwsh commented 6 years ago

Thank you for your report, this bug is fixed, please download plugin again, and let me know if you have any other issues.

davidboutet commented 6 years ago

Everything is fine! Thanks