-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add type attribute and fallback widths #19
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a couple of questions
- I noticed that you removed the dist folder completely. Was this intentional or do you want to add it back in at a later point, ie first stable release?
- Looks like we gutted most of the helper functions. Was that because there was actually no need for them? Just wanted to get some clarity there.
export const generateUid = function () { | ||
let ID = ''; | ||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; | ||
for (let i = 0; i < 12; i++) { | ||
ID += characters.charAt(Math.floor(Math.random() * 36)); | ||
} | ||
return ID; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do we intend on using this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
* This removes the shadow root and renders the elements as children of the | ||
* host element. | ||
* | ||
* This in turn removes our ability to use `css` and `cssPart` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking but does this somehow affect the decorator on L10 of this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes. That's a JS doc but probably not needed now.
* The options set here will override any options set in the dataSetup | ||
* attribute. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth calling out that video.js will automatically merge these together for us?
bf0925b
to
aa447cc
Compare
This commit refactors `ix-video.ts` so that: 1. Less JSON parsing/object manipulation needs to be done to use dataSetup. 2. Fallback styling is more in line with user expectations and videojs defaults 3. There are no FOUC issues when using fallback styling 4. Since shadow-dom is off, we defensively add unique identifiers to video players One of the main changes in this commit is the use of the `connectedCallback()` lifecycle method to set a minimum width for the host component and the video element. Another significant change is the use of the `type` attribute. Although it defaults to HLS, adding it allows us to provide a way for users to use this component with other video filetypes
The css-part jsdoc tells the web-component manifest parser that the shadow dom exposes that css "part". We're not using the shadow dom so we should not include it.
Before this PR:
After this PR
Steps to test
To test in React, Vite
npm/yarn link
npm/yarn build
npm/yarn link @imgix/shared-wc
To test locally
npm run dev
ornpm run serve
ix-video.ts