Skip to content

Commit 6d23940

Browse files
Merge pull request #288 from rdkcentral/dev
Dev
2 parents 805784b + d0c2dfe commit 6d23940

File tree

6 files changed

+31
-8
lines changed

6 files changed

+31
-8
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## v4.8.1
4+
5+
*13 dec 2021*
6+
7+
- Fixed auto detect 720p resolution
8+
9+
310
## v4.8.0
411

512
*7 dec 2021*

docs/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## v4.8.1
4+
5+
*13 dec 2021*
6+
7+
- Fixed auto detect 720p resolution
8+
39
## v4.8.0
410

511
*7 dec 2021*

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lightningjs/sdk",
3-
"version": "4.8.0",
3+
"version": "4.8.1",
44
"license": "Apache-2.0",
55
"scripts": {
66
"postinstall": "node ./scripts/postinstall.js",

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lightningjs/sdk",
3-
"version": "4.8.0",
3+
"version": "4.8.1",
44
"license": "Apache-2.0",
55
"scripts": {
66
"postinstall": "node ./scripts/postinstall.js",

src/Application/index.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,26 @@ const fontLoader = (fonts, store) =>
8181
})
8282

8383
export default function(App, appData, platformSettings) {
84-
defaultOptions.stage['w'] = platformSettings.width ? platformSettings.width : 1920
85-
defaultOptions.stage['h'] = platformSettings.height ? platformSettings.height : 1080
86-
defaultOptions.stage['precision'] =
87-
(platformSettings.width ? platformSettings.width : 1920) / 1920
84+
const { width, height } = platformSettings
85+
86+
if (width && height) {
87+
defaultOptions.stage['w'] = width
88+
defaultOptions.stage['h'] = height
89+
defaultOptions.stage['precision'] = width / 1920
90+
}
91+
92+
// support for 720p browser
93+
if (!width && !height && window.innerHeight === 720) {
94+
defaultOptions.stage['w'] = 1280
95+
defaultOptions.stage['h'] = 720
96+
defaultOptions.stage['precision'] = 1280 / 1920
97+
}
8898

8999
return class Application extends Lightning.Application {
90100
constructor(options) {
91101
const config = Deepmerge(defaultOptions, options)
92102
// Deepmerge breaks HTMLCanvasElement, so restore the passed in canvas.
93-
if(options.stage.canvas) {
103+
if (options.stage.canvas) {
94104
config.stage.canvas = options.stage.canvas
95105
}
96106
super(config)

0 commit comments

Comments
 (0)