naver / egjs-view360

360 integrated viewing solution
https://naver.github.io/egjs-view360/
MIT License
500 stars 90 forks source link

Uncaught ReferenceError: View360 is not defined #428

Open Ludus731 opened 1 year ago

Ludus731 commented 1 year ago

Description

Installation/setup of View360 using CDN (documentation) is not working.

Steps to check or reproduce

  1. Paste this code into an HTML file:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8" />
    <link rel="stylesheet" href="https://naver.github.io/egjs-view360/release/latest/css/view360.min.css" />
    </head>
    <body>
    <div class="view360-container is-16by9">
        <canvas class="view360-canvas" />
    </div>
    
    <script src="https://naver.github.io/egjs-view360/release/latest/dist/view360.pkgd.js"></script>
    <script>
        const viewer = new View360("#viewer", {
            projection: new View360.EquirectProjection({
                src: "img.jpg",
                video: false
            })
        });
    </script>
    </body>
    </html> 
  2. Open the page in a browser and you should see an error in the console: Uncaught ReferenceError: View360 is not defined.
malangfox commented 1 year ago

Hello @Ludus731.

It seems that https://naver.github.io/egjs-view360/release/latest/dist/view360.pkgd.js provides view360 v3, which is different from the documentation. I think you can use https://naver.github.io/egjs-view360/release/4.0.0-beta.7/view360.pkgd.js instead.

We'll fix the incorrect part of the documentation soon.