@creative-web-solution/front-library 7.1.27 → 7.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 7.1.28
4
+
5
+ * [YouTubePlayer]: Update types + use ready event to handle end of loading
6
+
7
+
3
8
  ## 7.1.27
4
9
 
5
10
  * [Slider]: Remove gsap
@@ -106,7 +106,13 @@ export default class YouTubePlayer {
106
106
  "width": this.#options.width,
107
107
  "videoId": this.#options.videoId,
108
108
 
109
- "playerVars": this.#options.playerVars
109
+ "playerVars": this.#options.playerVars,
110
+
111
+ "events": {
112
+ "onReady": () => {
113
+ _resolve( player );
114
+ }
115
+ }
110
116
  } );
111
117
 
112
118
  if ( this.#options.onPlayerStateChange ) {
@@ -118,8 +124,6 @@ export default class YouTubePlayer {
118
124
 
119
125
  $wrapper.YTPlayer = player;
120
126
 
121
- window.requestAnimationFrame( () => _resolve( player ) );
122
-
123
127
  return promise;
124
128
  }
125
129
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Front Library
2
2
 
3
- @version: 7.1.27
3
+ @version: 7.1.28
4
4
 
5
5
 
6
6
  ## Use
@@ -9,7 +9,7 @@ declare namespace FLib {
9
9
  * @defaultValue //www.youtube.com/iframe_api
10
10
  */
11
11
  apiUrl: string;
12
- onPlayerStateChange?: ( e: YT.PlayerEvent ) => void;
12
+ onPlayerStateChange?: YT.PlayerEventHandler<YT.OnStateChangeEvent>;
13
13
  /**
14
14
  * @defaultValue `{ "autoplay": 0, "controls": 2, "autohide": 1, "modestbranding": 1, "showinfo": 0 }`
15
15
  */
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@creative-web-solution/front-library",
3
3
  "title": "Frontend library",
4
4
  "description": "Frontend functions and modules",
5
- "version": "7.1.27",
5
+ "version": "7.1.28",
6
6
  "homepage": "https://github.com/creative-web-solution/front-library",
7
7
  "author": "Creative Web Solution <contact@cws-studio.com> (https://www.cws-studio.com)",
8
8
  "keywords": [],