From 3ec53ad87b416ea7a591d5aa027b3c0281cd4ca6 Mon Sep 17 00:00:00 2001 From: RestartB <79792966+RestartB@users.noreply.github.com> Date: Sun, 15 Dec 2024 23:21:06 +0000 Subject: [PATCH 1/3] feat: Add video demo app --- pkgs/apps/desktop/icons.js | 1 + pkgs/apps/videodemo.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 pkgs/apps/videodemo.js diff --git a/pkgs/apps/desktop/icons.js b/pkgs/apps/desktop/icons.js index f08c26f..8872344 100644 --- a/pkgs/apps/desktop/icons.js +++ b/pkgs/apps/desktop/icons.js @@ -69,6 +69,7 @@ addDesktopApp('About', 'assets/icons/computer.svg', 'apps:sysver.js'); addDesktopApp('VirtualPC', 'assets/icons/questionmark.svg', 'apps:virtualpc.js'); addDesktopApp('AzuText', 'assets/icons/questionmark.svg', 'apps:azutext.js'); addDesktopApp('AzuTheme', 'assets/icons/questionmark.svg', 'settings:azutheme.js'); +addDesktopApp('Video Demo', 'assets/icons/questionmark.svg', 'apps:videodemo.js'); // addDesktopApp('Settings', 'assets/icons/settings.svg', 'settings/index.html'); // console.log(fetch_directory('~/Desktop')); diff --git a/pkgs/apps/videodemo.js b/pkgs/apps/videodemo.js new file mode 100644 index 0000000..e3eba57 --- /dev/null +++ b/pkgs/apps/videodemo.js @@ -0,0 +1,14 @@ +win.create(`Video Demo - Big Buck Bunny`, "videodemo").then(win => win + .setWidth(700) + .setHeight(500) + .confirm() +); + +element.create('video', ``, "videoelem").then(elm => elm + .window("videodemo") + .textalign('center') + .src('http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_2160p_60fps_normal.mp4') + .css("width: 100%; height: 100%;") + .controls(true) + .autoplay(true) +); \ No newline at end of file From f810826496fd82ac6b1680a260bc921edd47e4c3 Mon Sep 17 00:00:00 2001 From: RestartB <79792966+RestartB@users.noreply.github.com> Date: Sun, 15 Dec 2024 23:22:04 +0000 Subject: [PATCH 2/3] feat: Add autoplay and controls properties to element in SDK, remove good night greeting --- libs/system/sdk.js | 12 +++++++++--- pkgs/system/bootscreen.js | 4 +--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libs/system/sdk.js b/libs/system/sdk.js index 488e04c..18851ff 100644 --- a/libs/system/sdk.js +++ b/libs/system/sdk.js @@ -354,6 +354,14 @@ const element = { } return elementObject; }, + autoplay: (boolean) => { + elm.autoplay = boolean; + return elementObject; + }, + controls: (boolean) => { + elm.controls = boolean; + return elementObject; + }, placeholder: (string) => { elm.placeholder = string return elementObject; @@ -574,10 +582,8 @@ const strings = { greeting = "Good Morning"; } else if (currentHour >= 12 && currentHour < 18) { greeting = "Good Afternoon"; - } else if (currentHour >= 18 && currentHour < 22) { - greeting = "Good Evening"; } else { - greeting = "Good Night"; + greeting = "Good Evening"; } return greeting; } diff --git a/pkgs/system/bootscreen.js b/pkgs/system/bootscreen.js index 0670111..6ebfd39 100644 --- a/pkgs/system/bootscreen.js +++ b/pkgs/system/bootscreen.js @@ -33,10 +33,8 @@ if (__skipBoot === true) { greeting = "Good Morning"; } else if (currentHour >= 12 && currentHour < 18) { greeting = "Good Afternoon"; - } else if (currentHour >= 18 && currentHour < 22) { - greeting = "Good Evening"; } else { - greeting = "Good Night"; + greeting = "Good Evening"; } document.getElementById("welcometextobject").innerHTML = greeting; From f89b75df206645a130aa4af82597d05651641b7c Mon Sep 17 00:00:00 2001 From: RestartB <79792966+RestartB@users.noreply.github.com> Date: Sun, 15 Dec 2024 23:28:09 +0000 Subject: [PATCH 3/3] refactor: remove boolean from autoplay and controls properties --- libs/system/sdk.js | 8 ++++---- pkgs/apps/videodemo.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/system/sdk.js b/libs/system/sdk.js index 18851ff..54da7a6 100644 --- a/libs/system/sdk.js +++ b/libs/system/sdk.js @@ -354,12 +354,12 @@ const element = { } return elementObject; }, - autoplay: (boolean) => { - elm.autoplay = boolean; + autoplay: () => { + elm.autoplay = true; return elementObject; }, - controls: (boolean) => { - elm.controls = boolean; + controls: () => { + elm.controls = true; return elementObject; }, placeholder: (string) => { diff --git a/pkgs/apps/videodemo.js b/pkgs/apps/videodemo.js index e3eba57..2cc1fea 100644 --- a/pkgs/apps/videodemo.js +++ b/pkgs/apps/videodemo.js @@ -9,6 +9,6 @@ element.create('video', ``, "videoelem").then(elm => elm .textalign('center') .src('http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_2160p_60fps_normal.mp4') .css("width: 100%; height: 100%;") - .controls(true) - .autoplay(true) + .controls() + .autoplay() ); \ No newline at end of file