bigbluebutton / bbb-playback

GNU Lesser General Public License v3.0
29 stars 40 forks source link

PUBLIC_URL and basename problems on minified version #275

Open Biegal opened 5 months ago

Biegal commented 5 months ago

Describe the bug TLDR: Playback doesn't load with PUBLIC_URL=. set.

Hi, I'm not sure if that's a bug, or did I misunderstood something, but I have hard time running a final build of latest version (we're trying to make an upgrade from player version around BBB 2.2 or 2.3) using PUBLIC_URL=.. We're using that in pair with REACT_APP_MEDIA_ROOT_URL to serve recordings from a separate domain. With latest version it works in dev, but not on minimized version. Checked different browsers and machines.

To Reproduce

  1. Pull latest code
  2. Use PUBLIC_URL=. REACT_APP_MEDIA_ROOT_URL=https://some-s3-bucket.com/recordings npm run start
  3. Open URL in the browser and test some recordings - should work (like http://localhost:3000/d3a7504b938be957c8f9a8923d0435d90eba0222-1143407945744)
  4. Run PUBLIC_URL=. REACT_APP_MEDIA_ROOT_URL=https://some-s3-bucket.com/recordings npm run build
  5. Serve the ./build directory somehow, could be nginx or serve
  6. Try the same URL in the browser, it won't load

Expected behavior I would expect player to work no matter if running in dev, or deploying to server.

Screenshots If it won't load, it's just a blank screen

Desktop (please complete the following information):

Smartphone (please complete the following information): Didn't tried on smartphone

Additional context I did some small investigation, and my temporary solution is to remove basename from /src/components/router.js. Originally it's basename={process.env.PUBLIC_URL} which is substituted with the basename=. in the end (by setting PUBLIC_URL=. as stated in the docs). Without that basename, the built and minified version works like a charm again.