cloudflare-video-element
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -0,1 +1,10 @@ | ||
## [1.0.2](https://github.com/luwes/cloudflare-video-element/compare/v1.0.1...v1.0.2) (2023-09-17) | ||
### Bug Fixes | ||
* add readyState workaround fix [#1](https://github.com/luwes/cloudflare-video-element/issues/1) ([09c8592](https://github.com/luwes/cloudflare-video-element/commit/09c8592914ea4b809cd34a609c6d157fa15f2283)) | ||
## [1.0.1](https://github.com/luwes/cloudflare-video-element/compare/v1.0.0...v1.0.1) (2023-08-06) | ||
@@ -2,0 +11,0 @@ |
@@ -79,2 +79,3 @@ // https://developers.cloudflare.com/stream/viewing-videos/using-the-stream-player/using-the-player-api/ | ||
#options; | ||
#readyState = 0; | ||
@@ -97,2 +98,3 @@ constructor() { | ||
this.#readyState = 0; | ||
this.dispatchEvent(new Event('emptied')); | ||
@@ -150,2 +152,14 @@ | ||
this.api.addEventListener('loadedmetadata', () => { | ||
this.#readyState = 1; // HTMLMediaElement.HAVE_METADATA | ||
}); | ||
this.api.addEventListener('loadeddata', () => { | ||
this.#readyState = 2; // HTMLMediaElement.HAVE_CURRENT_DATA | ||
}); | ||
this.api.addEventListener('playing', () => { | ||
this.#readyState = 3; // HTMLMediaElement.HAVE_FUTURE_DATA | ||
}); | ||
// The video events are dispatched on the api instance. | ||
@@ -219,3 +233,3 @@ // This makes it possible to add event listeners before the element is upgraded. | ||
get readyState() { | ||
return this.api?.readyState; | ||
return this.#readyState; | ||
} | ||
@@ -222,0 +236,0 @@ |
{ | ||
"name": "cloudflare-video-element", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A custom element for the Cloudflare player with an API that matches the `<video>` API", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22286
459