muxinc / videojs-mux-kit

MIT License
33 stars 11 forks source link

Errors getting triggered when initialising using non Javascript version #89

Closed tbobkermux closed 2 years ago

tbobkermux commented 2 years ago

A couple of issues I have identified when initialising Videojs as below:

<video
  id="mux-default"
  class="video-js vjs-16-9"
  controls
  preload="auto"
  width="100%"
  poster="https://image.mux.com/DS00Spx1CV902MCtPj5WknGlR102V5HFkDe/thumbnail.jpg"
  data-setup='{
    "timelineHoverPreviews": true,
    "plugins": {
      "mux": {
        "data": {
          "env_key": "ENV_KEY",
          "video_title": "My Great Video"
        }
      }
    }
  }'
>
  <source src="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe" type="video/mux" />
</video>

1) just adding the playback ID as src throws an error. It seems to be expecting the full playback URL.

Screenshot 2022-08-10 at 17 03 54

2) Initialising as above (non Javascript initialisation) and using the full playback URL throws an error:

Screenshot 2022-08-10 at 17 05 08
cjpillsbury commented 2 years ago

Additional context:

gkatsev commented 2 years ago

I can definitely see the issue on codesandbox, but locally, I'm not seeing it. Even if I load the code via unpkg. I'll continue investigating.

gkatsev commented 2 years ago

I think this is a codesandbox issue. If I create a file that matches the id (codesandbox offered to do it for me), that modulenotfounderror goes away and the player loads fine https://codesandbox.io/s/hardcore-rui-q6ilgi?file=/index.html It also doesn't seem to be a parcel related issue, which I thought for a minute.

gkatsev commented 2 years ago

Just tested again via stackblitz and that loads fine: https://stackblitz.com/edit/web-platform-yfhs7t?file=index.html

I think this is an unfortunate codesandbox issue. I opened an issue against codesandbox: https://github.com/codesandbox/codesandbox-client/issues/6848

Going to close this issue, but I'll try and update it when the codesandbox-client issue is resolved.