@folklore/hooks 0.0.19 → 0.0.20

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/dist/cjs.js CHANGED
@@ -1054,7 +1054,7 @@ function useYouTubePlayer(id) {
1054
1054
  debug$1('iFrame switched');
1055
1055
  destroyPlayer();
1056
1056
  }
1057
- }); // Create player
1057
+ }, [playerElementRef.current, elementRef.current, playerRef.current]); // Create player
1058
1058
 
1059
1059
  react.useEffect(function () {
1060
1060
  var _apiRef$current = apiRef.current,
@@ -1071,7 +1071,7 @@ function useYouTubePlayer(id) {
1071
1071
 
1072
1072
  var player = currentPlayer;
1073
1073
 
1074
- if (player !== null) {
1074
+ if (player !== null && typeof player.loadVideoById !== 'undefined') {
1075
1075
  debug$1('Switch video [ID: %s]', videoId);
1076
1076
  player.loadVideoById(videoId);
1077
1077
  } else {
package/dist/es.js CHANGED
@@ -1042,7 +1042,7 @@ function useYouTubePlayer(id) {
1042
1042
  debug$1('iFrame switched');
1043
1043
  destroyPlayer();
1044
1044
  }
1045
- }); // Create player
1045
+ }, [playerElementRef.current, elementRef.current, playerRef.current]); // Create player
1046
1046
 
1047
1047
  useEffect(function () {
1048
1048
  var _apiRef$current = apiRef.current,
@@ -1059,7 +1059,7 @@ function useYouTubePlayer(id) {
1059
1059
 
1060
1060
  var player = currentPlayer;
1061
1061
 
1062
- if (player !== null) {
1062
+ if (player !== null && typeof player.loadVideoById !== 'undefined') {
1063
1063
  debug$1('Switch video [ID: %s]', videoId);
1064
1064
  player.loadVideoById(videoId);
1065
1065
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@folklore/hooks",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "React hooks",
5
5
  "keywords": [
6
6
  "javascript",
@@ -48,7 +48,7 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "71f0712c94ed09c0e761dddb8e6fc677582c0ddf",
51
+ "gitHead": "f7c4b93417b9b7d4b531ea1f79e992e77e1da0ae",
52
52
  "dependencies": {
53
53
  "@folklore/events": "^0.0.3",
54
54
  "@folklore/services": "^0.1.36",