yanwsh / videojs-panorama

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

Error when trying to use panorama plugin ! #104

Open Bramichou opened 7 years ago

Bramichou commented 7 years ago

Hey, i got this error :

player.panorama is not a function

What am doing wrong ?!

i imported that :

import videojs from 'video.js' import panorama from 'videojs-panorama';

and here is my code

` let canvasElement = this.getRenderer().view; let videoElement = videoLoader.getVideo('video360') videoElement.setAttribute("id", "video360"); videoElement.setAttribute("class", "video-animated-360"); videoElement.style.display = "block"

    canvasElement.style.display = "none"
    canvasElement.style.opacity = 0.

    console.log('video elem', videoElement)
    console.log('video src', videoElement.node)

    videojs.options.autoplay = true

    let the_video = document.querySelector('.video-animated-360')

    this.player = videojs(the_video,{
        preload: 'metadata',
        autoplay : true,
    })

    this.player.on('ready', () => {
        console.log(this.player.muted())
        this.player.muted(true)
        console.log(this.player.muted())
        if(!this.player.isFullscreen()){
            this.player.requestFullscreen()
        }
    })

    this.player.on('ended', () => {
        console.log('finished')
    })

    panorama(this.player, {
        autoMobileOrientation: true,
        initFov: 100,
        clickAndDrag: true
    });

`

Please help me ...

bhartendukumar12 commented 7 years ago

https://s3.ap-south-1.amazonaws.com/viyatrademo/Viyatra.html go to these link and check the source code

riverajohan commented 7 years ago

Did you solve this?