[PROBLEM] Before the update to VSS's player, the WRT.js could
call WRT.hideSplashScreen(...), with one window show
(after 'ready-to-show').
With VSS player reacting to focus steal, now showing
the window will result in premature playback stop.
[SOLUTION] With change in WRT interface in libchromium the
WebApplication can now check, if the reason for
hiding was valid.
Side effect is, if the RENDERED was not a valid reason
to hide a window, the window is not shown at any other
event. The additional show() is therefore added to
LOADFINISHED and CUSTOM (VIDEOFINISHED and CUSTOM's
show() is already in the Chromium patch).
NOTE: part of this change was provided in Chromium project as change
[259340][1]. To have current change compile, you either have to have
chromium RPM with its change, or -- after first unsuccessfull build --
go to your GBS scratch area, into /usr/include/wrt/ and edit the
native_wrtjs.d.ts to have WRT.hideSplashScreen method return `boolean`.
[1]: https://review.tizen.org/gerrit/c/259340
Change-Id: Id63f6b4192cdc9da8da1e4ff0296f11bc15b10b3
Bug-Id: https://cam.sprc.samsung.pl/browse/WPMEDMAIN-2915
Signed-off-by: Marcin Zdun <m.zdun@samsung.com>
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
needShowTimer() { return true; }
onDidFinishLoad() { }
profileName() { return 'common' }
needShowTimer() { return true; }
onDidFinishLoad() { }
profileName() { return 'common' }
} else if (type === 'stopService') {
require('../common/service_manager').stopService(app_id);
event.preventDefault();
} else if (type === 'stopService') {
require('../common/service_manager').stopService(app_id);
event.preventDefault();
+ } else if (type === 'hideSplashScreen') {
+ this.webApplication?.hideSplashScreen(params[0]);
}
private handlePreloadState(launchMode: string) {
}
private handlePreloadState(launchMode: string) {
- if (this.preloadStatus === 'preload') {
- this.show();
- } else {
- if (launchMode != 'backgroundAtStartup')
- this.preloadStatus = 'none';
- }
+ if (this.preloadStatus === 'preload' || launchMode != 'backgroundAtStartup')
+ this.preloadStatus = 'none';
}
backgroundExecutable() {
}
backgroundExecutable() {
- show() {
- this.preloadStatus = 'none';
- }
-
canIgnoreSuspend() {
if (this.launchMode == 'runningAsForeground' ||
this.launchMode == 'runningAsBackground') {
canIgnoreSuspend() {
if (this.launchMode == 'runningAsForeground' ||
this.launchMode == 'runningAsBackground') {
windowList: Electron.BrowserWindow[] = [];
inQuit: boolean = false;
profileDelegate: WebApplicationDelegate;
windowList: Electron.BrowserWindow[] = [];
inQuit: boolean = false;
profileDelegate: WebApplicationDelegate;
+ splashShown: boolean = false;
constructor(options: RuntimeOption) {
if (wrt.tv) {
constructor(options: RuntimeOption) {
if (wrt.tv) {
+ hideSplashScreen(reason: string) {
+ switch (reason) {
+ case 'first-paint': {
+ if (wrt.hideSplashScreen(0) !== false)
+ this.show();
+ break;
+ }
+ case 'complete': {
+ if (wrt.hideSplashScreen(1) !== false)
+ this.show();
+ break;
+ }
+ case 'custom': {
+ if (wrt.hideSplashScreen(2) !== false)
+ this.show();
+ break;
+ }
+ case 'video-finished': {
+ this.show();
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
private setupMainWindowEventListener() {
this.mainWindow.once('ready-to-show', () => {
console.log('mainWindow ready-to-show');
if (this.showTimer)
clearTimeout(this.showTimer);
private setupMainWindowEventListener() {
this.mainWindow.once('ready-to-show', () => {
console.log('mainWindow ready-to-show');
if (this.showTimer)
clearTimeout(this.showTimer);
- wrt.hideSplashScreen(0);
- if (this.profileDelegate.isPreloading())
- return;
- this.show();
+
+ if (this.splashShown)
+ this.hideSplashScreen('first-paint');
+ else
+ this.show();
});
this.mainWindow.webContents.on('did-start-loading', () => {
});
this.mainWindow.webContents.on('did-start-loading', () => {
this.mainWindow.webContents.on('did-finish-load', () => {
console.log('webContents did-finish-load');
this.loadFinished = true;
this.mainWindow.webContents.on('did-finish-load', () => {
console.log('webContents did-finish-load');
this.loadFinished = true;
- wrt.hideSplashScreen(1);
+ if (this.splashShown)
+ this.hideSplashScreen('complete');
+
addonManager.emit('contentDidFinishLoad', this.mainWindow.id);
if (wrt.isIMEWebApp()) {
this.activateIMEWebHelperClient();
addonManager.emit('contentDidFinishLoad', this.mainWindow.id);
if (wrt.isIMEWebApp()) {
this.activateIMEWebHelperClient();
if (this.profileDelegate.isPreloading())
return;
if (this.profileDelegate.isPreloading())
return;
- let splashShown = wrt.showSplashScreen();
- if (splashShown || !this.profileDelegate.needShowTimer())
+ this.splashShown = wrt.showSplashScreen();
+ if (this.splashShown || !this.profileDelegate.needShowTimer())
return;
this.showTimer = setTimeout(() => {
return;
this.showTimer = setTimeout(() => {
+ if (this.profileDelegate.isPreloading()) {
+ return;
+ }
console.log('WebApplication : show');
if (this.profileDelegate.backgroundExecutable()) {
console.log('skip showing while backgroundExecution mode');
console.log('WebApplication : show');
if (this.profileDelegate.backgroundExecutable()) {
console.log('skip showing while backgroundExecution mode');
this.windowList[this.windowList.length - 1].moveTop();
}
}
this.windowList[this.windowList.length - 1].moveTop();
}
}
- this.profileDelegate.show();
}
private closeWindows() {
}
private closeWindows() {