[ts][player] Fix error message in case WebGL context could not be created.

This commit is contained in:
Mario Zechner 2024-04-23 15:45:18 +02:00
parent ee72ad3e22
commit 682e1125e0
10 changed files with 112 additions and 133 deletions

View File

@ -1,12 +1,12 @@
{ {
"name": "@esotericsoftware/spine-ts", "name": "@esotericsoftware/spine-ts",
"version": "4.2.36", "version": "4.2.37",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@esotericsoftware/spine-ts", "name": "@esotericsoftware/spine-ts",
"version": "4.2.36", "version": "4.2.37",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"workspaces": [ "workspaces": [
"spine-core", "spine-core",
@ -41,6 +41,21 @@
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@esbuild/darwin-arm64": {
"version": "0.16.17",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esotericsoftware/spine-canvas": { "node_modules/@esotericsoftware/spine-canvas": {
"resolved": "spine-canvas", "resolved": "spine-canvas",
"link": true "link": true
@ -70,18 +85,18 @@
"link": true "link": true
}, },
"node_modules/@pixi/assets": { "node_modules/@pixi/assets": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@types/css-font-loading-module": "^0.0.12" "@types/css-font-loading-module": "^0.0.12"
}, },
"peerDependencies": { "peerDependencies": {
"@pixi/core": "7.4.2" "@pixi/core": "7.3.3"
} }
}, },
"node_modules/@pixi/color": { "node_modules/@pixi/color": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
@ -94,23 +109,24 @@
"peer": true "peer": true
}, },
"node_modules/@pixi/constants": { "node_modules/@pixi/constants": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true "peer": true
}, },
"node_modules/@pixi/core": { "node_modules/@pixi/core": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@pixi/color": "7.4.2", "@pixi/color": "7.3.3",
"@pixi/constants": "7.4.2", "@pixi/constants": "7.3.3",
"@pixi/extensions": "7.4.2", "@pixi/extensions": "7.3.3",
"@pixi/math": "7.4.2", "@pixi/math": "7.3.3",
"@pixi/runner": "7.4.2", "@pixi/runner": "7.3.3",
"@pixi/settings": "7.4.2", "@pixi/settings": "7.3.3",
"@pixi/ticker": "7.4.2", "@pixi/ticker": "7.3.3",
"@pixi/utils": "7.4.2" "@pixi/utils": "7.3.3",
"@types/offscreencanvas": "^2019.6.4"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -118,93 +134,93 @@
} }
}, },
"node_modules/@pixi/display": { "node_modules/@pixi/display": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"peerDependencies": { "peerDependencies": {
"@pixi/core": "7.4.2" "@pixi/core": "7.3.3"
} }
}, },
"node_modules/@pixi/extensions": { "node_modules/@pixi/extensions": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true "peer": true
}, },
"node_modules/@pixi/graphics": { "node_modules/@pixi/graphics": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"peerDependencies": { "peerDependencies": {
"@pixi/core": "7.4.2", "@pixi/core": "7.3.3",
"@pixi/display": "7.4.2", "@pixi/display": "7.3.3",
"@pixi/sprite": "7.4.2" "@pixi/sprite": "7.3.3"
} }
}, },
"node_modules/@pixi/math": { "node_modules/@pixi/math": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true "peer": true
}, },
"node_modules/@pixi/mesh": { "node_modules/@pixi/mesh": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"peerDependencies": { "peerDependencies": {
"@pixi/core": "7.4.2", "@pixi/core": "7.3.3",
"@pixi/display": "7.4.2" "@pixi/display": "7.3.3"
} }
}, },
"node_modules/@pixi/runner": { "node_modules/@pixi/runner": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true "peer": true
}, },
"node_modules/@pixi/settings": { "node_modules/@pixi/settings": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@pixi/constants": "7.4.2", "@pixi/constants": "7.3.3",
"@types/css-font-loading-module": "^0.0.12", "@types/css-font-loading-module": "^0.0.12",
"ismobilejs": "^1.1.0" "ismobilejs": "^1.1.0"
} }
}, },
"node_modules/@pixi/sprite": { "node_modules/@pixi/sprite": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"peerDependencies": { "peerDependencies": {
"@pixi/core": "7.4.2", "@pixi/core": "7.3.3",
"@pixi/display": "7.4.2" "@pixi/display": "7.3.3"
} }
}, },
"node_modules/@pixi/text": { "node_modules/@pixi/text": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"peerDependencies": { "peerDependencies": {
"@pixi/core": "7.4.2", "@pixi/core": "7.3.3",
"@pixi/sprite": "7.4.2" "@pixi/sprite": "7.3.3"
} }
}, },
"node_modules/@pixi/ticker": { "node_modules/@pixi/ticker": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@pixi/extensions": "7.4.2", "@pixi/extensions": "7.3.3",
"@pixi/settings": "7.4.2", "@pixi/settings": "7.3.3",
"@pixi/utils": "7.4.2" "@pixi/utils": "7.3.3"
} }
}, },
"node_modules/@pixi/utils": { "node_modules/@pixi/utils": {
"version": "7.4.2", "version": "7.3.3",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@pixi/color": "7.4.2", "@pixi/color": "7.3.3",
"@pixi/constants": "7.4.2", "@pixi/constants": "7.3.3",
"@pixi/settings": "7.4.2", "@pixi/settings": "7.3.3",
"@types/earcut": "^2.1.0", "@types/earcut": "^2.1.0",
"earcut": "^2.2.4", "earcut": "^2.2.4",
"eventemitter3": "^4.0.0", "eventemitter3": "^4.0.0",
@ -228,7 +244,6 @@
}, },
"node_modules/@types/offscreencanvas": { "node_modules/@types/offscreencanvas": {
"version": "2019.7.3", "version": "2019.7.3",
"dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/three": { "node_modules/@types/three": {
@ -499,18 +514,13 @@
} }
}, },
"node_modules/call-bind": { "node_modules/call-bind": {
"version": "1.0.7", "version": "1.0.5",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"es-define-property": "^1.0.0",
"es-errors": "^1.3.0",
"function-bind": "^1.1.2", "function-bind": "^1.1.2",
"get-intrinsic": "^1.2.4", "get-intrinsic": "^1.2.1",
"set-function-length": "^1.2.1" "set-function-length": "^1.1.1"
},
"engines": {
"node": ">= 0.4"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
@ -813,19 +823,16 @@
} }
}, },
"node_modules/define-data-property": { "node_modules/define-data-property": {
"version": "1.1.4", "version": "1.1.1",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"es-define-property": "^1.0.0", "get-intrinsic": "^1.2.1",
"es-errors": "^1.3.0", "gopd": "^1.0.1",
"gopd": "^1.0.1" "has-property-descriptors": "^1.0.0"
}, },
"engines": { "engines": {
"node": ">= 0.4" "node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/define-property": { "node_modules/define-property": {
@ -885,25 +892,6 @@
"node": ">= 0.8" "node": ">= 0.8"
} }
}, },
"node_modules/es-define-property": {
"version": "1.0.0",
"license": "MIT",
"peer": true,
"dependencies": {
"get-intrinsic": "^1.2.4"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-errors": {
"version": "1.3.0",
"license": "MIT",
"peer": true,
"engines": {
"node": ">= 0.4"
}
},
"node_modules/esbuild": { "node_modules/esbuild": {
"version": "0.16.17", "version": "0.16.17",
"dev": true, "dev": true,
@ -1178,19 +1166,15 @@
} }
}, },
"node_modules/get-intrinsic": { "node_modules/get-intrinsic": {
"version": "1.2.4", "version": "1.2.2",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"es-errors": "^1.3.0",
"function-bind": "^1.1.2", "function-bind": "^1.1.2",
"has-proto": "^1.0.1", "has-proto": "^1.0.1",
"has-symbols": "^1.0.3", "has-symbols": "^1.0.3",
"hasown": "^2.0.0" "hasown": "^2.0.0"
}, },
"engines": {
"node": ">= 0.4"
},
"funding": { "funding": {
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
@ -1267,18 +1251,18 @@
} }
}, },
"node_modules/has-property-descriptors": { "node_modules/has-property-descriptors": {
"version": "1.0.2", "version": "1.0.1",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"es-define-property": "^1.0.0" "get-intrinsic": "^1.2.2"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/has-proto": { "node_modules/has-proto": {
"version": "1.0.3", "version": "1.0.1",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"engines": { "engines": {
@ -2030,11 +2014,11 @@
"peer": true "peer": true
}, },
"node_modules/qs": { "node_modules/qs": {
"version": "6.12.0", "version": "6.11.2",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"side-channel": "^1.0.6" "side-channel": "^1.0.4"
}, },
"engines": { "engines": {
"node": ">=0.6" "node": ">=0.6"
@ -2317,16 +2301,15 @@
"license": "ISC" "license": "ISC"
}, },
"node_modules/set-function-length": { "node_modules/set-function-length": {
"version": "1.2.2", "version": "1.2.0",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"define-data-property": "^1.1.4", "define-data-property": "^1.1.1",
"es-errors": "^1.3.0",
"function-bind": "^1.1.2", "function-bind": "^1.1.2",
"get-intrinsic": "^1.2.4", "get-intrinsic": "^1.2.2",
"gopd": "^1.0.1", "gopd": "^1.0.1",
"has-property-descriptors": "^1.0.2" "has-property-descriptors": "^1.0.1"
}, },
"engines": { "engines": {
"node": ">= 0.4" "node": ">= 0.4"
@ -2360,17 +2343,13 @@
} }
}, },
"node_modules/side-channel": { "node_modules/side-channel": {
"version": "1.0.6", "version": "1.0.4",
"license": "MIT", "license": "MIT",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"call-bind": "^1.0.7", "call-bind": "^1.0.0",
"es-errors": "^1.3.0", "get-intrinsic": "^1.0.2",
"get-intrinsic": "^1.2.4", "object-inspect": "^1.9.0"
"object-inspect": "^1.13.1"
},
"engines": {
"node": ">= 0.4"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
@ -2989,33 +2968,33 @@
}, },
"spine-canvas": { "spine-canvas": {
"name": "@esotericsoftware/spine-canvas", "name": "@esotericsoftware/spine-canvas",
"version": "4.2.36", "version": "4.2.37",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.36" "@esotericsoftware/spine-core": "4.2.37"
} }
}, },
"spine-core": { "spine-core": {
"name": "@esotericsoftware/spine-core", "name": "@esotericsoftware/spine-core",
"version": "4.2.36", "version": "4.2.37",
"license": "LicenseRef-LICENSE" "license": "LicenseRef-LICENSE"
}, },
"spine-phaser": { "spine-phaser": {
"name": "@esotericsoftware/spine-phaser", "name": "@esotericsoftware/spine-phaser",
"version": "4.2.36", "version": "4.2.37",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-canvas": "4.2.36", "@esotericsoftware/spine-canvas": "4.2.37",
"@esotericsoftware/spine-core": "4.2.36", "@esotericsoftware/spine-core": "4.2.37",
"@esotericsoftware/spine-webgl": "4.2.36" "@esotericsoftware/spine-webgl": "4.2.37"
} }
}, },
"spine-pixi": { "spine-pixi": {
"name": "@esotericsoftware/spine-pixi", "name": "@esotericsoftware/spine-pixi",
"version": "4.2.36", "version": "4.2.37",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.36" "@esotericsoftware/spine-core": "4.2.37"
}, },
"peerDependencies": { "peerDependencies": {
"@pixi/assets": "^7.2.4", "@pixi/assets": "^7.2.4",
@ -3028,26 +3007,26 @@
}, },
"spine-player": { "spine-player": {
"name": "@esotericsoftware/spine-player", "name": "@esotericsoftware/spine-player",
"version": "4.2.36", "version": "4.2.37",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-webgl": "4.2.36" "@esotericsoftware/spine-webgl": "4.2.37"
} }
}, },
"spine-threejs": { "spine-threejs": {
"name": "@esotericsoftware/spine-threejs", "name": "@esotericsoftware/spine-threejs",
"version": "4.2.36", "version": "4.2.37",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.36" "@esotericsoftware/spine-core": "4.2.37"
} }
}, },
"spine-webgl": { "spine-webgl": {
"name": "@esotericsoftware/spine-webgl", "name": "@esotericsoftware/spine-webgl",
"version": "4.2.36", "version": "4.2.37",
"license": "LicenseRef-LICENSE", "license": "LicenseRef-LICENSE",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.36" "@esotericsoftware/spine-core": "4.2.37"
} }
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-ts", "name": "@esotericsoftware/spine-ts",
"version": "4.2.36", "version": "4.2.37",
"description": "The official Spine Runtimes for the web.", "description": "The official Spine Runtimes for the web.",
"type": "module", "type": "module",
"files": [ "files": [

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-canvas", "name": "@esotericsoftware/spine-canvas",
"version": "4.2.36", "version": "4.2.37",
"description": "The official Spine Runtimes for the web.", "description": "The official Spine Runtimes for the web.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
@ -31,6 +31,6 @@
}, },
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.36" "@esotericsoftware/spine-core": "4.2.37"
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-core", "name": "@esotericsoftware/spine-core",
"version": "4.2.36", "version": "4.2.37",
"description": "The official Spine Runtimes for the web.", "description": "The official Spine Runtimes for the web.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-phaser", "name": "@esotericsoftware/spine-phaser",
"version": "4.2.36", "version": "4.2.37",
"description": "The official Spine Runtimes for the Phaser.", "description": "The official Spine Runtimes for the Phaser.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
@ -31,8 +31,8 @@
}, },
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.36", "@esotericsoftware/spine-core": "4.2.37",
"@esotericsoftware/spine-webgl": "4.2.36", "@esotericsoftware/spine-webgl": "4.2.37",
"@esotericsoftware/spine-canvas": "4.2.36" "@esotericsoftware/spine-canvas": "4.2.37"
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-pixi", "name": "@esotericsoftware/spine-pixi",
"version": "4.2.36", "version": "4.2.37",
"description": "The official Spine Runtimes for the web.", "description": "The official Spine Runtimes for the web.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
@ -31,7 +31,7 @@
}, },
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.36" "@esotericsoftware/spine-core": "4.2.37"
}, },
"peerDependencies": { "peerDependencies": {
"@pixi/core": "^7.2.4", "@pixi/core": "^7.2.4",

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-player", "name": "@esotericsoftware/spine-player",
"version": "4.2.36", "version": "4.2.37",
"description": "The official Spine Runtimes for the web.", "description": "The official Spine Runtimes for the web.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
@ -31,6 +31,6 @@
}, },
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-webgl": "4.2.36" "@esotericsoftware/spine-webgl": "4.2.37"
} }
} }

View File

@ -336,7 +336,7 @@ export class SpinePlayer implements Disposable {
this.sceneRenderer = new SceneRenderer(this.canvas, this.context, true); this.sceneRenderer = new SceneRenderer(this.canvas, this.context, true);
if (config.showLoading) this.loadingScreen = new LoadingScreen(this.sceneRenderer); if (config.showLoading) this.loadingScreen = new LoadingScreen(this.sceneRenderer);
} catch (e) { } catch (e) {
this.showError("Sorry, your browser does not support WebG, or you have disabled WebGL in your browser settingsL.\nPlease use the latest version of Firefox, Chrome, Edge, or Safari.", e as any); this.showError("Sorry, your browser does not support WebG, or you have disabled WebGL in your browser settings.\nPlease use the latest version of Firefox, Chrome, Edge, or Safari.", e as any);
return null; return null;
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-threejs", "name": "@esotericsoftware/spine-threejs",
"version": "4.2.36", "version": "4.2.37",
"description": "The official Spine Runtimes for the web.", "description": "The official Spine Runtimes for the web.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
@ -31,6 +31,6 @@
}, },
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.36" "@esotericsoftware/spine-core": "4.2.37"
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@esotericsoftware/spine-webgl", "name": "@esotericsoftware/spine-webgl",
"version": "4.2.36", "version": "4.2.37",
"description": "The official Spine Runtimes for the web.", "description": "The official Spine Runtimes for the web.",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
@ -31,6 +31,6 @@
}, },
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme", "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
"dependencies": { "dependencies": {
"@esotericsoftware/spine-core": "4.2.36" "@esotericsoftware/spine-core": "4.2.37"
} }
} }