@playruo/embed 1.2.6 → 1.2.7

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/index.cjs CHANGED
@@ -122,7 +122,7 @@ var PlayruoEmbed = ({
122
122
  }),
123
123
  [currentState, hasIframeConfirmed, isCompatible]
124
124
  );
125
- const handleTryNow = (0, import_react.useCallback)(() => {
125
+ const handleTryNow = (0, import_react.useCallback)(async () => {
126
126
  if (!isCompatible) {
127
127
  console.warn("[PlayruoEmbed] Browser not compatible");
128
128
  return;
@@ -134,12 +134,11 @@ var PlayruoEmbed = ({
134
134
  }
135
135
  setShowGameIframe(true);
136
136
  try {
137
- const el = iframeRef.current;
138
- if (el) {
139
- try {
140
- el.focus();
141
- } catch {
142
- }
137
+ try {
138
+ await iframe.requestFullscreen();
139
+ console.log("[PlayruoEmbed] Fullscreen granted");
140
+ } catch (fsError) {
141
+ console.warn("[PlayruoEmbed] Fullscreen denied, continuing without:", fsError);
143
142
  }
144
143
  iframe.contentWindow?.postMessage({
145
144
  type: "playruo",
package/dist/index.js CHANGED
@@ -82,7 +82,7 @@ var PlayruoEmbed = ({
82
82
  }),
83
83
  [currentState, hasIframeConfirmed, isCompatible]
84
84
  );
85
- const handleTryNow = useCallback(() => {
85
+ const handleTryNow = useCallback(async () => {
86
86
  if (!isCompatible) {
87
87
  console.warn("[PlayruoEmbed] Browser not compatible");
88
88
  return;
@@ -94,12 +94,11 @@ var PlayruoEmbed = ({
94
94
  }
95
95
  setShowGameIframe(true);
96
96
  try {
97
- const el = iframeRef.current;
98
- if (el) {
99
- try {
100
- el.focus();
101
- } catch {
102
- }
97
+ try {
98
+ await iframe.requestFullscreen();
99
+ console.log("[PlayruoEmbed] Fullscreen granted");
100
+ } catch (fsError) {
101
+ console.warn("[PlayruoEmbed] Fullscreen denied, continuing without:", fsError);
103
102
  }
104
103
  iframe.contentWindow?.postMessage({
105
104
  type: "playruo",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playruo/embed",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "React SDK to embed Playruo with postMessage API.",
5
5
  "license": "MIT",
6
6
  "type": "module",