_)>({RO$EGV-8}p`cfDR;mHIR`klNU?C-7T>N?u}&Z~n_2OW4})z^r`Q
z(AA8;~LO^oO{;wfix%;qT)Z&Ep7WEl>}S!AjuTMIdJ)GdHB
z(s{hQX{Wxb7U+&jPH@6TEnI)7co;A&M5ei6FFka#`P5h4Q=!5z^Qjl4pVNDEe91-a
zsq(IR-A5GUj1m8h)ibO}_8~!-x5O)D_LbcTa)CqjlUo>Um!OGQG=8nxT)wZ;ii-|*
zyxG95>wTwppzhP2%545c*6EOOxgywN~;6k%MojzQiSo2
zqAaN^+A1LPvL|c{84iW<5M8sYP$#Ch^^m9$=b67OO(bWsIqdP{1~1zpcLpdDX^-E^
z(&AE4D=KaFa=*_JSs3h)ppE2Sn)D8G*lMmyq~%6~bOClOG_!Y0@L$I#XPYQW5@O`1
ze|LDU@-OiJeRy&QZ&Ds%L=VQ?=ec^_+A$K(r}F8HT+gDEJ9VO{^j^%)C4z@>h=IN>
znG*dmMrzBC*IL!EjSzJ81cCbsx5M4Dk!fA5r{ZPBKxq`j-`#UEqPi(bMOENFDj$z6
zMzF8VzG)iB@DL;aI(4K6E`(mONJ^a{SOYh-c$aT6@zNh09Br%jd=SWW4AVwY-dR@Ajdg|*)k|tvv*HKfZKZBuHGgx0m`Mk!}G-GVJlhEU=
z_8hdcfuou`)p}Fw)4GcFr{j80Jds`KyrM_5UM!ujQmFiLl@5kluX3r#7j4VvHCu_8
ziwWDWPI`LR8%Ci0H2a~@Dr&zx2)ITBDLk`tvFzdZ6CW?7dh
zw$u|tq!qSvsmK-eCH0!g=R_<1pdjByMrMk%D<|P5=6Sk?Zihr&-)-kO(%LEHU(oVC
zFwHfD0+_bev|ExR#@+nwM!`Ov2cPRal^~oyy3k8b0I#9sIPbKJE{f^3FksPI$
z^K&VKb~j+XfbFJ-AW?tj#dn)n?hs;zPCfV70{f~LqYw2vKEiPwE8p_##-R1yLBt|U6*Jez`uoE%_$zGooD6n{<)PH#K_n_N&$64}l2<5dU*I;?HDq*s
z>IvFL$&m-_YjW{7412Z1l5Z2Sn3IC7@T5M-(6b~7#cE#a+XS*3kUvT=3
zAQv^zaWtvj$g;wJR;&sFWqVQS@UIQAhrXS2(Svbblf4C(m0kc-;6Xh^NowsrTCsBGy988Pjh5
zc*4ATCg);L6~Botp08*8p0Ow5*{s=^+M2SABTs
zlc&^jwt^p*Npvs9+?7${XLu!&`zxAQ@x8Pvr&x&Vs0`CTl%ez3$_qLYqxYs|T*1e;~SN6Co&iXo^4JuU$Xtrln{EXV~Xd}w@SE0%v-@g^N2
zjHE$N-tI?xg;C*{J3;bTV+TK(2`&z`N8Mzb*KsFWa1g+=r{zerECW
zD!C|Sr|PR(#B0ez+j2jlOTN;Y`P?`5T=~XArSWCU7gpSMw?AHSQJSw7GghV&ehhvs
z*#3@y-vj2ACZ4d@nTJye+v;lUnv%Fq!W2(G!~oe26ojb2ac|gNc!UwTCXMHFvgko~
zoBjwO6sEd!B`tDen@drO?95RyT~Su$it6#}^+
zNmJ^b!K`yLvud3Ik+7LVb7h#eCgipW2ad|xLY>M
zVs#QU=+?^wQOUY?tfO1v!L{=FmKF(`32aOhm5fn5Y0f9KdR2pz6;zD9!1|rYYc9&s
zU7-sX6*#Y~!!_lFbr4DaHFnb|Z9lM$9
zvK|}(y>FrRqAbl)E1IzV7WPT2@~-*a=hFeQw8@-qBuR03ig3`NbBetShR=;EJ+$ID
zzF|%0FEc}mw6?H6vw``6&$Ag6F>=lBK-
z$O%q%Tg@ef!Xkiw0Sv2zs3pOP+w5c9pRQN`8M|2LxoQLbi&waZ8p{+i8ojbqocb0L
zEyhSs3z9`q2a0ne;ozZ;XjG>ARHTZG0_S_Y9<2uk`Q{*!(%>;xA^RrxCq#X()*mWd
zUQ3DfwMb60(f`SKs5)_!WOGERkukdh#}bO!qYUjP6o+)agLrC&H#0UsKdq$spZw#KSBdXCrlER1}P$Y{U4|5h{-ge9x6pq&xOwG6h5O^FRZ?H1-
zyBuP4-ejtjnow%Xw;jG%3x7k)Dw=L@9SkG<(q4obTmk9kIG>8Z)?@F>ZXc28d&$7tDx$(
z5d^S46DYfjI{eyqxNTE#o^6uIwEb^+aD8zYth`|!1QTxv6osO`&rZeCHqY7TtwP!Y
z|1HBBH2#xe|2-k+{bxch_D0BCtqSfO`q(C-U_M*+gEI{8fcqw92^5v0*`$--+Ej#O
zmp+?ksIovIvuUk*Yh4A`Y0dl}*~YL6sQex}cZY~+Q+BZIrAAWS_L-XaC>M=~3}5b7
z2N&Mda8c=wqne}KIY9~sXRBIP#)<#6O4(EdtCWm?suV7&Eq1`LbAACeaPTB7f10KP9t1d2}4
zvBnDzuMd1RC%4>^gpEIk3Bv2FqThLCUH@{=T&N}So;u)jvqbnK^AsJ`P8iUYvu_QW
ztcR!w-5fEA%)13E$`cBb{?p5D=KogvMgObz^R%N$NsbJ&uelG~sC@dm&{j?bZ|Olu
zQ)Hftv)T!ZZ|B}`Z^?ZNQIl(1S=M+-TH555qd6$~eqT$$Aqe(76kQ7o(zEHkX8sK|
zcg3_@gs&1YQuFT2ov|}d+1GM5D)6p+UFayJg6&FcZR}|0B|V%N7J>~mnHk#S!qJq193mFB2n_5%rG{r0LCMPL!2n9s>cmH018`%A;0Pnt!avOB?
zz|lULKUc62c-B?t-zxjqe^vIh6fh^)3WIf3+kc|w?CS~5_ls0;C0`-)cs@(X*E5d2JiF_?a=LCUdsNp{$%lv#
zY!iDY4ypq`b|yhs$jSu@2d6KOU^P|y;Y+wWfd~~mWPKnc3t3e?_|D5!peZh_@9gr@
zT}3_2t2^o#eurFoFuR834KKKhyX+&_>-JA)v4O?JKXu#wfZuhT1zn#3_#e%}L!bs?
zd}q1dIYtb{ws#|%u)s~w;X_)QDVblMDuHF{{0oSE%_0zUe=lWPPid79THRBkLt;m$
zDJK`1nqzz8u^@eh-sP`1;7vSZVa}p)e9h2wB4J@0N@{6@up_Y>3A$IKw)@hcT|`0v
zVP7L9v!+A^Eb|2(V?@#-2(r*L)3b<3@|`R=lB}@S3Knu9yM8u>f|JcvUiqV>K+%(#C2&Nw*j5NZims)miQaSQ
zucxeo6VETtk5o0_mem2qayh#y1L1{SW#@{+U<%<)Hmnv@h9Jm#
zh*cU^)dpz=Eet};4`yB@6CUPcpL8LhWo69Km}$0Ko9!fv*%9(w$>NpAKNj(ohwwI~
zI_KAUxu5T&aWwoVI}f^VAtX4fWdjP}3OX2J@-Az-SmaYuTtDB?*8&Y00mRTr?a?|4
zxT>jG=p)nC2XUEqz7T>^;G8-7ryjQ2;B^?rJ8y|L{&r>Lrm?a!+7c6Hdv>`b>BBX2
zv{=M^9T~kcy8l4&;k@Z0sM_4c|um
zT>Go}i-CHbn|7^oZ)eK+Vu5md3WzU{T;90Os?tgA>4E|9wnlSHH${QqO3@0|50o(3vL{Wg7xF
zg;$S!!G7?C{yDXeCCe8Yw|I!v$Icusv0_PJlo5Bq@cvEDQmPf_dkY_XIZeo%7jD^w
zmN`eXy54+<{<*twIry=(i5#J+D|Al2wYpH6{3g>VxCmv!2p=t=+wd;p|
z^1a+;6DJKX-4cn29j+uCW8kp56CHGwm+-xuEs+uWEd=oa2Q{GB47=z<923$VkY~A3
zxn2FN`J18t)V!Aj+@XXHQus=jPUN7i`j|X_w{KO9YgYjPrKqfxI(?+M3
zb!tS~c>e(83i?3=Eb3=}{KFO8Ur?B+g}XbAD-S0DlXb}G`xOm(05sJJQhxI{@M=92
z+Qd3FduFNvm--3umzFZ-YC6O!bD8b9t&iV;(n~c*$nnV7-@-lqNrwc;ek>Gf_Izb8
zON(nGQoyYR-ie#g9a|jdgv`}`GFo5q>j`a3@PXD3xRjR$I69`l!eF0myvvFIG`*QO
zWW~WI4xvjGCkM1Bz{mCuT$b9h3@q3k0!23hO7dG)j2B1MdK7oF_V5HaOFx#jM3S
zn;KsbIR_boY8@VUF#iWzH0O;yfkG<^6VGu&rzxO!o@ZhXHl5|w-UIdEyi))N9$AII
zIg+n1{|q{_x?u-Vkb3(cn#%eV!46Vn!P>bvy|{f4w7$3n8KujnIDs=j1r>7}KLzPx
z@3Flj_pGlju0{C5|Q=qMo?OTS(xDdN9Ai{Ib-DPwyn0gcbp}5oO;t8m?Z?X-8o*`y(uwMIhW?PgsyM-r#v{Ek3$wsjTZ?4pMonBA76w1RUX)EJq&*~6%d_0Mb{(c4hyAz5~<8c`UC^NEz*6;Wfb+(peO$exmq_I2nVt9hitt%{TY|bNww0(I5
z0S(+Not(LCFQ$ul;NA@ng8#x5t05iVDcn`Ufk$z2y!SJb)xt-YhpaOE_JRtApYElH
z;6&~V$kIOQLBohQ-{Jf;q=aYA5SGzu5u%K-@SpuevjVug@VRKOHw6Bbg5_lO-S`;g
z1|dlt+PH;}unV8UoF})SlXD)dY}~Q-d6fx0G34nN7rt$S)Fe^;xD(IMqt?Ns)|=n?
z`UJ#{KfJXeq#~hwg{uFTgs02S??gL3lRi_ZvA9HP2rAaRB0xrGgSonp`Cfdr&!rNA
zFRp~KKln2+%?!mEO;jZxN!R2uq
zwjBfhbiov{-rKb~D2%bi*gSF?P1~}3kR1@Q5*;i+tCA-&kXh?fxm&drx`Ye(jpgcJ
z@P*Eg{^t)P>?huO|1bXWhg{7n`KhW#>1l=YpW#nwWc&jaTxqAcc(YN=T4)X!8ywSre9->N
F{{bXlme2qI
literal 0
HcmV?d00001
diff --git a/components/keyboardcomponent/keyboardComponent.brs b/components/keyboardcomponent/keyboardComponent.brs
new file mode 100644
index 0000000..3fddb22
--- /dev/null
+++ b/components/keyboardcomponent/keyboardComponent.brs
@@ -0,0 +1,73 @@
+sub init()
+ m.keyboardController = m.top.findNode("keyboardController")
+ initButtons()
+ m.focusIdx = 0
+ m.Col1.setFocus(true)
+ initObservers()
+end sub
+
+sub initButtons()
+ m.Col1 = m.top.findNode("Col1")
+ m.Col2 = m.top.findNode("Col2")
+ m.Col3 = m.top.findNode("Col3")
+ m.Col4 = m.top.findNode("Col4")
+ m.Col5 = m.top.findNode("Col5")
+ m.Col6 = m.top.findNode("Col6")
+ m.Col7 = m.top.findNode("Col7")
+ m.Col8 = m.top.findNode("Col8")
+ m.Col9 = m.top.findNode("Col9")
+ m.textBox = m.top.findNode("textBox")
+ m.Col1.buttons = ["A", "J", "S", "1"]
+ m.Col2.buttons = ["B", "K", "T", "2"]
+ m.Col3.buttons = ["C", "L", "U", "3"]
+ m.Col4.buttons = ["D", "M", "V", "4"]
+ m.Col5.buttons = ["E", "N", "W", "5"]
+ m.Col6.buttons = ["F", "O", "X", "6"]
+ m.Col7.buttons = ["G", "P", "Y", "7"]
+ m.Col8.buttons = ["H", "Q", "Z", "8"]
+ m.Col9.buttons = ["I", "R", "0", "9"]
+end sub
+
+sub handleItemSelected(event)
+ ?event.getData()
+end sub
+
+sub initObservers()
+ m.Col1.observeField("buttonSelected", "handleItemFocus")
+ m.Col2.observeField("buttonSelected", "handleItemFocus")
+ m.Col3.observeField("buttonSelected", "handleItemFocus")
+ m.Col4.observeField("buttonSelected", "handleItemFocus")
+ m.Col5.observeField("buttonSelected", "handleItemFocus")
+ m.Col6.observeField("buttonSelected", "handleItemFocus")
+ m.Col7.observeField("buttonSelected", "handleItemFocus")
+ m.Col8.observeField("buttonSelected", "handleItemFocus")
+ m.Col9.observeField("buttonSelected", "handleItemFocus")
+end sub
+
+sub handleItemFocus(event)
+ text = event.getRoSGNode().getChild(event.getData()).text
+ if text = " SPACE "
+ m.textBox.text += " "
+ else if text = "DELETE"
+ m.textBox.text = ""
+ else
+ m.textBox.text += text
+ end if
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and m.focusIdx < 8
+ rowIdx = m.keyboardController.getChild(m.focusIdx).buttonFocused
+ m.focusIdx++
+ m.keyboardController.getChild(m.focusIdx).focusButton = rowIdx
+ return true
+ else if key = "left" and m.focusIdx > 0
+ rowIdx = m.keyboardController.getChild(m.focusIdx).buttonFocused
+ m.focusIdx--
+ m.keyboardController.getChild(m.focusIdx).focusButton = rowIdx
+ return true
+ end if
+ end if
+ return false
+end function
\ No newline at end of file
diff --git a/components/keyboardcomponent/keyboardComponent.xml b/components/keyboardcomponent/keyboardComponent.xml
new file mode 100644
index 0000000..313d60d
--- /dev/null
+++ b/components/keyboardcomponent/keyboardComponent.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From f14419f6d2dca06926d5d6a9354a382a3b72a613 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Tue, 28 Sep 2021 13:06:50 +0200
Subject: [PATCH 09/22] Made the custom keyboard
---
components/keyboardScene.brs | 34 ++----
components/keyboardScene.xml | 10 +-
.../icons/backspace-pngrepo-com.png | Bin 9360 -> 0 bytes
.../icons/backspaceblack.png | Bin 0 -> 501 bytes
.../icons/backspacewhite.png | Bin 0 -> 765 bytes
.../keyboardcomponent/keyboardComponent.brs | 113 ++++++++++++------
.../keyboardcomponent/keyboardComponent.xml | 27 +++--
7 files changed, 107 insertions(+), 77 deletions(-)
delete mode 100644 components/keyboardcomponent/icons/backspace-pngrepo-com.png
create mode 100644 components/keyboardcomponent/icons/backspaceblack.png
create mode 100644 components/keyboardcomponent/icons/backspacewhite.png
diff --git a/components/keyboardScene.brs b/components/keyboardScene.brs
index e4057e5..589cd92 100644
--- a/components/keyboardScene.brs
+++ b/components/keyboardScene.brs
@@ -1,11 +1,12 @@
sub init()
- ' m.keyboard = m.top.findNode("keyboard")
- ' m.itemsList = m.top.findNode("searchList")
- ' m.heading = m.top.findNode("heading")
- ' m.keyboard.setFocus(true)
- ' m.keyboard.textEditBox.observeField("text", "handleText")
- ' m.http = createObject("roSGNode", "httpTask")
- ' m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
end sub
sub handleText()
@@ -18,7 +19,7 @@ sub useResponse()
items = []
m.itemsList.numColumns = 3
for each item in m.http.response.body
- if item.login.inStr(m.keyboard.textEditBox.text) <> -1
+ if item.login.inStr(Lcase(m.keyboard.textBox.text)) <> -1
Content = itemsThatContainString.createChild("ContentNode")
Content.HDPosterUrl = item.avatar_url
items.push(item)
@@ -30,7 +31,7 @@ sub useResponse()
m.itemsList.numColumns = 1
end if
' handle empty text box
- if m.keyboard.textEditBox.text = ""
+ if m.keyboard.textBox.text = ""
m.itemsList.content = invalid
m.heading.visible = false
else
@@ -41,18 +42,5 @@ sub useResponse()
end sub
sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textEditBox.text + Chr(34)
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
end sub
-
-' function onKeyEvent(key as String, press as Boolean) as Boolean
-' if press
-' if key = "right" and not m.itemsList.hasFocus()
-' m.itemsList.setFocus(true)
-' return true
-' else if key = "left" and not m.keyboard.hasFocus()
-' m.keyboard.setFocus(true)
-' return true
-' end if
-' end if
-' return false
-' end function
\ No newline at end of file
diff --git a/components/keyboardScene.xml b/components/keyboardScene.xml
index c24e900..cb597b5 100644
--- a/components/keyboardScene.xml
+++ b/components/keyboardScene.xml
@@ -1,15 +1,11 @@
-
-
-
-
-
-
-
+
+
+
\ No newline at end of file
diff --git a/components/keyboardcomponent/icons/backspace-pngrepo-com.png b/components/keyboardcomponent/icons/backspace-pngrepo-com.png
deleted file mode 100644
index 5d469c2a544d051422ec3f5a6602ba88aa4ce11d..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 9360
zcmdUVc{r5c-~YL1hLIR;QjF{=Wh=7A6hb8;mB>@2iWqx##_!xcpYQW~e&6SMuIu;j<8obd&$-WgIp@63dB4x=HGi5NGvwzL
z<^=%o8yo4H13-X}1i-@$KYj(aEy53y%K?)E06d9ayX?RPzl)zYGB*JrXgdJt9{}K8
z&>;Z)l>ivF2S76k03mv6#c^%;g8SSNLw)!O{}%Kr!vK&{H`YIJBJk5_@1>_sPL~EJ
z$6r_)9OtWf@Ew&5S81?6s>&nNuzSxAJ@Fk^4sIgbbY=Oem?RvcY9_CXxF)E4Vfp{@?p={?{EgI9$Tl#nt6~HlKUj+6z&g*QDbIY*{B+nk;Kfh#AK11v+j{
z3oT0a>+Z$ExNW($6}A47b~`tSBocI~-*qp7p~TnBD&(XyIad1W5}9>@Rrz|kkpfl<
z*G?R;FJOzuJ!n2lcupwyy&G1KWQIIa?h=lZo@vy;fbkQvbtWl5oo-DHj(gU8tX{YgX&(dBB5(`}}R
z8_V^rMSH6aL4F`1eEg3DX*cBzZb|^i>fggHHaRg8B4hmeQ~exh8y8^SFV-`P%b8jm
z0ETDPSz#_vdwVUCX?p|}1JTVCN#mU83_@1t5ueFK>8N^9RCAQiCIfd#5lZZRU7_d`
zBkg8G0W+6$3Jq~jdV@)3iH1Zq+|TwFQ8efsIOPnVORAB~ZL&mW&Q&0Ob-<_6mijA@aHAySb~}hIYxRW
z9CkTPw7CVx(I!9vPN$J&IouUp*yUQM6W-;97Fak*?5~4MGAu+!ZBjr0a-=xiC~mRF
z5Ip1X2!$D&69T{#dyP#BuEvxCG!h89P7}UWandGfJuMo|5A$nQmn;)<}z!{k``F8CW=qPeP582
zF3PNWM_E6_%le2nee(fHH@C9FyCtr?P|-rA-GV9LqmS^!8}>TpO~k7adMunlq|KF*
z`%<8yS~MD;ev`LI=H)~eGSBQX8^k@R*8qMaR+vSx9!adF30Hf|7YsGaagX2juF)lg
zrNJ?6dW~di$?u;dt7||rJ8u$cYB!Oa4bT%m)?0ki)hS@IluHM9w+x-bL#O5g!{e3k*Ahz9s;On@oaEkW47wOkf@=vF}mhl;g4L)ha7Sx0b79|wWb
za~aG93N78o=a)(WuP<+%n1E|S;T~&%YtrxqD5cgCyc?k@bJjF2b%_c#tF5(36P4_0
zEG8PoUDN=($N22a@P#CW#=<4I4M*vq1z_y2AChBj#Dx~9V4oNFd=GnFwQZazE$#$2
z8I95s?9$TG&-}*Bz*ix@8nF+J27MWD24$H7_$0@_hE0i1WFE#DI3{x|D%i%>XT?BE
z>BQyT_^j`y0D)g-EN?i33hr`kyh$5x8e@a%^myFRb~4(pDXhK^8WIBVoPmec#}909
zwJW*w<=C7ScDY#ZSKVROaqJjhsFJ%cOAYhHOi>Y3gn79*Jg3u{8KE?PrC1cT#CTa=
zENAY{pZr)pw$knJx7#zm(>-RRw|iUPHi1fF0eQ?}etOE2<;Oj)8vD?}f~CYdeCRU&
zvva*+W!g(X?icS=C+d(pN0C{T*6*_)>({RO$EGV-8}p`cfDR;mHIR`klNU?C-7T>N?u}&Z~n_2OW4})z^r`Q
z(AA8;~LO^oO{;wfix%;qT)Z&Ep7WEl>}S!AjuTMIdJ)GdHB
z(s{hQX{Wxb7U+&jPH@6TEnI)7co;A&M5ei6FFka#`P5h4Q=!5z^Qjl4pVNDEe91-a
zsq(IR-A5GUj1m8h)ibO}_8~!-x5O)D_LbcTa)CqjlUo>Um!OGQG=8nxT)wZ;ii-|*
zyxG95>wTwppzhP2%545c*6EOOxgywN~;6k%MojzQiSo2
zqAaN^+A1LPvL|c{84iW<5M8sYP$#Ch^^m9$=b67OO(bWsIqdP{1~1zpcLpdDX^-E^
z(&AE4D=KaFa=*_JSs3h)ppE2Sn)D8G*lMmyq~%6~bOClOG_!Y0@L$I#XPYQW5@O`1
ze|LDU@-OiJeRy&QZ&Ds%L=VQ?=ec^_+A$K(r}F8HT+gDEJ9VO{^j^%)C4z@>h=IN>
znG*dmMrzBC*IL!EjSzJ81cCbsx5M4Dk!fA5r{ZPBKxq`j-`#UEqPi(bMOENFDj$z6
zMzF8VzG)iB@DL;aI(4K6E`(mONJ^a{SOYh-c$aT6@zNh09Br%jd=SWW4AVwY-dR@Ajdg|*)k|tvv*HKfZKZBuHGgx0m`Mk!}G-GVJlhEU=
z_8hdcfuou`)p}Fw)4GcFr{j80Jds`KyrM_5UM!ujQmFiLl@5kluX3r#7j4VvHCu_8
ziwWDWPI`LR8%Ci0H2a~@Dr&zx2)ITBDLk`tvFzdZ6CW?7dh
zw$u|tq!qSvsmK-eCH0!g=R_<1pdjByMrMk%D<|P5=6Sk?Zihr&-)-kO(%LEHU(oVC
zFwHfD0+_bev|ExR#@+nwM!`Ov2cPRal^~oyy3k8b0I#9sIPbKJE{f^3FksPI$
z^K&VKb~j+XfbFJ-AW?tj#dn)n?hs;zPCfV70{f~LqYw2vKEiPwE8p_##-R1yLBt|U6*Jez`uoE%_$zGooD6n{<)PH#K_n_N&$64}l2<5dU*I;?HDq*s
z>IvFL$&m-_YjW{7412Z1l5Z2Sn3IC7@T5M-(6b~7#cE#a+XS*3kUvT=3
zAQv^zaWtvj$g;wJR;&sFWqVQS@UIQAhrXS2(Svbblf4C(m0kc-;6Xh^NowsrTCsBGy988Pjh5
zc*4ATCg);L6~Botp08*8p0Ow5*{s=^+M2SABTs
zlc&^jwt^p*Npvs9+?7${XLu!&`zxAQ@x8Pvr&x&Vs0`CTl%ez3$_qLYqxYs|T*1e;~SN6Co&iXo^4JuU$Xtrln{EXV~Xd}w@SE0%v-@g^N2
zjHE$N-tI?xg;C*{J3;bTV+TK(2`&z`N8Mzb*KsFWa1g+=r{zerECW
zD!C|Sr|PR(#B0ez+j2jlOTN;Y`P?`5T=~XArSWCU7gpSMw?AHSQJSw7GghV&ehhvs
z*#3@y-vj2ACZ4d@nTJye+v;lUnv%Fq!W2(G!~oe26ojb2ac|gNc!UwTCXMHFvgko~
zoBjwO6sEd!B`tDen@drO?95RyT~Su$it6#}^+
zNmJ^b!K`yLvud3Ik+7LVb7h#eCgipW2ad|xLY>M
zVs#QU=+?^wQOUY?tfO1v!L{=FmKF(`32aOhm5fn5Y0f9KdR2pz6;zD9!1|rYYc9&s
zU7-sX6*#Y~!!_lFbr4DaHFnb|Z9lM$9
zvK|}(y>FrRqAbl)E1IzV7WPT2@~-*a=hFeQw8@-qBuR03ig3`NbBetShR=;EJ+$ID
zzF|%0FEc}mw6?H6vw``6&$Ag6F>=lBK-
z$O%q%Tg@ef!Xkiw0Sv2zs3pOP+w5c9pRQN`8M|2LxoQLbi&waZ8p{+i8ojbqocb0L
zEyhSs3z9`q2a0ne;ozZ;XjG>ARHTZG0_S_Y9<2uk`Q{*!(%>;xA^RrxCq#X()*mWd
zUQ3DfwMb60(f`SKs5)_!WOGERkukdh#}bO!qYUjP6o+)agLrC&H#0UsKdq$spZw#KSBdXCrlER1}P$Y{U4|5h{-ge9x6pq&xOwG6h5O^FRZ?H1-
zyBuP4-ejtjnow%Xw;jG%3x7k)Dw=L@9SkG<(q4obTmk9kIG>8Z)?@F>ZXc28d&$7tDx$(
z5d^S46DYfjI{eyqxNTE#o^6uIwEb^+aD8zYth`|!1QTxv6osO`&rZeCHqY7TtwP!Y
z|1HBBH2#xe|2-k+{bxch_D0BCtqSfO`q(C-U_M*+gEI{8fcqw92^5v0*`$--+Ej#O
zmp+?ksIovIvuUk*Yh4A`Y0dl}*~YL6sQex}cZY~+Q+BZIrAAWS_L-XaC>M=~3}5b7
z2N&Mda8c=wqne}KIY9~sXRBIP#)<#6O4(EdtCWm?suV7&Eq1`LbAACeaPTB7f10KP9t1d2}4
zvBnDzuMd1RC%4>^gpEIk3Bv2FqThLCUH@{=T&N}So;u)jvqbnK^AsJ`P8iUYvu_QW
ztcR!w-5fEA%)13E$`cBb{?p5D=KogvMgObz^R%N$NsbJ&uelG~sC@dm&{j?bZ|Olu
zQ)Hftv)T!ZZ|B}`Z^?ZNQIl(1S=M+-TH555qd6$~eqT$$Aqe(76kQ7o(zEHkX8sK|
zcg3_@gs&1YQuFT2ov|}d+1GM5D)6p+UFayJg6&FcZR}|0B|V%N7J>~mnHk#S!qJq193mFB2n_5%rG{r0LCMPL!2n9s>cmH018`%A;0Pnt!avOB?
zz|lULKUc62c-B?t-zxjqe^vIh6fh^)3WIf3+kc|w?CS~5_ls0;C0`-)cs@(X*E5d2JiF_?a=LCUdsNp{$%lv#
zY!iDY4ypq`b|yhs$jSu@2d6KOU^P|y;Y+wWfd~~mWPKnc3t3e?_|D5!peZh_@9gr@
zT}3_2t2^o#eurFoFuR834KKKhyX+&_>-JA)v4O?JKXu#wfZuhT1zn#3_#e%}L!bs?
zd}q1dIYtb{ws#|%u)s~w;X_)QDVblMDuHF{{0oSE%_0zUe=lWPPid79THRBkLt;m$
zDJK`1nqzz8u^@eh-sP`1;7vSZVa}p)e9h2wB4J@0N@{6@up_Y>3A$IKw)@hcT|`0v
zVP7L9v!+A^Eb|2(V?@#-2(r*L)3b<3@|`R=lB}@S3Knu9yM8u>f|JcvUiqV>K+%(#C2&Nw*j5NZims)miQaSQ
zucxeo6VETtk5o0_mem2qayh#y1L1{SW#@{+U<%<)Hmnv@h9Jm#
zh*cU^)dpz=Eet};4`yB@6CUPcpL8LhWo69Km}$0Ko9!fv*%9(w$>NpAKNj(ohwwI~
zI_KAUxu5T&aWwoVI}f^VAtX4fWdjP}3OX2J@-Az-SmaYuTtDB?*8&Y00mRTr?a?|4
zxT>jG=p)nC2XUEqz7T>^;G8-7ryjQ2;B^?rJ8y|L{&r>Lrm?a!+7c6Hdv>`b>BBX2
zv{=M^9T~kcy8l4&;k@Z0sM_4c|um
zT>Go}i-CHbn|7^oZ)eK+Vu5md3WzU{T;90Os?tgA>4E|9wnlSHH${QqO3@0|50o(3vL{Wg7xF
zg;$S!!G7?C{yDXeCCe8Yw|I!v$Icusv0_PJlo5Bq@cvEDQmPf_dkY_XIZeo%7jD^w
zmN`eXy54+<{<*twIry=(i5#J+D|Al2wYpH6{3g>VxCmv!2p=t=+wd;p|
z^1a+;6DJKX-4cn29j+uCW8kp56CHGwm+-xuEs+uWEd=oa2Q{GB47=z<923$VkY~A3
zxn2FN`J18t)V!Aj+@XXHQus=jPUN7i`j|X_w{KO9YgYjPrKqfxI(?+M3
zb!tS~c>e(83i?3=Eb3=}{KFO8Ur?B+g}XbAD-S0DlXb}G`xOm(05sJJQhxI{@M=92
z+Qd3FduFNvm--3umzFZ-YC6O!bD8b9t&iV;(n~c*$nnV7-@-lqNrwc;ek>Gf_Izb8
zON(nGQoyYR-ie#g9a|jdgv`}`GFo5q>j`a3@PXD3xRjR$I69`l!eF0myvvFIG`*QO
zWW~WI4xvjGCkM1Bz{mCuT$b9h3@q3k0!23hO7dG)j2B1MdK7oF_V5HaOFx#jM3S
zn;KsbIR_boY8@VUF#iWzH0O;yfkG<^6VGu&rzxO!o@ZhXHl5|w-UIdEyi))N9$AII
zIg+n1{|q{_x?u-Vkb3(cn#%eV!46Vn!P>bvy|{f4w7$3n8KujnIDs=j1r>7}KLzPx
z@3Flj_pGlju0{C5|Q=qMo?OTS(xDdN9Ai{Ib-DPwyn0gcbp}5oO;t8m?Z?X-8o*`y(uwMIhW?PgsyM-r#v{Ek3$wsjTZ?4pMonBA76w1RUX)EJq&*~6%d_0Mb{(c4hyAz5~<8c`UC^NEz*6;Wfb+(peO$exmq_I2nVt9hitt%{TY|bNww0(I5
z0S(+Not(LCFQ$ul;NA@ng8#x5t05iVDcn`Ufk$z2y!SJb)xt-YhpaOE_JRtApYElH
z;6&~V$kIOQLBohQ-{Jf;q=aYA5SGzu5u%K-@SpuevjVug@VRKOHw6Bbg5_lO-S`;g
z1|dlt+PH;}unV8UoF})SlXD)dY}~Q-d6fx0G34nN7rt$S)Fe^;xD(IMqt?Ns)|=n?
z`UJ#{KfJXeq#~hwg{uFTgs02S??gL3lRi_ZvA9HP2rAaRB0xrGgSonp`Cfdr&!rNA
zFRp~KKln2+%?!mEO;jZxN!R2uq
zwjBfhbiov{-rKb~D2%bi*gSF?P1~}3kR1@Q5*;i+tCA-&kXh?fxm&drx`Ye(jpgcJ
z@P*Eg{^t)P>?huO|1bXWhg{7n`KhW#>1l=YpW#nwWc&jaTxqAcc(YN=T4)X!8ywSre9->N
F{{bXlme2qI
diff --git a/components/keyboardcomponent/icons/backspaceblack.png b/components/keyboardcomponent/icons/backspaceblack.png
new file mode 100644
index 0000000000000000000000000000000000000000..72e5f1dc501ea46b2a13eb1f771ce74634adc901
GIT binary patch
literal 501
zcmV5lFQNAwq;8^l{;HwA6fjj%UVsn*SFD&SuW}eb39Bc_RpdAP9mW
zD3g0wM{h*R$Lq+B<6Qv~!(E+Bk1;gte{XA^#kUj+ouB77g;3kaP>cmmr61kNIS
z8*2rG%_jV&fS}ogR|^Q4O?U~v3kaD-cm_W^zSuK7#J3i8cku*|aoDx+Bt9p&yNmtv
zPY)@*i%0#svt0|{!TSWVJ^XO|gx~?bCaQB~;W4~TB-=)yYuR(cuM*1+Ba%Y)FX5Ls
z$Rs>SD3$Dq@ErCt%3daxQnm+E+WjWFDu1@X(`SxTZgEJe4iAG*q>i)-ck`rB`XR&a#6qc+sNnjnhULws6;JNk
r+tkA7ZCl#Bu5b_pK@bE%@Gp)40o}t73tICD00000NkvXXu0mjftdQOz
literal 0
HcmV?d00001
diff --git a/components/keyboardcomponent/icons/backspacewhite.png b/components/keyboardcomponent/icons/backspacewhite.png
new file mode 100644
index 0000000000000000000000000000000000000000..09aa5ba09b54ae7b68eb7ffc02a1d3d15b926d54
GIT binary patch
literal 765
zcmVP51RI-t
zhd}ZT0%>C-Ns5FN0Wn2Hk)X&HR>9WFRcF;%EVT4VaWBcRnVG#a_kHg=oA+sF&bhze
zeeXT*pL3y5C=?2XLZOg{XcMgN1bzaJq>+=ImAMV80bB*XNT(-1OD$r*V!_P9oR746
z9{8DdH*8Co*|2&P_!D?1y`22aWLVt`tN?rS$jMLRM^b$k_?-nd3k?mcOH|WOKd+qp
zG#%k@fwMVYVc-|in*9to0j$pvyI#kB
z-bTP!!|F0{4cOf#`4}EY#BJa-Fq|Q72%N5CSCcAIcd2*H!&CK8eVvch=M7@k)lch~
z1L~tT0ydfr^@lbI8?e#zvnl@_s>epmuC~4SM#EpXP1um9Ry6|kBgdN_HG9wmW_84{
zdO>}YB56YgPBuNXTC*oLtF>YEnEEPJ(is@2AJ!T^P@kx4YCnfrt=`%9sWt@5DU06>
z41iM+@j&eXM8scKqkj{4FXhETT>*}#OgaZ^z{!Ys0ROB3ZjoUSmH;>X*EV7axJY$}
zw~7Jv=&C)nSC90``nUA>b`-6?Ri(~Wp>=DgrD=0ih&8G+td|oC`@HN^
zPXIT7Ju}4Z0dCZ>``QR7M?9lM#2>(y9ck%=O^<0K;tKFx2U 0
- rowIdx = m.keyboardController.getChild(m.focusIdx).buttonFocused
+ else if key = "left" and m.focusIdx > 0 and not m.DELETE.hasFocus() and not m.SYMBOLS.hasFocus() and not m.SPACEBAR.hasFocus()
m.focusIdx--
- m.keyboardController.getChild(m.focusIdx).focusButton = rowIdx
+ m.keyboardController.getChild(m.focusIdx).focusButton = m.rowIdx
+ return true
+ else if key = "down" and m.focusIdx >= 2 and m.focusIdx <= 5
+ m.SPACEBAR.setFocus(true)
+ return true
+ else if key = "down" and m.focusIdx < 2
+ m.SYMBOLS.setFocus(true)
+ return true
+ else if key = "down" and m.focusIdx > 5
+ m.DELETE.setFocus(true)
+ return true
+ else if key = "up" and m.focusIdx > 5
+ ' Go to the item right above DELETE
+ m.keyboardController.getChild(8).focusButton = 3
+ m.focusIdx = 8
+ return true
+ else if key = "up" and m.focusIdx >= 2 and m.focusIdx <= 5
+ ' Go to the item right above SPACE
+ m.keyboardController.getChild(4).focusButton = 3
+ m.focusIdx = 4
+ return true
+ else if key = "up" and m.focusIdx < 2
+ ' Go to the item right above SYMBOLS
+ m.keyboardController.getChild(0).focusButton = 3
+ m.focusIdx = 0
+ return true
+ else if key = "right" and m.SPACEBAR.hasFocus()
+ m.focusIdx = 8
+ m.DELETE.setFocus(true)
+ return true
+ else if key = "right" and m.SYMBOLS.hasFocus()
+ m.focusIdx = 4
+ m.SPACEBAR.setFocus(true)
+ return true
+ else if key = "left" and m.DELETE.hasFocus()
+ m.focusIdx = 4
+ m.SPACEBAR.setFocus(true)
+ return true
+ else if key = "left" and m.SPACEBAR.hasFocus()
+ m.focusIdx = 0
+ m.SYMBOLS.setFocus(true)
return true
end if
end if
diff --git a/components/keyboardcomponent/keyboardComponent.xml b/components/keyboardcomponent/keyboardComponent.xml
index 313d60d..f85cb8b 100644
--- a/components/keyboardcomponent/keyboardComponent.xml
+++ b/components/keyboardcomponent/keyboardComponent.xml
@@ -1,21 +1,24 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From de897cbeb84e31c386477c3fb963b189f5e67788 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Wed, 29 Sep 2021 13:08:12 +0200
Subject: [PATCH 10/22] removed footprint
---
.../keyboardcomponent/keyboardComponent.brs | 5 +++++
.../keyboardcomponent/keyboardComponent.xml | 22 +++++++++----------
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/components/keyboardcomponent/keyboardComponent.brs b/components/keyboardcomponent/keyboardComponent.brs
index b545a60..c88ed13 100644
--- a/components/keyboardcomponent/keyboardComponent.brs
+++ b/components/keyboardcomponent/keyboardComponent.brs
@@ -29,6 +29,11 @@ sub initButtons()
m.Col7.buttons = ["G", "P", "Y", "7"]
m.Col8.buttons = ["H", "Q", "Z", "8"]
m.Col9.buttons = ["I", "R", "0", "9"]
+ for i = 0 to 3
+ for each child in m.keyboardController.getChildren(9, 0)
+ child.getChild(i).getChild(1).uri = ""
+ end for
+ end for
end sub
sub initObservers()
diff --git a/components/keyboardcomponent/keyboardComponent.xml b/components/keyboardcomponent/keyboardComponent.xml
index f85cb8b..9eb3009 100644
--- a/components/keyboardcomponent/keyboardComponent.xml
+++ b/components/keyboardcomponent/keyboardComponent.xml
@@ -5,20 +5,20 @@
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
From a2798e5361bec9d7fccf2965dc42282398c0de25 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Wed, 29 Sep 2021 13:44:44 +0200
Subject: [PATCH 11/22] saving changes
---
components/keyboardcomponent/keyboardComponent.brs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/components/keyboardcomponent/keyboardComponent.brs b/components/keyboardcomponent/keyboardComponent.brs
index c88ed13..b7573e6 100644
--- a/components/keyboardcomponent/keyboardComponent.brs
+++ b/components/keyboardcomponent/keyboardComponent.brs
@@ -20,7 +20,7 @@ sub initButtons()
m.SPACEBAR = m.keyboardController.findNode("SPACEBAR")
m.DELETE = m.keyboardController.findNode("DELETE")
m.textBox = m.top.findNode("textBox")
- m.Col1.buttons = ["A", "J", "S", "1"]
+ m.Col1.buttons = [" A ", "J", "S", "1"]
m.Col2.buttons = ["B", "K", "T", "2"]
m.Col3.buttons = ["C", "L", "U", "3"]
m.Col4.buttons = ["D", "M", "V", "4"]
@@ -31,7 +31,11 @@ sub initButtons()
m.Col9.buttons = ["I", "R", "0", "9"]
for i = 0 to 3
for each child in m.keyboardController.getChildren(9, 0)
- child.getChild(i).getChild(1).uri = ""
+ child.getChild(i).removeChild(1)
+ child.getChild(i).getChild(2).width = 68
+ child.getChild(i).getChild(2).height = 68
+ child.getChild(i).getChild(2).horizAlign = "center"
+ ?child.getChild(i).getChild(2)
end for
end for
end sub
From e7b7d08de1b2d5f22ca5ffb617e418b477ae7b28 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Wed, 29 Sep 2021 17:49:11 +0200
Subject: [PATCH 12/22] handled symbols and footprint
---
.../keyboardcomponent/keyboardComponent.brs | 71 ++++++++++++++-----
.../keyboardcomponent/keyboardComponent.xml | 20 +++---
2 files changed, 63 insertions(+), 28 deletions(-)
diff --git a/components/keyboardcomponent/keyboardComponent.brs b/components/keyboardcomponent/keyboardComponent.brs
index b7573e6..6f4cf3c 100644
--- a/components/keyboardcomponent/keyboardComponent.brs
+++ b/components/keyboardcomponent/keyboardComponent.brs
@@ -1,5 +1,8 @@
sub init()
m.keyboardController = m.top.findNode("keyboardController")
+ m.keys = ["A", "J", "S", "1", "B", "K", "T", "2", "C", "L", "U", "3", "D", "M", "V", "4", "E", "N", "W", "5", "F", "O", "X", "6", "G", "P", "Y", "7", "H", "Q", "Z", "8", "I", "R", "0", "9"]
+ m.symbolsKeys = ["!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "_", "+", "-", "/", "\", "|", "[", "]", "{", "}", ":", ";", "", "'", ",", ".", "<", ">", "?", "=", "`", "~", "X", "O", "..."]
+ m.symbolsFlag = false
initButtons()
m.focusIdx = 0
m.Col1.getChild(0).setFocus(true)
@@ -20,26 +23,55 @@ sub initButtons()
m.SPACEBAR = m.keyboardController.findNode("SPACEBAR")
m.DELETE = m.keyboardController.findNode("DELETE")
m.textBox = m.top.findNode("textBox")
- m.Col1.buttons = [" A ", "J", "S", "1"]
- m.Col2.buttons = ["B", "K", "T", "2"]
- m.Col3.buttons = ["C", "L", "U", "3"]
- m.Col4.buttons = ["D", "M", "V", "4"]
- m.Col5.buttons = ["E", "N", "W", "5"]
- m.Col6.buttons = ["F", "O", "X", "6"]
- m.Col7.buttons = ["G", "P", "Y", "7"]
- m.Col8.buttons = ["H", "Q", "Z", "8"]
- m.Col9.buttons = ["I", "R", "0", "9"]
- for i = 0 to 3
- for each child in m.keyboardController.getChildren(9, 0)
- child.getChild(i).removeChild(1)
- child.getChild(i).getChild(2).width = 68
- child.getChild(i).getChild(2).height = 68
- child.getChild(i).getChild(2).horizAlign = "center"
- ?child.getChild(i).getChild(2)
+ it = -1
+ for each child in m.keyboardController.getChildren(9, 0)
+ it++
+ it2 = it + 3
+ for i = it to it2
+ childButton = createObject("roSGNode", "Button")
+ childButton.getChild(1).uri = ""
+ childButton.getChild(2).text = m.keys[i]
+ childButton.getChild(2).width = 72
+ childButton.getChild(2).height = 72
+ childButton.getChild(2).font = "font:SmallestBoldSystemFont"
+ childButton.getChild(2).horizAlign = "center"
+ childButton.iconUri = ""
+ childButton.focusedIconUri = ""
+ child.appendChild(childButton)
end for
+ it = it2
end for
end sub
+sub handleSymbols()
+ it = -1
+ if m.symbolsFlag
+ for each child in m.keyboardController.getChildren(9, 0)
+ it++
+ it2 = it + 3
+ btnIdx = 0
+ for i = it to it2
+ child.getChild(btnIdx).getChild(2).text = m.keys[i]
+ btnIdx++
+ end for
+ it = it2
+ end for
+ m.symbolsFlag = false
+ else
+ for each child in m.keyboardController.getChildren(9, 0)
+ it++
+ it2 = it + 3
+ btnIdx = 0
+ for i = it to it2
+ child.getChild(btnIdx).getChild(2).text = m.symbolsKeys[i]
+ btnIdx++
+ end for
+ it = it2
+ end for
+ m.symbolsFlag = true
+ end if
+end sub
+
sub initObservers()
m.Col1.observeField("buttonSelected", "handleItemSelect")
m.Col2.observeField("buttonSelected", "handleItemSelect")
@@ -52,19 +84,22 @@ sub initObservers()
m.Col9.observeField("buttonSelected", "handleItemSelect")
m.DELETE.observeField("buttonSelected", "handleExternalButtonSelect")
m.SPACEBAR.observeField("buttonSelected", "handleExternalButtonSelect")
+ m.SYMBOLS.observeField("buttonSelected", "handleExternalButtonSelect")
m.top.textBox = m.textBox
end sub
sub handleExternalButtonSelect(event)
if event.getRoSGNode().text = "SPACE"
m.textBox.text += " "
- else
+ else if event.getRoSGNode().id = "DELETE"
m.textBox.text = m.textBox.text.Left(m.textBox.text.Len() - 1)
+ else
+ handleSymbols()
end if
end sub
sub handleItemSelect(event)
- text = event.getRoSGNode().getChild(event.getData()).text
+ text = event.getRoSGNode().focusedChild.getChild(2).text
m.textBox.text += text
end sub
diff --git a/components/keyboardcomponent/keyboardComponent.xml b/components/keyboardcomponent/keyboardComponent.xml
index 9eb3009..5a26e16 100644
--- a/components/keyboardcomponent/keyboardComponent.xml
+++ b/components/keyboardcomponent/keyboardComponent.xml
@@ -5,17 +5,17 @@
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
From f80fd0d0f9bb9cd1a2c0c6cd34db94093b0a6505 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Thu, 30 Sep 2021 11:51:42 +0200
Subject: [PATCH 13/22] applied mcherri's changes
---
components/keyboardScene.xml | 4 ++--
.../keyboardcomponent/keyboardComponent.brs | 2 ++
.../keyboardcomponent/keyboardComponent.xml | 20 +++++++++----------
3 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/components/keyboardScene.xml b/components/keyboardScene.xml
index cb597b5..96e59dd 100644
--- a/components/keyboardScene.xml
+++ b/components/keyboardScene.xml
@@ -4,8 +4,8 @@
-
-
+
+
\ No newline at end of file
diff --git a/components/keyboardcomponent/keyboardComponent.brs b/components/keyboardcomponent/keyboardComponent.brs
index 6f4cf3c..bd70b9f 100644
--- a/components/keyboardcomponent/keyboardComponent.brs
+++ b/components/keyboardcomponent/keyboardComponent.brs
@@ -37,6 +37,8 @@ sub initButtons()
childButton.getChild(2).horizAlign = "center"
childButton.iconUri = ""
childButton.focusedIconUri = ""
+ childButton.focusedTextFont = "font:SmallestBoldSystemFont"
+ childButton.textFont = "font:SmallestBoldSystemFont"
child.appendChild(childButton)
end for
it = it2
diff --git a/components/keyboardcomponent/keyboardComponent.xml b/components/keyboardcomponent/keyboardComponent.xml
index 5a26e16..191b01d 100644
--- a/components/keyboardcomponent/keyboardComponent.xml
+++ b/components/keyboardcomponent/keyboardComponent.xml
@@ -5,17 +5,17 @@
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
From 298068f3e5fd9fd89ddb223407978d969667fb66 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Tue, 5 Oct 2021 15:39:02 +0200
Subject: [PATCH 14/22] changes are working
---
.clj-kondo/.cache/2021.09.25/lock | 0
components/keyboardScene.brs | 33 ++++++++++++++++++++++++-------
2 files changed, 26 insertions(+), 7 deletions(-)
create mode 100644 .clj-kondo/.cache/2021.09.25/lock
diff --git a/.clj-kondo/.cache/2021.09.25/lock b/.clj-kondo/.cache/2021.09.25/lock
new file mode 100644
index 0000000..e69de29
diff --git a/components/keyboardScene.brs b/components/keyboardScene.brs
index 589cd92..12a4a01 100644
--- a/components/keyboardScene.brs
+++ b/components/keyboardScene.brs
@@ -7,10 +7,18 @@ sub init()
m.http = createObject("roSGNode", "httpTask")
m.http.observeFieldScoped("response", "useResponse")
m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
end sub
sub handleText()
- m.http.request = { payload: {}, url: "https://api.github.com/users", requestType: "GET" }
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
m.http.control = "RUN"
end sub
@@ -18,12 +26,10 @@ sub useResponse()
itemsThatContainString = createObject("roSGNode", "ContentNode")
items = []
m.itemsList.numColumns = 3
- for each item in m.http.response.body
- if item.login.inStr(Lcase(m.keyboard.textBox.text)) <> -1
- Content = itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.avatar_url
- items.push(item)
- end if
+ for each item in parseJson(m.http.response.body).items
+ Content = itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ items.push(item)
end for
if items.count() = 2
m.itemsList.numColumns = 2
@@ -44,3 +50,16 @@ end sub
sub handleHeading()
m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
end sub
+
+
+
+' sub getUrl()
+' ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+' ' matches = initialPlayerResponseRegEx.match(m.http.response.body)
+' ' m.content = createObject("roSGNode", "ContentNode")
+' ' m.content.streamFormat = "mp4"
+' ' m.content.url = ParseJson(matches[1]).streamingData.formats[0].url
+' ' m.video.content = m.content
+' ' play()
+' end sub
+
From e5a6e0949607f79e9ecd7a78f16af85e929105c4 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Tue, 5 Oct 2021 15:58:27 +0200
Subject: [PATCH 15/22] searching works
---
components/keyboardScene.brs | 4 ++--
components/keyboardScene.xml | 4 ++--
.../keyboardcomponent/keyboardComponent.brs | 20 ++++++++++++++++++-
.../keyboardcomponent/keyboardComponent.xml | 6 ++++--
4 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/components/keyboardScene.brs b/components/keyboardScene.brs
index 12a4a01..370a9cb 100644
--- a/components/keyboardScene.brs
+++ b/components/keyboardScene.brs
@@ -18,7 +18,7 @@ sub handleSubmit()
m.http.request = { payload: {
userId: 1,
title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
m.http.control = "RUN"
end sub
@@ -26,7 +26,7 @@ sub useResponse()
itemsThatContainString = createObject("roSGNode", "ContentNode")
items = []
m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
+ for each item in m.http.response.body.items
Content = itemsThatContainString.createChild("ContentNode")
Content.HDPosterUrl = item.snippet.thumbnails.medium.url
items.push(item)
diff --git a/components/keyboardScene.xml b/components/keyboardScene.xml
index 96e59dd..d4879fe 100644
--- a/components/keyboardScene.xml
+++ b/components/keyboardScene.xml
@@ -4,8 +4,8 @@
-
-
+
+
\ No newline at end of file
diff --git a/components/keyboardcomponent/keyboardComponent.brs b/components/keyboardcomponent/keyboardComponent.brs
index bd70b9f..101176c 100644
--- a/components/keyboardcomponent/keyboardComponent.brs
+++ b/components/keyboardcomponent/keyboardComponent.brs
@@ -22,6 +22,7 @@ sub initButtons()
m.SYMBOLS = m.keyboardController.findNode("SYMBOLS")
m.SPACEBAR = m.keyboardController.findNode("SPACEBAR")
m.DELETE = m.keyboardController.findNode("DELETE")
+ m.SEARCH = m.keyboardController.findNode("SEARCH")
m.textBox = m.top.findNode("textBox")
it = -1
for each child in m.keyboardController.getChildren(9, 0)
@@ -87,6 +88,7 @@ sub initObservers()
m.DELETE.observeField("buttonSelected", "handleExternalButtonSelect")
m.SPACEBAR.observeField("buttonSelected", "handleExternalButtonSelect")
m.SYMBOLS.observeField("buttonSelected", "handleExternalButtonSelect")
+ m.SEARCH.observeField("buttonSelected", "handleExternalButtonSelect")
m.top.textBox = m.textBox
end sub
@@ -95,6 +97,10 @@ sub handleExternalButtonSelect(event)
m.textBox.text += " "
else if event.getRoSGNode().id = "DELETE"
m.textBox.text = m.textBox.text.Left(m.textBox.text.Len() - 1)
+ else if event.getRoSGNode().id = "DELETE"
+ m.top.submit = not m.top.submit
+ else if event.getRoSGNode().id = "SEARCH"
+ m.top.submit = not m.top.submit
else
handleSymbols()
end if
@@ -108,7 +114,9 @@ end sub
function onKeyEvent(key as String, press as Boolean) as Boolean
m.rowIdx = m.keyboardController.getChild(m.focusIdx).buttonFocused
if press
- if key = "right" and m.focusIdx < 8 and not m.DELETE.hasFocus() and not m.SYMBOLS.hasFocus() and not m.SPACEBAR.hasFocus()
+ if key = "right" and m.SEARCH.hasFocus()
+ return true
+ else if key = "right" and m.focusIdx < 8 and not m.DELETE.hasFocus() and not m.SYMBOLS.hasFocus() and not m.SPACEBAR.hasFocus()
m.focusIdx++
m.keyboardController.getChild(m.focusIdx).focusButton = m.rowIdx
return true
@@ -122,6 +130,8 @@ function onKeyEvent(key as String, press as Boolean) as Boolean
else if key = "down" and m.focusIdx < 2
m.SYMBOLS.setFocus(true)
return true
+ else if key = "down" and m.focusIdx = 8
+ m.SEARCH.setFocus(true)
else if key = "down" and m.focusIdx > 5
m.DELETE.setFocus(true)
return true
@@ -156,6 +166,14 @@ function onKeyEvent(key as String, press as Boolean) as Boolean
m.focusIdx = 0
m.SYMBOLS.setFocus(true)
return true
+ else if key = "left" and m.SEARCH.hasFocus()
+ m.focusIdx = 0
+ m.DELETE.setFocus(true)
+ return true
+ else if key = "right" and m.DELETE.hasFocus()
+ m.focusIdx = 0
+ m.SEARCH.setFocus(true)
+ return true
end if
end if
return false
diff --git a/components/keyboardcomponent/keyboardComponent.xml b/components/keyboardcomponent/keyboardComponent.xml
index 191b01d..6808238 100644
--- a/components/keyboardcomponent/keyboardComponent.xml
+++ b/components/keyboardcomponent/keyboardComponent.xml
@@ -2,6 +2,7 @@
+
@@ -17,8 +18,9 @@
-
-
+
+
+
\ No newline at end of file
From b5566664c6cde38956eda7eb66553d9a11abb32d Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Tue, 5 Oct 2021 18:07:01 +0200
Subject: [PATCH 16/22] YouTube Now Working
---
components/keyboardScene.brs | 54 ++++++++++++++++++++++++++---------
components/keyboardScene.xml | 1 +
components/tasks/httpTask.brs | 2 +-
3 files changed, 43 insertions(+), 14 deletions(-)
diff --git a/components/keyboardScene.brs b/components/keyboardScene.brs
index 370a9cb..ff84590 100644
--- a/components/keyboardScene.brs
+++ b/components/keyboardScene.brs
@@ -1,6 +1,8 @@
sub init()
m.keyboard = m.top.findNode("myKeyboard")
m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
m.heading = m.top.findNode("heading")
m.keyboard.setFocus(true)
m.keyboard.observeField("text", "handleText")
@@ -23,12 +25,13 @@ sub handleSubmit()
end sub
sub useResponse()
- itemsThatContainString = createObject("roSGNode", "ContentNode")
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
items = []
m.itemsList.numColumns = 3
- for each item in m.http.response.body.items
- Content = itemsThatContainString.createChild("ContentNode")
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
items.push(item)
end for
if items.count() = 2
@@ -42,7 +45,7 @@ sub useResponse()
m.heading.visible = false
else
m.heading.visible = true
- m.itemsList.content = itemsThatContainString
+ m.itemsList.content = m.itemsThatContainString
handleHeading()
end if
end sub
@@ -51,15 +54,40 @@ sub handleHeading()
m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
end sub
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
-' sub getUrl()
-' ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
-' ' matches = initialPlayerResponseRegEx.match(m.http.response.body)
-' ' m.content = createObject("roSGNode", "ContentNode")
-' ' m.content.streamFormat = "mp4"
-' ' m.content.url = ParseJson(matches[1]).streamingData.formats[0].url
-' ' m.video.content = m.content
-' ' play()
-' end sub
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.control = "play"
+end sub
diff --git a/components/keyboardScene.xml b/components/keyboardScene.xml
index d4879fe..c4719b0 100644
--- a/components/keyboardScene.xml
+++ b/components/keyboardScene.xml
@@ -6,6 +6,7 @@
+
\ No newline at end of file
diff --git a/components/tasks/httpTask.brs b/components/tasks/httpTask.brs
index 455022f..76b664f 100644
--- a/components/tasks/httpTask.brs
+++ b/components/tasks/httpTask.brs
@@ -41,7 +41,7 @@ end function
function handleResponse(responseString as string, message as object, isOk as boolean) as object
if isOk
- body = parseJson(responseString)
+ body = responseString
else
body = "An Error has Occurred!!"
end if
From 9747142422a230baa1e3ace04273f13cc6a4f884 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Fri, 8 Oct 2021 14:19:34 +0200
Subject: [PATCH 17/22] handling changes
---
components/keyboardcomponent/keyboardComponent.brs | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/components/keyboardcomponent/keyboardComponent.brs b/components/keyboardcomponent/keyboardComponent.brs
index 101176c..2279e78 100644
--- a/components/keyboardcomponent/keyboardComponent.brs
+++ b/components/keyboardcomponent/keyboardComponent.brs
@@ -114,9 +114,7 @@ end sub
function onKeyEvent(key as String, press as Boolean) as Boolean
m.rowIdx = m.keyboardController.getChild(m.focusIdx).buttonFocused
if press
- if key = "right" and m.SEARCH.hasFocus()
- return true
- else if key = "right" and m.focusIdx < 8 and not m.DELETE.hasFocus() and not m.SYMBOLS.hasFocus() and not m.SPACEBAR.hasFocus()
+ if key = "right" and m.focusIdx < 8 and not m.DELETE.hasFocus() and not m.SYMBOLS.hasFocus() and not m.SPACEBAR.hasFocus()
m.focusIdx++
m.keyboardController.getChild(m.focusIdx).focusButton = m.rowIdx
return true
From a12d03120e905af957aa848db5e68c77bcd70958 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Wed, 13 Oct 2021 15:14:33 +0200
Subject: [PATCH 18/22] trying to handle the text for the elapsed and remaining
times
---
.history/.gitignore_20211008145905 | 2 +
.history/.gitignore_20211010133726 | 4 +
.history/.gitignore_20211011133958 | 4 +
.history/.gitignore_20211011134525 | 4 +
.../components/MainScreen_20161215154627.xml | 32 ++++
.../components/MainScreen_20211011143248.xml | 14 ++
.history/components/Play_20211012131737.brs | 27 ++++
.history/components/Play_20211012131808.brs | 28 ++++
.history/components/Play_20211012131900.brs | 27 ++++
.../keyboardScene_20211012131932.brs | 93 +++++++++++
.../keyboardScene_20211012132158.brs | 94 +++++++++++
.../keyboardScene_20211012133530.brs | 95 +++++++++++
.../keyboardScene_20211012133904.brs | 95 +++++++++++
.../keyboardScene_20211012134451.brs | 96 +++++++++++
.../keyboardScene_20211012134544.brs | 96 +++++++++++
.../keyboardScene_20211012134647.brs | 97 ++++++++++++
.../keyboardScene_20211012134937.brs | 98 ++++++++++++
.../keyboardScene_20211012135037.brs | 98 ++++++++++++
.../keyboardScene_20211012135227.brs | 99 ++++++++++++
.../keyboardScene_20211012135232.brs | 99 ++++++++++++
.../keyboardScene_20211012135345.brs | 100 ++++++++++++
.../keyboardScene_20211012135459.brs | 100 ++++++++++++
.../keyboardScene_20211012135654.brs | 100 ++++++++++++
.../keyboardScene_20211012135833.brs | 100 ++++++++++++
.../keyboardScene_20211012135835.brs | 100 ++++++++++++
.../keyboardScene_20211012135845.brs | 100 ++++++++++++
.../keyboardScene_20211012135848.brs | 100 ++++++++++++
.../keyboardScene_20211012135849.brs | 100 ++++++++++++
.../keyboardScene_20211012140044.brs | 100 ++++++++++++
.../keyboardScene_20211012140310.brs | 100 ++++++++++++
.../keyboardScene_20211012140322.brs | 97 ++++++++++++
.../keyboardScene_20211012140753.brs | 101 ++++++++++++
.../keyboardScene_20211012140755.brs | 100 ++++++++++++
.../keyboardScene_20211012140756.brs | 100 ++++++++++++
.../keyboardScene_20211012140816.brs | 101 ++++++++++++
.../keyboardScene_20211012140911.brs | 101 ++++++++++++
.../keyboardScene_20211012140929.brs | 101 ++++++++++++
.../keyboardScene_20211012140932.brs | 100 ++++++++++++
.../keyboardScene_20211012140933.brs | 100 ++++++++++++
.../keyboardScene_20211012140937.brs | 99 ++++++++++++
.../keyboardScene_20211012141120.brs | 99 ++++++++++++
.../keyboardScene_20211012141140.brs | 100 ++++++++++++
.../keyboardScene_20211012141147.brs | 100 ++++++++++++
.../keyboardScene_20211012141326.brs | 100 ++++++++++++
.../keyboardScene_20211012141443.brs | 100 ++++++++++++
.../keyboardScene_20211012141637.brs | 101 ++++++++++++
.../keyboardScene_20211012141641.brs | 100 ++++++++++++
.../keyboardScene_20211012141813.brs | 101 ++++++++++++
.../keyboardScene_20211012141843.brs | 101 ++++++++++++
.../keyboardScene_20211012141913.brs | 101 ++++++++++++
.../keyboardScene_20211012141947.brs | 101 ++++++++++++
.../keyboardScene_20211012142027.brs | 101 ++++++++++++
.../keyboardScene_20211012142112.brs | 102 ++++++++++++
.../keyboardScene_20211012142206.brs | 102 ++++++++++++
.../keyboardScene_20211012142301.brs | 102 ++++++++++++
.../keyboardScene_20211012142428.brs | 103 ++++++++++++
.../keyboardScene_20211012142431.brs | 103 ++++++++++++
.../keyboardScene_20211012142554.brs | 104 ++++++++++++
.../keyboardScene_20211012142834.brs | 104 ++++++++++++
.../keyboardScene_20211012142946.brs | 104 ++++++++++++
.../keyboardScene_20211012143030.brs | 104 ++++++++++++
.../keyboardScene_20211012143106.brs | 104 ++++++++++++
.../keyboardScene_20211012143144.brs | 105 ++++++++++++
.../keyboardScene_20211012143255.brs | 105 ++++++++++++
.../keyboardScene_20211012143425.brs | 104 ++++++++++++
.../keyboardScene_20211012143432.brs | 104 ++++++++++++
.../keyboardScene_20211012143506.brs | 104 ++++++++++++
.../keyboardScene_20211012143547.brs | 104 ++++++++++++
.../keyboardScene_20211012143803.brs | 105 ++++++++++++
.../keyboardScene_20211012143849.brs | 105 ++++++++++++
.../keyboardScene_20211012144059.brs | 105 ++++++++++++
.../keyboardScene_20211012144148.brs | 105 ++++++++++++
.../keyboardScene_20211012144149.brs | 105 ++++++++++++
.../keyboardScene_20211012144401.brs | 105 ++++++++++++
.../keyboardScene_20211012144506.brs | 106 +++++++++++++
.../keyboardScene_20211012144537.brs | 107 +++++++++++++
.../keyboardScene_20211012144610.brs | 108 +++++++++++++
.../keyboardScene_20211012144744.brs | 109 +++++++++++++
.../keyboardScene_20211012144754.brs | 109 +++++++++++++
.../keyboardScene_20211012144806.brs | 110 +++++++++++++
.../keyboardScene_20211012144812.brs | 110 +++++++++++++
.../keyboardScene_20211012144825.brs | 110 +++++++++++++
.../keyboardScene_20211012145038.brs | 109 +++++++++++++
.../keyboardScene_20211012145051.brs | 110 +++++++++++++
.../keyboardScene_20211012145100.brs | 110 +++++++++++++
.../keyboardScene_20211012145914.brs | 110 +++++++++++++
.../keyboardScene_20211012145926.brs | 110 +++++++++++++
.../keyboardScene_20211012150040.brs | 109 +++++++++++++
.../keyboardScene_20211012150053.brs | 109 +++++++++++++
.../keyboardScene_20211012150212.brs | 109 +++++++++++++
.../keyboardScene_20211012150318.brs | 113 +++++++++++++
.../keyboardScene_20211012150319.brs | 112 +++++++++++++
.../keyboardScene_20211012150416.brs | 113 +++++++++++++
.../keyboardScene_20211012150424.brs | 113 +++++++++++++
.../keyboardScene_20211012150555.brs | 113 +++++++++++++
.../keyboardScene_20211012150601.brs | 114 ++++++++++++++
.../keyboardScene_20211012150644.brs | 115 ++++++++++++++
.../keyboardScene_20211012150915.brs | 111 +++++++++++++
.../keyboardScene_20211012150920.brs | 111 +++++++++++++
.../keyboardScene_20211012151005.brs | 111 +++++++++++++
.../keyboardScene_20211012151105.brs | 112 +++++++++++++
.../keyboardScene_20211012151115.brs | 115 ++++++++++++++
.../keyboardScene_20211012151125.brs | 115 ++++++++++++++
.../keyboardScene_20211012151129.brs | 114 ++++++++++++++
.../keyboardScene_20211012151328.brs | 114 ++++++++++++++
.../keyboardScene_20211012151452.brs | 115 ++++++++++++++
.../keyboardScene_20211012151718.brs | 116 ++++++++++++++
.../keyboardScene_20211012151724.brs | 120 ++++++++++++++
.../keyboardScene_20211012151741.brs | 120 ++++++++++++++
.../keyboardScene_20211012151753.brs | 120 ++++++++++++++
.../keyboardScene_20211012151815.brs | 121 ++++++++++++++
.../keyboardScene_20211012151941.brs | 121 ++++++++++++++
.../keyboardScene_20211012151947.brs | 121 ++++++++++++++
.../keyboardScene_20211012152121.brs | 121 ++++++++++++++
.../keyboardScene_20211012152125.brs | 120 ++++++++++++++
.../keyboardScene_20211012152229.brs | 120 ++++++++++++++
.../keyboardScene_20211012152237.brs | 120 ++++++++++++++
.../keyboardScene_20211012152352.brs | 122 ++++++++++++++
.../keyboardScene_20211012152354.brs | 122 ++++++++++++++
.../keyboardScene_20211012152507.brs | 120 ++++++++++++++
.../keyboardScene_20211012152518.brs | 115 ++++++++++++++
.../keyboardScene_20211012152520.brs | 115 ++++++++++++++
.../keyboardScene_20211013084544.brs | 115 ++++++++++++++
.../keyboardScene_20211013084609.brs | 115 ++++++++++++++
.../keyboardScene_20211013084830.brs | 116 ++++++++++++++
.../keyboardScene_20211013084919.brs | 117 ++++++++++++++
.../keyboardScene_20211013084931.brs | 117 ++++++++++++++
.../keyboardScene_20211013084953.brs | 117 ++++++++++++++
.../keyboardScene_20211013085016.brs | 117 ++++++++++++++
.../keyboardScene_20211013085019.brs | 116 ++++++++++++++
.../keyboardScene_20211013085029.brs | 117 ++++++++++++++
.../keyboardScene_20211013085134.brs | 117 ++++++++++++++
.../keyboardScene_20211013085212.brs | 117 ++++++++++++++
.../keyboardScene_20211013085303.brs | 122 ++++++++++++++
.../keyboardScene_20211013085427.brs | 120 ++++++++++++++
.../keyboardScene_20211013085504.brs | 120 ++++++++++++++
.../keyboardScene_20211013085622.brs | 121 ++++++++++++++
.../keyboardScene_20211013085645.brs | 120 ++++++++++++++
.../keyboardScene_20211013085719.brs | 126 +++++++++++++++
.../keyboardScene_20211013085937.brs | 129 +++++++++++++++
.../keyboardScene_20211013085941.brs | 129 +++++++++++++++
.../keyboardScene_20211013090029.brs | 136 ++++++++++++++++
.../keyboardScene_20211013090032.brs | 135 ++++++++++++++++
.../keyboardScene_20211013090124.brs | 135 ++++++++++++++++
.../keyboardScene_20211013090236.brs | 137 ++++++++++++++++
.../keyboardScene_20211013090237.brs | 136 ++++++++++++++++
.../keyboardScene_20211013090246.brs | 129 +++++++++++++++
.../keyboardScene_20211013090357.brs | 129 +++++++++++++++
.../keyboardScene_20211013090424.brs | 130 +++++++++++++++
.../keyboardScene_20211013090428.brs | 130 +++++++++++++++
.../keyboardScene_20211013090430.brs | 130 +++++++++++++++
.../keyboardScene_20211013090606.brs | 130 +++++++++++++++
.../keyboardScene_20211013090650.brs | 130 +++++++++++++++
.../keyboardScene_20211013091239.brs | 130 +++++++++++++++
.../keyboardScene_20211013091250.brs | 131 +++++++++++++++
.../keyboardScene_20211013091409.brs | 131 +++++++++++++++
.../keyboardScene_20211013091433.brs | 132 ++++++++++++++++
.../keyboardScene_20211013091435.brs | 131 +++++++++++++++
.../keyboardScene_20211013091614.brs | 126 +++++++++++++++
.../keyboardScene_20211013091744.brs | 125 +++++++++++++++
.../keyboardScene_20211013091801.brs | 125 +++++++++++++++
.../keyboardScene_20211013091824.brs | 126 +++++++++++++++
.../keyboardScene_20211013091843.brs | 126 +++++++++++++++
.../keyboardScene_20211013092139.brs | 127 +++++++++++++++
.../keyboardScene_20211013092550.brs | 126 +++++++++++++++
.../keyboardScene_20211013092609.brs | 127 +++++++++++++++
.../keyboardScene_20211013092733.brs | 127 +++++++++++++++
.../keyboardScene_20211013092747.brs | 128 +++++++++++++++
.../keyboardScene_20211013093145.brs | 127 +++++++++++++++
.../keyboardScene_20211013093216.brs | 128 +++++++++++++++
.../keyboardScene_20211013093416.brs | 129 +++++++++++++++
.../keyboardScene_20211013093425.brs | 129 +++++++++++++++
.../keyboardScene_20211013093427.brs | 129 +++++++++++++++
.../keyboardScene_20211013093435.brs | 128 +++++++++++++++
.../keyboardScene_20211013093609.brs | 131 +++++++++++++++
.../keyboardScene_20211013093716.brs | 131 +++++++++++++++
.../keyboardScene_20211013093742.brs | 131 +++++++++++++++
.../keyboardScene_20211013093901.brs | 131 +++++++++++++++
.../keyboardScene_20211013094038.brs | 131 +++++++++++++++
.../keyboardScene_20211013094149.brs | 131 +++++++++++++++
.../keyboardScene_20211013094200.brs | 131 +++++++++++++++
.../keyboardScene_20211013094215.brs | 131 +++++++++++++++
.../keyboardScene_20211013094311.brs | 131 +++++++++++++++
.../keyboardScene_20211013094327.brs | 132 ++++++++++++++++
.../keyboardScene_20211013094446.brs | 132 ++++++++++++++++
.../keyboardScene_20211013094518.brs | 137 ++++++++++++++++
.../keyboardScene_20211013094725.brs | 140 ++++++++++++++++
.../keyboardScene_20211013094755.brs | 138 ++++++++++++++++
.../keyboardScene_20211013094801.brs | 138 ++++++++++++++++
.../keyboardScene_20211013094955.brs | 136 ++++++++++++++++
.../keyboardScene_20211013095125.brs | 137 ++++++++++++++++
.../keyboardScene_20211013095129.brs | 133 ++++++++++++++++
.../keyboardScene_20211013095302.brs | 135 ++++++++++++++++
.../keyboardScene_20211013095309.brs | 135 ++++++++++++++++
.../keyboardScene_20211013095313.brs | 139 ++++++++++++++++
.../keyboardScene_20211013095352.brs | 138 ++++++++++++++++
.../keyboardScene_20211013095507.brs | 134 ++++++++++++++++
.../keyboardScene_20211013095619.brs | 133 ++++++++++++++++
.../keyboardScene_20211013095915.brs | 133 ++++++++++++++++
.../keyboardScene_20211013100109.brs | 130 +++++++++++++++
.../keyboardScene_20211013100114.brs | 130 +++++++++++++++
.../keyboardScene_20211013100321.brs | 131 +++++++++++++++
.../keyboardScene_20211013100413.brs | 131 +++++++++++++++
.../keyboardScene_20211013100611.brs | 130 +++++++++++++++
.../keyboardScene_20211013100704.brs | 130 +++++++++++++++
.../keyboardScene_20211013100732.brs | 130 +++++++++++++++
.../keyboardScene_20211013100741.brs | 130 +++++++++++++++
.../keyboardScene_20211013101010.brs | 130 +++++++++++++++
.../keyboardScene_20211013101053.brs | 130 +++++++++++++++
.../keyboardScene_20211013101209.brs | 136 ++++++++++++++++
.../keyboardScene_20211013101219.brs | 138 ++++++++++++++++
.../keyboardScene_20211013101612.brs | 139 ++++++++++++++++
.../keyboardScene_20211013101628.brs | 139 ++++++++++++++++
.../keyboardScene_20211013101701.brs | 129 +++++++++++++++
.../keyboardScene_20211013101702.brs | 130 +++++++++++++++
.../keyboardScene_20211013101804.brs | 130 +++++++++++++++
.../keyboardScene_20211013101906.brs | 131 +++++++++++++++
.../keyboardScene_20211013102044.brs | 130 +++++++++++++++
.../keyboardScene_20211013102050.brs | 131 +++++++++++++++
.../keyboardScene_20211013102112.brs | 130 +++++++++++++++
.../keyboardScene_20211013102231.brs | 129 +++++++++++++++
.../keyboardScene_20211013102345.brs | 130 +++++++++++++++
.../keyboardScene_20211013102451.brs | 130 +++++++++++++++
.../keyboardScene_20211013102459.brs | 129 +++++++++++++++
.../keyboardScene_20211013102726.brs | 129 +++++++++++++++
.../keyboardScene_20211013102731.brs | 129 +++++++++++++++
.../keyboardScene_20211013102735.brs | 128 +++++++++++++++
.../keyboardScene_20211013102942.brs | 128 +++++++++++++++
.../keyboardScene_20211013103048.brs | 126 +++++++++++++++
.../keyboardScene_20211013103053.brs | 124 +++++++++++++++
.../keyboardScene_20211013103117.brs | 124 +++++++++++++++
.../keyboardScene_20211013103253.brs | 125 +++++++++++++++
.../keyboardScene_20211013103329.brs | 126 +++++++++++++++
.../keyboardScene_20211013103340.brs | 129 +++++++++++++++
.../keyboardScene_20211013103508.brs | 124 +++++++++++++++
.../keyboardScene_20211013103610.brs | 129 +++++++++++++++
.../keyboardScene_20211013103822.brs | 129 +++++++++++++++
.../keyboardScene_20211013104007.brs | 129 +++++++++++++++
.../keyboardScene_20211013104125.brs | 132 ++++++++++++++++
.../keyboardScene_20211013104129.brs | 132 ++++++++++++++++
.../keyboardScene_20211013104607.brs | 128 +++++++++++++++
.../keyboardScene_20211013111804.brs | 129 +++++++++++++++
.../keyboardScene_20211013112056.brs | 129 +++++++++++++++
.../keyboardScene_20211013112130.brs | 129 +++++++++++++++
.../keyboardScene_20211013112734.brs | 130 +++++++++++++++
.../keyboardScene_20211013112809.brs | 149 ++++++++++++++++++
.../keyboardScene_20211013112832.brs | 131 +++++++++++++++
.../keyboardScene_20211013112904.brs | 131 +++++++++++++++
.../keyboardScene_20211013112911.brs | 132 ++++++++++++++++
.../keyboardScene_20211013112916.brs | 132 ++++++++++++++++
.../keyboardScene_20211013112931.brs | 132 ++++++++++++++++
.../keyboardScene_20211013112957.brs | 134 ++++++++++++++++
.../keyboardScene_20211013113346.brs | 134 ++++++++++++++++
.../keyboardScene_20211013113353.brs | 134 ++++++++++++++++
.../keyboardScene_20211013113420.brs | 135 ++++++++++++++++
.../keyboardScene_20211013113430.brs | 135 ++++++++++++++++
.../keyboardScene_20211013113434.brs | 135 ++++++++++++++++
.../keyboardScene_20211013113448.brs | 135 ++++++++++++++++
.../keyboardScene_20211013113930.brs | 136 ++++++++++++++++
.../keyboardScene_20211013114149.brs | 135 ++++++++++++++++
.../keyboardScene_20211013114208.brs | 136 ++++++++++++++++
.../keyboardScene_20211013114259.brs | 136 ++++++++++++++++
.../keyboardScene_20211013114359.brs | 136 ++++++++++++++++
.../keyboardScene_20211013114558.brs | 136 ++++++++++++++++
.../keyboardScene_20211013114601.brs | 136 ++++++++++++++++
.../keyboardScene_20211013114638.brs | 137 ++++++++++++++++
.../keyboardScene_20211013114900.brs | 137 ++++++++++++++++
.../keyboardScene_20211013114903.brs | 137 ++++++++++++++++
.../keyboardScene_20211013114922.brs | 134 ++++++++++++++++
.../keyboardScene_20211013114926.brs | 135 ++++++++++++++++
.../keyboardScene_20211013115137.brs | 135 ++++++++++++++++
.../keyboardScene_20211013115148.brs | 135 ++++++++++++++++
.../keyboardScene_20211013115449.brs | 115 ++++++++++++++
.../keyboardScene_20211013115508.brs | 115 ++++++++++++++
.../keyboardScene_20211013115641.brs | 113 +++++++++++++
.../keyboardScene_20211013115642.brs | 112 +++++++++++++
.../keyboardScene_20211013120029.brs | 128 +++++++++++++++
.../keyboardScene_20211013120221.brs | 128 +++++++++++++++
.../keyboardScene_20211013120222.brs | 128 +++++++++++++++
.../keyboardScene_20211013120224.brs | 128 +++++++++++++++
.../keyboardScene_20211013120310.brs | 128 +++++++++++++++
.../keyboardScene_20211013120433.brs | 128 +++++++++++++++
.../keyboardScene_20211013120455.brs | 128 +++++++++++++++
.../keyboardScene_20211013120556.brs | 128 +++++++++++++++
.../keyboardScene_20211013120716.brs | 128 +++++++++++++++
.../keyboardScene_20211013120749.brs | 128 +++++++++++++++
.../keyboardScene_20211013120941.brs | 128 +++++++++++++++
.../keyboardScene_20211013120950.brs | 128 +++++++++++++++
.../keyboardScene_20211013121009.brs | 129 +++++++++++++++
.../keyboardScene_20211013121301.brs | 129 +++++++++++++++
.../keyboardScene_20211013121308.brs | 128 +++++++++++++++
.../keyboardScene_20211013121430.brs | 128 +++++++++++++++
.../keyboardScene_20211013121510.brs | 130 +++++++++++++++
.../keyboardScene_20211013121513.brs | 129 +++++++++++++++
.../keyboardScene_20211013121642.brs | 129 +++++++++++++++
.../keyboardScene_20211013121733.brs | 130 +++++++++++++++
.../keyboardScene_20211013121813.brs | 130 +++++++++++++++
.../keyboardScene_20211013121920.brs | 130 +++++++++++++++
.../keyboardScene_20211013122052.brs | 130 +++++++++++++++
.../keyboardScene_20211013122203.brs | 130 +++++++++++++++
.../keyboardScene_20211013122255.brs | 130 +++++++++++++++
.../keyboardScene_20211013122346.brs | 138 ++++++++++++++++
.../keyboardScene_20211013122751.brs | 137 ++++++++++++++++
.../keyboardScene_20211013122827.brs | 128 +++++++++++++++
.../keyboardScene_20211013122956.brs | 137 ++++++++++++++++
.../keyboardScene_20211013123106.brs | 137 ++++++++++++++++
.../keyboardScene_20211013123338.brs | 137 ++++++++++++++++
.../keyboardScene_20211013123348.brs | 137 ++++++++++++++++
.../keyboardScene_20211013123553.brs | 137 ++++++++++++++++
.../keyboardScene_20211013123635.brs | 125 +++++++++++++++
.../keyboardScene_20211013123640.brs | 124 +++++++++++++++
.../keyboardScene_20211013123711.brs | 124 +++++++++++++++
.../keyboardScene_20211013123930.brs | 125 +++++++++++++++
.../keyboardScene_20211013123941.brs | 125 +++++++++++++++
.../keyboardScene_20211013124048.brs | 124 +++++++++++++++
.../keyboardScene_20211013124103.brs | 125 +++++++++++++++
.../keyboardScene_20211013124315.brs | 124 +++++++++++++++
.../keyboardScene_20211013124342.brs | 125 +++++++++++++++
.../keyboardScene_20211013124356.brs | 125 +++++++++++++++
.../keyboardScene_20211013124407.brs | 125 +++++++++++++++
.../keyboardScene_20211013124600.brs | 122 ++++++++++++++
.../keyboardScene_20211013124601.brs | 121 ++++++++++++++
.../keyboardScene_20211013124605.brs | 119 ++++++++++++++
.../keyboardScene_20211013124801.brs | 121 ++++++++++++++
.../keyboardScene_20211013124803.brs | 121 ++++++++++++++
.../keyboardScene_20211013124813.brs | 121 ++++++++++++++
.../keyboardScene_20211013124917.brs | 121 ++++++++++++++
.../keyboardScene_20211013125042.brs | 121 ++++++++++++++
.../keyboardScene_20211013125125.brs | 121 ++++++++++++++
.../keyboardScene_20211013125245.brs | 121 ++++++++++++++
.../keyboardScene_20211013125422.brs | 123 +++++++++++++++
.../keyboardScene_20211013125550.brs | 123 +++++++++++++++
.../keyboardScene_20211013125740.brs | 123 +++++++++++++++
.../keyboardScene_20211013125813.brs | 123 +++++++++++++++
.../keyboardScene_20211013130232.brs | 123 +++++++++++++++
.../keyboardScene_20211013130255.brs | 123 +++++++++++++++
.../keyboardScene_20211013130450.brs | 123 +++++++++++++++
.../keyboardScene_20211013130504.brs | 123 +++++++++++++++
.../keyboardScene_20211013130610.brs | 123 +++++++++++++++
.../keyboardScene_20211013130615.brs | 122 ++++++++++++++
.../keyboardScene_20211013130800.brs | 122 ++++++++++++++
.../keyboardScene_20211013130841.brs | 122 ++++++++++++++
.../keyboardScene_20211013130923.brs | 122 ++++++++++++++
.../keyboardScene_20211013131007.brs | 129 +++++++++++++++
.../keyboardScene_20211013131022.brs | 128 +++++++++++++++
.../keyboardScene_20211013131110.brs | 128 +++++++++++++++
.../keyboardScene_20211013131111.brs | 128 +++++++++++++++
.../keyboardScene_20211013131430.brs | 128 +++++++++++++++
.../keyboardScene_20211013131507.brs | 129 +++++++++++++++
.../keyboardScene_20211013131514.brs | 129 +++++++++++++++
.../keyboardScene_20211013131516.brs | 129 +++++++++++++++
.../keyboardScene_20211013131537.brs | 129 +++++++++++++++
.../keyboardScene_20211013131756.brs | 131 +++++++++++++++
.../keyboardScene_20211013131908.brs | 132 ++++++++++++++++
.../keyboardScene_20211013131909.brs | 132 ++++++++++++++++
.../keyboardScene_20211013131944.brs | 132 ++++++++++++++++
.../keyboardScene_20211013132015.brs | 132 ++++++++++++++++
.../keyboardScene_20211013132042.brs | 132 ++++++++++++++++
.../keyboardScene_20211013132113.brs | 132 ++++++++++++++++
.../keyboardScene_20211013132154.brs | 132 ++++++++++++++++
.../keyboardScene_20211013132231.brs | 125 +++++++++++++++
.../keyboardScene_20211013132325.brs | 132 ++++++++++++++++
.../keyboardScene_20211013132328.brs | 132 ++++++++++++++++
.../keyboardScene_20211013132822.brs | 125 +++++++++++++++
.../keyboardScene_20211013132836.brs | 125 +++++++++++++++
.../keyboardScene_20211013132919.brs | 125 +++++++++++++++
.../keyboardScene_20211013132923.brs | 125 +++++++++++++++
.../keyboardScene_20211013133140.brs | 115 ++++++++++++++
.../keyboardScene_20211013133235.brs | 116 ++++++++++++++
.../keyboardScene_20211013133307.brs | 118 ++++++++++++++
.../keyboardScene_20211013133351.brs | 120 ++++++++++++++
.../keyboardScene_20211013133354.brs | 120 ++++++++++++++
.../keyboardScene_20211013133416.brs | 120 ++++++++++++++
.../keyboardScene_20211013133531.brs | 121 ++++++++++++++
.../keyboardScene_20211013133535.brs | 120 ++++++++++++++
.../keyboardScene_20211013133645.brs | 120 ++++++++++++++
.../keyboardScene_20211013133851.brs | 121 ++++++++++++++
.../keyboardScene_20211013133853.brs | 121 ++++++++++++++
.../keyboardScene_20211013133936.brs | 122 ++++++++++++++
.../keyboardScene_20211013134505.brs | 122 ++++++++++++++
.../keyboardScene_20211013134544.brs | 122 ++++++++++++++
.../keyboardScene_20211013134546.brs | 122 ++++++++++++++
.../keyboardScene_20211013134551.brs | 122 ++++++++++++++
.../keyboardScene_20211013134614.brs | 122 ++++++++++++++
.../keyboardScene_20211013134659.brs | 122 ++++++++++++++
.../keyboardScene_20211013134857.brs | 121 ++++++++++++++
.../keyboardScene_20211013134858.brs | 120 ++++++++++++++
.../keyboardScene_20211013134903.brs | 120 ++++++++++++++
.../keyboardScene_20211013134949.brs | 121 ++++++++++++++
.../keyboardScene_20211013135052.brs | 122 ++++++++++++++
.../keyboardScene_20211013135201.brs | 121 ++++++++++++++
.../keyboardScene_20211013135245.brs | 122 ++++++++++++++
.../keyboardScene_20211013135311.brs | 122 ++++++++++++++
.../keyboardScene_20211013135323.brs | 122 ++++++++++++++
.../keyboardScene_20211013135421.brs | 125 +++++++++++++++
.../keyboardScene_20211013135423.brs | 125 +++++++++++++++
.../keyboardScene_20211013135438.brs | 124 +++++++++++++++
.../keyboardScene_20211013135941.brs | 124 +++++++++++++++
.../keyboardScene_20211013140045.brs | 126 +++++++++++++++
.../keyboardScene_20211013140050.brs | 126 +++++++++++++++
.../keyboardScene_20211013140143.brs | 126 +++++++++++++++
.../keyboardScene_20211013140205.brs | 126 +++++++++++++++
.../keyboardScene_20211013140225.brs | 126 +++++++++++++++
.../keyboardScene_20211013140252.brs | 128 +++++++++++++++
.../keyboardScene_20211013140501.brs | 127 +++++++++++++++
.../keyboardScene_20211013140635.brs | 126 +++++++++++++++
.../keyboardScene_20211013140749.brs | 128 +++++++++++++++
.../keyboardScene_20211013140847.brs | 128 +++++++++++++++
.../keyboardScene_20211013141218.brs | 126 +++++++++++++++
.../keyboardScene_20211013142600.brs | 131 +++++++++++++++
.../keyboardScene_20211013142605.brs | 131 +++++++++++++++
.../keyboardScene_20211013143004.brs | 131 +++++++++++++++
.../keyboardScene_20211013143124.brs | 135 ++++++++++++++++
.../keyboardScene_20211013143327.brs | 135 ++++++++++++++++
.../keyboardScene_20211013143425.brs | 138 ++++++++++++++++
.../keyboardScene_20211013143546.brs | 145 +++++++++++++++++
.../keyboardScene_20211013144033.brs | 145 +++++++++++++++++
.../keyboardScene_20211013144219.brs | 136 ++++++++++++++++
.../keyboardScene_20211013144311.brs | 136 ++++++++++++++++
.../keyboardScene_20211013144317.brs | 136 ++++++++++++++++
.../keyboardScene_20211013144410.brs | 136 ++++++++++++++++
.../keyboardScene_20211013144558.brs | 136 ++++++++++++++++
.../keyboardScene_20211013144626.brs | 136 ++++++++++++++++
.../keyboardScene_20211013144935.brs | 136 ++++++++++++++++
.../keyboardScene_20211013144950.brs | 136 ++++++++++++++++
.../keyboardScene_20211013145019.brs | 136 ++++++++++++++++
.../keyboardScene_20211013145139.brs | 127 +++++++++++++++
.../keyboardScene_20211013145506.brs | 127 +++++++++++++++
.../keyboardScene_20211013145513.brs | 128 +++++++++++++++
.../keyboardScene_20211013145610.brs | 127 +++++++++++++++
.../keyboardScene_20211013145626.brs | 129 +++++++++++++++
.../keyboardScene_20211013145743.brs | 130 +++++++++++++++
.../keyboardScene_20211013145848.brs | 128 +++++++++++++++
.../keyboardScene_20211013145849.brs | 127 +++++++++++++++
.../keyboardScene_20211013145926.brs | 127 +++++++++++++++
.../keyboardScene_20211013150159.brs | 138 ++++++++++++++++
.../keyboardScene_20211013150327.brs | 138 ++++++++++++++++
.../keyboardScene_20211013150822.brs | 127 +++++++++++++++
.../keyboardScene_20211013151157.brs | 127 +++++++++++++++
.history/components/play_20211012131733.xml | 7 +
.history/components/play_20211012131742.xml | 7 +
.../rowListContent_20211008145905.brs | 11 ++
.../rowListContent_20211010122436.xml | 5 +
.../rowListContent_20211010122446.brs | 11 ++
.../rowListContent_20211010122452.xml | 5 +
.../rowListContent_20211011134627.xml | 5 +
.../rowListContent_20211012145223.xml | 5 +
.../components/rowListItem_20211010122403.xml | 16 ++
.../components/rowListItem_20211010122413.xml | 16 ++
.../components/rowListItem_20211010122425.xml | 16 ++
.../components/rowListItem_20211011134635.xml | 16 ++
.../components/rowListItem_20211012145217.xml | 16 ++
.../rowListScene_20211008145905.brs | 23 +++
.../rowListScene_20211008145905.xml | 7 +
.../rowListScene_20211008145927.xml | 7 +
.../rowListScene_20211008150133.xml | 14 ++
.../rowListScene_20211008150134.xml | 14 ++
.../rowListScene_20211008150139.xml | 14 ++
.../rowListScene_20211008150146.xml | 13 ++
.../rowListScene_20211008150412.brs | 3 +
.../rowListScene_20211008150439.brs | 7 +
.../rowListScene_20211008150452.brs | 7 +
.../rowListScene_20211008150508.brs | 9 ++
.../rowListScene_20211008150514.brs | 9 ++
.../rowListScene_20211008150559.brs | 11 ++
.../rowListScene_20211008150612.brs | 11 ++
.../rowListScene_20211008150619.brs | 11 ++
.../rowListScene_20211008150659.brs | 16 ++
.../rowListScene_20211008150803.brs | 16 ++
.../rowListScene_20211008150813.brs | 18 +++
.../rowListScene_20211008150839.brs | 20 +++
.../rowListScene_20211008150851.brs | 20 +++
.../rowListScene_20211008150910.brs | 23 +++
.../rowListScene_20211008150944.brs | 28 ++++
.../rowListScene_20211008151000.brs | 32 ++++
.../rowListScene_20211008151026.brs | 32 ++++
.../rowListScene_20211008151203.xml | 13 ++
.../rowListScene_20211008151217.brs | 33 ++++
.../rowListScene_20211008151221.xml | 13 ++
.../rowListScene_20211008151233.brs | 33 ++++
.../rowListScene_20211008151244.brs | 37 +++++
.../rowListScene_20211008151305.brs | 37 +++++
.../rowListScene_20211008151346.xml | 13 ++
.../rowListScene_20211008151554.brs | 37 +++++
.../rowListScene_20211008151601.xml | 13 ++
.../rowListScene_20211008151608.brs | 37 +++++
.../rowListScene_20211008151648.brs | 38 +++++
.../rowListScene_20211008151716.brs | 38 +++++
.../rowListScene_20211008151748.brs | 34 ++++
.../rowListScene_20211008151751.brs | 34 ++++
.../rowListScene_20211008151753.brs | 34 ++++
.../rowListScene_20211010122343.xml | 13 ++
.../rowListScene_20211010122348.xml | 13 ++
.../rowListScene_20211010122743.brs | 34 ++++
.../rowListScene_20211010122855.brs | 35 ++++
.../rowListScene_20211010122902.brs | 36 +++++
.../rowListScene_20211010123116.xml | 13 ++
.../rowListScene_20211010123149.brs | 37 +++++
.../rowListScene_20211010123557.brs | 37 +++++
.../rowListScene_20211010123606.brs | 37 +++++
.../rowListScene_20211010123612.brs | 37 +++++
.../rowListScene_20211010123656.brs | 38 +++++
.../rowListScene_20211010123711.brs | 39 +++++
.../rowListScene_20211010123739.brs | 38 +++++
.../rowListScene_20211010123753.brs | 38 +++++
.../rowListScene_20211010123754.brs | 38 +++++
.../rowListScene_20211010123821.brs | 37 +++++
.../rowListScene_20211010123912.brs | 37 +++++
.../rowListScene_20211010123926.brs | 37 +++++
.../rowListScene_20211010124004.brs | 36 +++++
.../rowListScene_20211010124048.brs | 36 +++++
.../rowListScene_20211010124059.brs | 36 +++++
.../rowListScene_20211010124155.brs | 36 +++++
.../rowListScene_20211010124210.brs | 36 +++++
.../rowListScene_20211010124225.brs | 36 +++++
.../rowListScene_20211010124416.brs | 36 +++++
.../rowListScene_20211010124457.brs | 36 +++++
.../rowListScene_20211010124504.brs | 36 +++++
.../rowListScene_20211010124545.brs | 38 +++++
.../rowListScene_20211010124549.brs | 39 +++++
.../rowListScene_20211010124817.brs | 42 +++++
.../rowListScene_20211010124832.brs | 42 +++++
.../rowListScene_20211010124834.brs | 42 +++++
.../rowListScene_20211010124838.brs | 41 +++++
.../rowListScene_20211010124840.brs | 40 +++++
.../rowListScene_20211010124841.brs | 40 +++++
.../rowListScene_20211010124855.brs | 40 +++++
.../rowListScene_20211010124857.brs | 40 +++++
.../rowListScene_20211010124910.brs | 40 +++++
.../rowListScene_20211010124917.brs | 41 +++++
.../rowListScene_20211010125016.brs | 43 +++++
.../rowListScene_20211010125023.brs | 43 +++++
.../rowListScene_20211010125035.brs | 43 +++++
.../rowListScene_20211010125125.brs | 43 +++++
.../rowListScene_20211010125153.brs | 43 +++++
.../rowListScene_20211010125251.brs | 44 ++++++
.../rowListScene_20211010125317.brs | 46 ++++++
.../rowListScene_20211010125328.brs | 46 ++++++
.../rowListScene_20211010125350.brs | 49 ++++++
.../rowListScene_20211010125431.brs | 50 ++++++
.../rowListScene_20211010125509.brs | 50 ++++++
.../rowListScene_20211010125709.brs | 49 ++++++
.../rowListScene_20211010125712.brs | 49 ++++++
.../rowListScene_20211010125717.brs | 50 ++++++
.../rowListScene_20211010125756.brs | 50 ++++++
.../rowListScene_20211010125848.brs | 49 ++++++
.../rowListScene_20211010125855.brs | 49 ++++++
.../rowListScene_20211010125904.brs | 50 ++++++
.../rowListScene_20211010130310.brs | 50 ++++++
.../rowListScene_20211010130315.brs | 50 ++++++
.../rowListScene_20211010130435.brs | 50 ++++++
.../rowListScene_20211010130553.brs | 50 ++++++
.../rowListScene_20211010130642.brs | 49 ++++++
.../rowListScene_20211010130800.brs | 49 ++++++
.../rowListScene_20211010130847.brs | 49 ++++++
.../rowListScene_20211010130910.brs | 49 ++++++
.../rowListScene_20211010130927.brs | 49 ++++++
.../rowListScene_20211010131020.brs | 49 ++++++
.../rowListScene_20211010131021.brs | 49 ++++++
.../rowListScene_20211010131044.brs | 49 ++++++
.../rowListScene_20211010131134.brs | 49 ++++++
.../rowListScene_20211010131150.brs | 49 ++++++
.../rowListScene_20211010131237.brs | 49 ++++++
.../rowListScene_20211010131430.brs | 49 ++++++
.../rowListScene_20211010131442.brs | 49 ++++++
.../rowListScene_20211010131514.brs | 49 ++++++
.../rowListScene_20211010131649.brs | 49 ++++++
.../rowListScene_20211010131725.brs | 49 ++++++
.../rowListScene_20211010131734.brs | 49 ++++++
.../rowListScene_20211010132014.brs | 53 +++++++
.../rowListScene_20211010132049.brs | 53 +++++++
.../rowListScene_20211010132232.brs | 53 +++++++
.../rowListScene_20211010132443.brs | 55 +++++++
.../rowListScene_20211010132532.brs | 57 +++++++
.../rowListScene_20211010132545.brs | 56 +++++++
.../rowListScene_20211010132642.brs | 56 +++++++
.../rowListScene_20211010132714.brs | 56 +++++++
.../rowListScene_20211010132739.brs | 56 +++++++
.../rowListScene_20211010132742.brs | 56 +++++++
.../rowListScene_20211010132749.brs | 56 +++++++
.../rowListScene_20211010132943.brs | 49 ++++++
.../rowListScene_20211010132944.brs | 48 ++++++
.../rowListScene_20211010132947.brs | 49 ++++++
.../rowListScene_20211010133121.brs | 51 ++++++
.../rowListScene_20211010133129.brs | 51 ++++++
.../rowListScene_20211010133140.brs | 51 ++++++
.../rowListScene_20211010133142.brs | 51 ++++++
.../rowListScene_20211010133202.brs | 51 ++++++
.../rowListScene_20211010133442.xml | 12 ++
.../rowListScene_20211010133449.brs | 50 ++++++
.../rowListScene_20211010133458.brs | 45 ++++++
.../rowListScene_20211011134546.xml | 7 +
.../rowListScene_20211011134642.xml | 7 +
.../rowListScene_20211011134809.xml | 10 ++
.../rowListScene_20211011134907.xml | 10 ++
.../rowListScene_20211011134920.xml | 10 ++
.../rowListScene_20211011135127.xml | 11 ++
.../rowListScene_20211011135145.brs | 20 +++
.../rowListScene_20211011135201.brs | 21 +++
.../rowListScene_20211011135220.xml | 11 ++
.../rowListScene_20211011135315.xml | 12 ++
.../rowListScene_20211011135328.xml | 12 ++
.../rowListScene_20211011135342.xml | 12 ++
.../rowListScene_20211011135727.xml | 13 ++
.../rowListScene_20211011135742.xml | 13 ++
.../rowListScene_20211011135756.xml | 13 ++
.../rowListScene_20211011135757.xml | 13 ++
.../rowListScene_20211011140317.xml | 14 ++
.../rowListScene_20211011140321.xml | 14 ++
.../rowListScene_20211011142206.xml | 14 ++
.../rowListScene_20211011142420.xml | 15 ++
.../rowListScene_20211011142458.xml | 14 ++
.../rowListScene_20211011142525.brs | 22 +++
.../rowListScene_20211011142610.brs | 23 +++
.../rowListScene_20211011142646.brs | 27 ++++
.../rowListScene_20211011142657.brs | 27 ++++
.../rowListScene_20211011142700.brs | 29 ++++
.../rowListScene_20211011143048.brs | 30 ++++
.../rowListScene_20211011143119.brs | 30 ++++
.../rowListScene_20211011143203.brs | 31 ++++
.../rowListScene_20211011143204.brs | 31 ++++
.../rowListScene_20211011143521.brs | 35 ++++
.../rowListScene_20211011143557.brs | 36 +++++
.../rowListScene_20211011144019.xml | 14 ++
.../rowListScene_20211011144025.xml | 14 ++
.../rowListScene_20211011144115.xml | 14 ++
.../rowListScene_20211011144141.xml | 13 ++
.../rowListScene_20211011144330.xml | 13 ++
.../rowListScene_20211011144343.brs | 36 +++++
.../rowListScene_20211011144638.brs | 36 +++++
.../rowListScene_20211011144659.brs | 34 ++++
.../rowListScene_20211011144718.brs | 14 ++
.../rowListScene_20211011151753.xml | 25 +++
.../rowListScene_20211011151755.xml | 25 +++
.../rowListScene_20211011151829.brs | 8 +
.../rowListScene_20211011151922.xml | 25 +++
.../rowListScene_20211011152047.xml | 26 +++
.../rowListScene_20211011152054.xml | 25 +++
.../rowListScene_20211011152249.xml | 24 +++
.../rowListScene_20211011152637.xml | 23 +++
.../rowListScene_20211011152704.xml | 23 +++
.../rowListScene_20211011152741.brs | 8 +
.../rowListScene_20211011152745.brs | 8 +
.../rowListScene_20211011152820.brs | 7 +
.../rowListScene_20211011154834.xml | 23 +++
.../rowListScene_20211011154858.xml | 23 +++
.../rowListScene_20211011160212.xml | 24 +++
.../rowListScene_20211011160214.xml | 23 +++
.../rowListScene_20211011160217.xml | 23 +++
.../rowListScene_20211011160729.xml | 23 +++
.../rowListScene_20211011160824.xml | 21 +++
.../rowListScene_20211011161430.xml | 21 +++
.../rowListScene_20211011161441.brs | 5 +
.../rowListScene_20211011161505.xml | 21 +++
.../rowListScene_20211011161514.xml | 21 +++
.../rowListScene_20211011161556.xml | 21 +++
.../rowListScene_20211011161820.brs | 5 +
.../rowListScene_20211011161851.xml | 22 +++
.../rowListScene_20211011161853.xml | 22 +++
.../rowListScene_20211011161900.xml | 25 +++
.../rowListScene_20211011161906.xml | 24 +++
.../rowListScene_20211011161926.xml | 22 +++
.../rowListScene_20211011163824.xml | 22 +++
.../rowListScene_20211011163856.xml | 22 +++
.../rowListScene_20211011163858.xml | 22 +++
.../rowListScene_20211011163948.xml | 22 +++
.../rowListScene_20211011163950.xml | 22 +++
.../rowListScene_20211012030439.xml | 25 +++
.../rowListScene_20211012030442.xml | 24 +++
.../rowListScene_20211012030443.xml | 25 +++
.../rowListScene_20211012030617.xml | 25 +++
.../rowListScene_20211012030618.xml | 25 +++
.../rowListScene_20211012030641.xml | 25 +++
.../rowListScene_20211012030736.xml | 25 +++
.../rowListScene_20211012030753.xml | 25 +++
.../rowListScene_20211012030805.brs | 5 +
.../rowListScene_20211012030811.brs | 6 +
.../rowListScene_20211012031004.xml | 25 +++
.../rowListScene_20211012031006.xml | 24 +++
.../rowListScene_20211012031011.xml | 23 +++
.../rowListScene_20211012031223.brs | 4 +
.../rowListScene_20211012031226.brs | 5 +
.../rowListScene_20211012031230.brs | 5 +
.../rowListScene_20211012031231.brs | 4 +
.../rowListScene_20211012031235.brs | 4 +
.../rowListScene_20211012031408.xml | 23 +++
.../rowListScene_20211012032157.xml | 23 +++
.../rowListScene_20211012122112.xml | 23 +++
.../rowListScene_20211012122632.xml | 24 +++
.../rowListScene_20211012122658.xml | 24 +++
.../rowListScene_20211012122713.xml | 24 +++
.../rowListScene_20211012122732.xml | 24 +++
.../trickplay/trickplay_20211013105704.xml | 0
.../trickplay/trickplay_20211013105742.xml | 5 +
.../trickplay/trickplay_20211013105805.xml | 5 +
.../trickplay/trickplay_20211013105810.xml | 5 +
.../trickplay/trickplay_20211013105834.xml | 7 +
.../trickplay/trickplay_20211013105854.xml | 8 +
.../trickplay/trickplay_20211013105904.xml | 8 +
.../trickplay/trickplay_20211013105925.xml | 8 +
.../trickplay/trickplay_20211013105928.xml | 8 +
.../trickplay/trickplay_20211013105940.xml | 9 ++
.../trickplay/trickplay_20211013105959.xml | 11 ++
.../trickplay/trickplay_20211013110019.xml | 15 ++
.../trickplay/trickplay_20211013110037.xml | 15 ++
.../trickplay/trickplay_20211013110049.xml | 15 ++
.../trickplay/trickplay_20211013110104.xml | 15 ++
.../trickplay/trickplay_20211013110225.xml | 15 ++
.../trickplay/trickplay_20211013110317.xml | 15 ++
.../trickplay/trickplay_20211013110331.xml | 15 ++
.../trickplay/trickplay_20211013110335.xml | 15 ++
.../trickplay/trickplay_20211013110343.xml | 15 ++
.../trickplay/trickplay_20211013110709.xml | 15 ++
.../trickplay/trickplay_20211013110830.xml | 15 ++
.../trickplay/trickplay_20211013110853.xml | 15 ++
.../trickplay/trickplay_20211013110857.xml | 15 ++
.../trickplay/trickplay_20211013110936.xml | 16 ++
.../trickplay/trickplay_20211013111004.xml | 16 ++
.../trickplay/trickplay_20211013111014.xml | 16 ++
.../trickplay/trickplay_20211013111030.xml | 16 ++
.../trickplay/trickplay_20211013111143.xml | 16 ++
.../trickplay/trickplay_20211013111202.xml | 16 ++
.../trickplay/trickplay_20211013111214.xml | 18 +++
.../trickplay/trickplay_20211013111237.xml | 18 +++
.../trickplay/trickplay_20211013111254.xml | 20 +++
.../trickplay/trickplay_20211013111726.xml | 20 +++
.../trickplay/trickplay_20211013111834.xml | 20 +++
.../trickplay/trickplay_20211013111845.xml | 18 +++
.../trickplay/trickplay_20211013111942.xml | 18 +++
.../trickplay/trickplay_20211013112043.xml | 18 +++
.../trickplay/trickplay_20211013113737.xml | 18 +++
.../trickplay/trickplay_20211013113755.xml | 18 +++
.../trickplay/trickplay_20211013113757.xml | 18 +++
.../trickplay/trickplay_20211013114712.xml | 18 +++
components/keyboardScene.brs | 66 ++++++--
components/rowListContent.xml | 2 +-
components/rowListItem.xml | 2 +-
images/white.jpg | Bin 0 -> 14488 bytes
738 files changed, 60789 insertions(+), 18 deletions(-)
create mode 100644 .history/.gitignore_20211008145905
create mode 100644 .history/.gitignore_20211010133726
create mode 100644 .history/.gitignore_20211011133958
create mode 100644 .history/.gitignore_20211011134525
create mode 100644 .history/components/MainScreen_20161215154627.xml
create mode 100644 .history/components/MainScreen_20211011143248.xml
create mode 100644 .history/components/Play_20211012131737.brs
create mode 100644 .history/components/Play_20211012131808.brs
create mode 100644 .history/components/Play_20211012131900.brs
create mode 100644 .history/components/keyboardScene_20211012131932.brs
create mode 100644 .history/components/keyboardScene_20211012132158.brs
create mode 100644 .history/components/keyboardScene_20211012133530.brs
create mode 100644 .history/components/keyboardScene_20211012133904.brs
create mode 100644 .history/components/keyboardScene_20211012134451.brs
create mode 100644 .history/components/keyboardScene_20211012134544.brs
create mode 100644 .history/components/keyboardScene_20211012134647.brs
create mode 100644 .history/components/keyboardScene_20211012134937.brs
create mode 100644 .history/components/keyboardScene_20211012135037.brs
create mode 100644 .history/components/keyboardScene_20211012135227.brs
create mode 100644 .history/components/keyboardScene_20211012135232.brs
create mode 100644 .history/components/keyboardScene_20211012135345.brs
create mode 100644 .history/components/keyboardScene_20211012135459.brs
create mode 100644 .history/components/keyboardScene_20211012135654.brs
create mode 100644 .history/components/keyboardScene_20211012135833.brs
create mode 100644 .history/components/keyboardScene_20211012135835.brs
create mode 100644 .history/components/keyboardScene_20211012135845.brs
create mode 100644 .history/components/keyboardScene_20211012135848.brs
create mode 100644 .history/components/keyboardScene_20211012135849.brs
create mode 100644 .history/components/keyboardScene_20211012140044.brs
create mode 100644 .history/components/keyboardScene_20211012140310.brs
create mode 100644 .history/components/keyboardScene_20211012140322.brs
create mode 100644 .history/components/keyboardScene_20211012140753.brs
create mode 100644 .history/components/keyboardScene_20211012140755.brs
create mode 100644 .history/components/keyboardScene_20211012140756.brs
create mode 100644 .history/components/keyboardScene_20211012140816.brs
create mode 100644 .history/components/keyboardScene_20211012140911.brs
create mode 100644 .history/components/keyboardScene_20211012140929.brs
create mode 100644 .history/components/keyboardScene_20211012140932.brs
create mode 100644 .history/components/keyboardScene_20211012140933.brs
create mode 100644 .history/components/keyboardScene_20211012140937.brs
create mode 100644 .history/components/keyboardScene_20211012141120.brs
create mode 100644 .history/components/keyboardScene_20211012141140.brs
create mode 100644 .history/components/keyboardScene_20211012141147.brs
create mode 100644 .history/components/keyboardScene_20211012141326.brs
create mode 100644 .history/components/keyboardScene_20211012141443.brs
create mode 100644 .history/components/keyboardScene_20211012141637.brs
create mode 100644 .history/components/keyboardScene_20211012141641.brs
create mode 100644 .history/components/keyboardScene_20211012141813.brs
create mode 100644 .history/components/keyboardScene_20211012141843.brs
create mode 100644 .history/components/keyboardScene_20211012141913.brs
create mode 100644 .history/components/keyboardScene_20211012141947.brs
create mode 100644 .history/components/keyboardScene_20211012142027.brs
create mode 100644 .history/components/keyboardScene_20211012142112.brs
create mode 100644 .history/components/keyboardScene_20211012142206.brs
create mode 100644 .history/components/keyboardScene_20211012142301.brs
create mode 100644 .history/components/keyboardScene_20211012142428.brs
create mode 100644 .history/components/keyboardScene_20211012142431.brs
create mode 100644 .history/components/keyboardScene_20211012142554.brs
create mode 100644 .history/components/keyboardScene_20211012142834.brs
create mode 100644 .history/components/keyboardScene_20211012142946.brs
create mode 100644 .history/components/keyboardScene_20211012143030.brs
create mode 100644 .history/components/keyboardScene_20211012143106.brs
create mode 100644 .history/components/keyboardScene_20211012143144.brs
create mode 100644 .history/components/keyboardScene_20211012143255.brs
create mode 100644 .history/components/keyboardScene_20211012143425.brs
create mode 100644 .history/components/keyboardScene_20211012143432.brs
create mode 100644 .history/components/keyboardScene_20211012143506.brs
create mode 100644 .history/components/keyboardScene_20211012143547.brs
create mode 100644 .history/components/keyboardScene_20211012143803.brs
create mode 100644 .history/components/keyboardScene_20211012143849.brs
create mode 100644 .history/components/keyboardScene_20211012144059.brs
create mode 100644 .history/components/keyboardScene_20211012144148.brs
create mode 100644 .history/components/keyboardScene_20211012144149.brs
create mode 100644 .history/components/keyboardScene_20211012144401.brs
create mode 100644 .history/components/keyboardScene_20211012144506.brs
create mode 100644 .history/components/keyboardScene_20211012144537.brs
create mode 100644 .history/components/keyboardScene_20211012144610.brs
create mode 100644 .history/components/keyboardScene_20211012144744.brs
create mode 100644 .history/components/keyboardScene_20211012144754.brs
create mode 100644 .history/components/keyboardScene_20211012144806.brs
create mode 100644 .history/components/keyboardScene_20211012144812.brs
create mode 100644 .history/components/keyboardScene_20211012144825.brs
create mode 100644 .history/components/keyboardScene_20211012145038.brs
create mode 100644 .history/components/keyboardScene_20211012145051.brs
create mode 100644 .history/components/keyboardScene_20211012145100.brs
create mode 100644 .history/components/keyboardScene_20211012145914.brs
create mode 100644 .history/components/keyboardScene_20211012145926.brs
create mode 100644 .history/components/keyboardScene_20211012150040.brs
create mode 100644 .history/components/keyboardScene_20211012150053.brs
create mode 100644 .history/components/keyboardScene_20211012150212.brs
create mode 100644 .history/components/keyboardScene_20211012150318.brs
create mode 100644 .history/components/keyboardScene_20211012150319.brs
create mode 100644 .history/components/keyboardScene_20211012150416.brs
create mode 100644 .history/components/keyboardScene_20211012150424.brs
create mode 100644 .history/components/keyboardScene_20211012150555.brs
create mode 100644 .history/components/keyboardScene_20211012150601.brs
create mode 100644 .history/components/keyboardScene_20211012150644.brs
create mode 100644 .history/components/keyboardScene_20211012150915.brs
create mode 100644 .history/components/keyboardScene_20211012150920.brs
create mode 100644 .history/components/keyboardScene_20211012151005.brs
create mode 100644 .history/components/keyboardScene_20211012151105.brs
create mode 100644 .history/components/keyboardScene_20211012151115.brs
create mode 100644 .history/components/keyboardScene_20211012151125.brs
create mode 100644 .history/components/keyboardScene_20211012151129.brs
create mode 100644 .history/components/keyboardScene_20211012151328.brs
create mode 100644 .history/components/keyboardScene_20211012151452.brs
create mode 100644 .history/components/keyboardScene_20211012151718.brs
create mode 100644 .history/components/keyboardScene_20211012151724.brs
create mode 100644 .history/components/keyboardScene_20211012151741.brs
create mode 100644 .history/components/keyboardScene_20211012151753.brs
create mode 100644 .history/components/keyboardScene_20211012151815.brs
create mode 100644 .history/components/keyboardScene_20211012151941.brs
create mode 100644 .history/components/keyboardScene_20211012151947.brs
create mode 100644 .history/components/keyboardScene_20211012152121.brs
create mode 100644 .history/components/keyboardScene_20211012152125.brs
create mode 100644 .history/components/keyboardScene_20211012152229.brs
create mode 100644 .history/components/keyboardScene_20211012152237.brs
create mode 100644 .history/components/keyboardScene_20211012152352.brs
create mode 100644 .history/components/keyboardScene_20211012152354.brs
create mode 100644 .history/components/keyboardScene_20211012152507.brs
create mode 100644 .history/components/keyboardScene_20211012152518.brs
create mode 100644 .history/components/keyboardScene_20211012152520.brs
create mode 100644 .history/components/keyboardScene_20211013084544.brs
create mode 100644 .history/components/keyboardScene_20211013084609.brs
create mode 100644 .history/components/keyboardScene_20211013084830.brs
create mode 100644 .history/components/keyboardScene_20211013084919.brs
create mode 100644 .history/components/keyboardScene_20211013084931.brs
create mode 100644 .history/components/keyboardScene_20211013084953.brs
create mode 100644 .history/components/keyboardScene_20211013085016.brs
create mode 100644 .history/components/keyboardScene_20211013085019.brs
create mode 100644 .history/components/keyboardScene_20211013085029.brs
create mode 100644 .history/components/keyboardScene_20211013085134.brs
create mode 100644 .history/components/keyboardScene_20211013085212.brs
create mode 100644 .history/components/keyboardScene_20211013085303.brs
create mode 100644 .history/components/keyboardScene_20211013085427.brs
create mode 100644 .history/components/keyboardScene_20211013085504.brs
create mode 100644 .history/components/keyboardScene_20211013085622.brs
create mode 100644 .history/components/keyboardScene_20211013085645.brs
create mode 100644 .history/components/keyboardScene_20211013085719.brs
create mode 100644 .history/components/keyboardScene_20211013085937.brs
create mode 100644 .history/components/keyboardScene_20211013085941.brs
create mode 100644 .history/components/keyboardScene_20211013090029.brs
create mode 100644 .history/components/keyboardScene_20211013090032.brs
create mode 100644 .history/components/keyboardScene_20211013090124.brs
create mode 100644 .history/components/keyboardScene_20211013090236.brs
create mode 100644 .history/components/keyboardScene_20211013090237.brs
create mode 100644 .history/components/keyboardScene_20211013090246.brs
create mode 100644 .history/components/keyboardScene_20211013090357.brs
create mode 100644 .history/components/keyboardScene_20211013090424.brs
create mode 100644 .history/components/keyboardScene_20211013090428.brs
create mode 100644 .history/components/keyboardScene_20211013090430.brs
create mode 100644 .history/components/keyboardScene_20211013090606.brs
create mode 100644 .history/components/keyboardScene_20211013090650.brs
create mode 100644 .history/components/keyboardScene_20211013091239.brs
create mode 100644 .history/components/keyboardScene_20211013091250.brs
create mode 100644 .history/components/keyboardScene_20211013091409.brs
create mode 100644 .history/components/keyboardScene_20211013091433.brs
create mode 100644 .history/components/keyboardScene_20211013091435.brs
create mode 100644 .history/components/keyboardScene_20211013091614.brs
create mode 100644 .history/components/keyboardScene_20211013091744.brs
create mode 100644 .history/components/keyboardScene_20211013091801.brs
create mode 100644 .history/components/keyboardScene_20211013091824.brs
create mode 100644 .history/components/keyboardScene_20211013091843.brs
create mode 100644 .history/components/keyboardScene_20211013092139.brs
create mode 100644 .history/components/keyboardScene_20211013092550.brs
create mode 100644 .history/components/keyboardScene_20211013092609.brs
create mode 100644 .history/components/keyboardScene_20211013092733.brs
create mode 100644 .history/components/keyboardScene_20211013092747.brs
create mode 100644 .history/components/keyboardScene_20211013093145.brs
create mode 100644 .history/components/keyboardScene_20211013093216.brs
create mode 100644 .history/components/keyboardScene_20211013093416.brs
create mode 100644 .history/components/keyboardScene_20211013093425.brs
create mode 100644 .history/components/keyboardScene_20211013093427.brs
create mode 100644 .history/components/keyboardScene_20211013093435.brs
create mode 100644 .history/components/keyboardScene_20211013093609.brs
create mode 100644 .history/components/keyboardScene_20211013093716.brs
create mode 100644 .history/components/keyboardScene_20211013093742.brs
create mode 100644 .history/components/keyboardScene_20211013093901.brs
create mode 100644 .history/components/keyboardScene_20211013094038.brs
create mode 100644 .history/components/keyboardScene_20211013094149.brs
create mode 100644 .history/components/keyboardScene_20211013094200.brs
create mode 100644 .history/components/keyboardScene_20211013094215.brs
create mode 100644 .history/components/keyboardScene_20211013094311.brs
create mode 100644 .history/components/keyboardScene_20211013094327.brs
create mode 100644 .history/components/keyboardScene_20211013094446.brs
create mode 100644 .history/components/keyboardScene_20211013094518.brs
create mode 100644 .history/components/keyboardScene_20211013094725.brs
create mode 100644 .history/components/keyboardScene_20211013094755.brs
create mode 100644 .history/components/keyboardScene_20211013094801.brs
create mode 100644 .history/components/keyboardScene_20211013094955.brs
create mode 100644 .history/components/keyboardScene_20211013095125.brs
create mode 100644 .history/components/keyboardScene_20211013095129.brs
create mode 100644 .history/components/keyboardScene_20211013095302.brs
create mode 100644 .history/components/keyboardScene_20211013095309.brs
create mode 100644 .history/components/keyboardScene_20211013095313.brs
create mode 100644 .history/components/keyboardScene_20211013095352.brs
create mode 100644 .history/components/keyboardScene_20211013095507.brs
create mode 100644 .history/components/keyboardScene_20211013095619.brs
create mode 100644 .history/components/keyboardScene_20211013095915.brs
create mode 100644 .history/components/keyboardScene_20211013100109.brs
create mode 100644 .history/components/keyboardScene_20211013100114.brs
create mode 100644 .history/components/keyboardScene_20211013100321.brs
create mode 100644 .history/components/keyboardScene_20211013100413.brs
create mode 100644 .history/components/keyboardScene_20211013100611.brs
create mode 100644 .history/components/keyboardScene_20211013100704.brs
create mode 100644 .history/components/keyboardScene_20211013100732.brs
create mode 100644 .history/components/keyboardScene_20211013100741.brs
create mode 100644 .history/components/keyboardScene_20211013101010.brs
create mode 100644 .history/components/keyboardScene_20211013101053.brs
create mode 100644 .history/components/keyboardScene_20211013101209.brs
create mode 100644 .history/components/keyboardScene_20211013101219.brs
create mode 100644 .history/components/keyboardScene_20211013101612.brs
create mode 100644 .history/components/keyboardScene_20211013101628.brs
create mode 100644 .history/components/keyboardScene_20211013101701.brs
create mode 100644 .history/components/keyboardScene_20211013101702.brs
create mode 100644 .history/components/keyboardScene_20211013101804.brs
create mode 100644 .history/components/keyboardScene_20211013101906.brs
create mode 100644 .history/components/keyboardScene_20211013102044.brs
create mode 100644 .history/components/keyboardScene_20211013102050.brs
create mode 100644 .history/components/keyboardScene_20211013102112.brs
create mode 100644 .history/components/keyboardScene_20211013102231.brs
create mode 100644 .history/components/keyboardScene_20211013102345.brs
create mode 100644 .history/components/keyboardScene_20211013102451.brs
create mode 100644 .history/components/keyboardScene_20211013102459.brs
create mode 100644 .history/components/keyboardScene_20211013102726.brs
create mode 100644 .history/components/keyboardScene_20211013102731.brs
create mode 100644 .history/components/keyboardScene_20211013102735.brs
create mode 100644 .history/components/keyboardScene_20211013102942.brs
create mode 100644 .history/components/keyboardScene_20211013103048.brs
create mode 100644 .history/components/keyboardScene_20211013103053.brs
create mode 100644 .history/components/keyboardScene_20211013103117.brs
create mode 100644 .history/components/keyboardScene_20211013103253.brs
create mode 100644 .history/components/keyboardScene_20211013103329.brs
create mode 100644 .history/components/keyboardScene_20211013103340.brs
create mode 100644 .history/components/keyboardScene_20211013103508.brs
create mode 100644 .history/components/keyboardScene_20211013103610.brs
create mode 100644 .history/components/keyboardScene_20211013103822.brs
create mode 100644 .history/components/keyboardScene_20211013104007.brs
create mode 100644 .history/components/keyboardScene_20211013104125.brs
create mode 100644 .history/components/keyboardScene_20211013104129.brs
create mode 100644 .history/components/keyboardScene_20211013104607.brs
create mode 100644 .history/components/keyboardScene_20211013111804.brs
create mode 100644 .history/components/keyboardScene_20211013112056.brs
create mode 100644 .history/components/keyboardScene_20211013112130.brs
create mode 100644 .history/components/keyboardScene_20211013112734.brs
create mode 100644 .history/components/keyboardScene_20211013112809.brs
create mode 100644 .history/components/keyboardScene_20211013112832.brs
create mode 100644 .history/components/keyboardScene_20211013112904.brs
create mode 100644 .history/components/keyboardScene_20211013112911.brs
create mode 100644 .history/components/keyboardScene_20211013112916.brs
create mode 100644 .history/components/keyboardScene_20211013112931.brs
create mode 100644 .history/components/keyboardScene_20211013112957.brs
create mode 100644 .history/components/keyboardScene_20211013113346.brs
create mode 100644 .history/components/keyboardScene_20211013113353.brs
create mode 100644 .history/components/keyboardScene_20211013113420.brs
create mode 100644 .history/components/keyboardScene_20211013113430.brs
create mode 100644 .history/components/keyboardScene_20211013113434.brs
create mode 100644 .history/components/keyboardScene_20211013113448.brs
create mode 100644 .history/components/keyboardScene_20211013113930.brs
create mode 100644 .history/components/keyboardScene_20211013114149.brs
create mode 100644 .history/components/keyboardScene_20211013114208.brs
create mode 100644 .history/components/keyboardScene_20211013114259.brs
create mode 100644 .history/components/keyboardScene_20211013114359.brs
create mode 100644 .history/components/keyboardScene_20211013114558.brs
create mode 100644 .history/components/keyboardScene_20211013114601.brs
create mode 100644 .history/components/keyboardScene_20211013114638.brs
create mode 100644 .history/components/keyboardScene_20211013114900.brs
create mode 100644 .history/components/keyboardScene_20211013114903.brs
create mode 100644 .history/components/keyboardScene_20211013114922.brs
create mode 100644 .history/components/keyboardScene_20211013114926.brs
create mode 100644 .history/components/keyboardScene_20211013115137.brs
create mode 100644 .history/components/keyboardScene_20211013115148.brs
create mode 100644 .history/components/keyboardScene_20211013115449.brs
create mode 100644 .history/components/keyboardScene_20211013115508.brs
create mode 100644 .history/components/keyboardScene_20211013115641.brs
create mode 100644 .history/components/keyboardScene_20211013115642.brs
create mode 100644 .history/components/keyboardScene_20211013120029.brs
create mode 100644 .history/components/keyboardScene_20211013120221.brs
create mode 100644 .history/components/keyboardScene_20211013120222.brs
create mode 100644 .history/components/keyboardScene_20211013120224.brs
create mode 100644 .history/components/keyboardScene_20211013120310.brs
create mode 100644 .history/components/keyboardScene_20211013120433.brs
create mode 100644 .history/components/keyboardScene_20211013120455.brs
create mode 100644 .history/components/keyboardScene_20211013120556.brs
create mode 100644 .history/components/keyboardScene_20211013120716.brs
create mode 100644 .history/components/keyboardScene_20211013120749.brs
create mode 100644 .history/components/keyboardScene_20211013120941.brs
create mode 100644 .history/components/keyboardScene_20211013120950.brs
create mode 100644 .history/components/keyboardScene_20211013121009.brs
create mode 100644 .history/components/keyboardScene_20211013121301.brs
create mode 100644 .history/components/keyboardScene_20211013121308.brs
create mode 100644 .history/components/keyboardScene_20211013121430.brs
create mode 100644 .history/components/keyboardScene_20211013121510.brs
create mode 100644 .history/components/keyboardScene_20211013121513.brs
create mode 100644 .history/components/keyboardScene_20211013121642.brs
create mode 100644 .history/components/keyboardScene_20211013121733.brs
create mode 100644 .history/components/keyboardScene_20211013121813.brs
create mode 100644 .history/components/keyboardScene_20211013121920.brs
create mode 100644 .history/components/keyboardScene_20211013122052.brs
create mode 100644 .history/components/keyboardScene_20211013122203.brs
create mode 100644 .history/components/keyboardScene_20211013122255.brs
create mode 100644 .history/components/keyboardScene_20211013122346.brs
create mode 100644 .history/components/keyboardScene_20211013122751.brs
create mode 100644 .history/components/keyboardScene_20211013122827.brs
create mode 100644 .history/components/keyboardScene_20211013122956.brs
create mode 100644 .history/components/keyboardScene_20211013123106.brs
create mode 100644 .history/components/keyboardScene_20211013123338.brs
create mode 100644 .history/components/keyboardScene_20211013123348.brs
create mode 100644 .history/components/keyboardScene_20211013123553.brs
create mode 100644 .history/components/keyboardScene_20211013123635.brs
create mode 100644 .history/components/keyboardScene_20211013123640.brs
create mode 100644 .history/components/keyboardScene_20211013123711.brs
create mode 100644 .history/components/keyboardScene_20211013123930.brs
create mode 100644 .history/components/keyboardScene_20211013123941.brs
create mode 100644 .history/components/keyboardScene_20211013124048.brs
create mode 100644 .history/components/keyboardScene_20211013124103.brs
create mode 100644 .history/components/keyboardScene_20211013124315.brs
create mode 100644 .history/components/keyboardScene_20211013124342.brs
create mode 100644 .history/components/keyboardScene_20211013124356.brs
create mode 100644 .history/components/keyboardScene_20211013124407.brs
create mode 100644 .history/components/keyboardScene_20211013124600.brs
create mode 100644 .history/components/keyboardScene_20211013124601.brs
create mode 100644 .history/components/keyboardScene_20211013124605.brs
create mode 100644 .history/components/keyboardScene_20211013124801.brs
create mode 100644 .history/components/keyboardScene_20211013124803.brs
create mode 100644 .history/components/keyboardScene_20211013124813.brs
create mode 100644 .history/components/keyboardScene_20211013124917.brs
create mode 100644 .history/components/keyboardScene_20211013125042.brs
create mode 100644 .history/components/keyboardScene_20211013125125.brs
create mode 100644 .history/components/keyboardScene_20211013125245.brs
create mode 100644 .history/components/keyboardScene_20211013125422.brs
create mode 100644 .history/components/keyboardScene_20211013125550.brs
create mode 100644 .history/components/keyboardScene_20211013125740.brs
create mode 100644 .history/components/keyboardScene_20211013125813.brs
create mode 100644 .history/components/keyboardScene_20211013130232.brs
create mode 100644 .history/components/keyboardScene_20211013130255.brs
create mode 100644 .history/components/keyboardScene_20211013130450.brs
create mode 100644 .history/components/keyboardScene_20211013130504.brs
create mode 100644 .history/components/keyboardScene_20211013130610.brs
create mode 100644 .history/components/keyboardScene_20211013130615.brs
create mode 100644 .history/components/keyboardScene_20211013130800.brs
create mode 100644 .history/components/keyboardScene_20211013130841.brs
create mode 100644 .history/components/keyboardScene_20211013130923.brs
create mode 100644 .history/components/keyboardScene_20211013131007.brs
create mode 100644 .history/components/keyboardScene_20211013131022.brs
create mode 100644 .history/components/keyboardScene_20211013131110.brs
create mode 100644 .history/components/keyboardScene_20211013131111.brs
create mode 100644 .history/components/keyboardScene_20211013131430.brs
create mode 100644 .history/components/keyboardScene_20211013131507.brs
create mode 100644 .history/components/keyboardScene_20211013131514.brs
create mode 100644 .history/components/keyboardScene_20211013131516.brs
create mode 100644 .history/components/keyboardScene_20211013131537.brs
create mode 100644 .history/components/keyboardScene_20211013131756.brs
create mode 100644 .history/components/keyboardScene_20211013131908.brs
create mode 100644 .history/components/keyboardScene_20211013131909.brs
create mode 100644 .history/components/keyboardScene_20211013131944.brs
create mode 100644 .history/components/keyboardScene_20211013132015.brs
create mode 100644 .history/components/keyboardScene_20211013132042.brs
create mode 100644 .history/components/keyboardScene_20211013132113.brs
create mode 100644 .history/components/keyboardScene_20211013132154.brs
create mode 100644 .history/components/keyboardScene_20211013132231.brs
create mode 100644 .history/components/keyboardScene_20211013132325.brs
create mode 100644 .history/components/keyboardScene_20211013132328.brs
create mode 100644 .history/components/keyboardScene_20211013132822.brs
create mode 100644 .history/components/keyboardScene_20211013132836.brs
create mode 100644 .history/components/keyboardScene_20211013132919.brs
create mode 100644 .history/components/keyboardScene_20211013132923.brs
create mode 100644 .history/components/keyboardScene_20211013133140.brs
create mode 100644 .history/components/keyboardScene_20211013133235.brs
create mode 100644 .history/components/keyboardScene_20211013133307.brs
create mode 100644 .history/components/keyboardScene_20211013133351.brs
create mode 100644 .history/components/keyboardScene_20211013133354.brs
create mode 100644 .history/components/keyboardScene_20211013133416.brs
create mode 100644 .history/components/keyboardScene_20211013133531.brs
create mode 100644 .history/components/keyboardScene_20211013133535.brs
create mode 100644 .history/components/keyboardScene_20211013133645.brs
create mode 100644 .history/components/keyboardScene_20211013133851.brs
create mode 100644 .history/components/keyboardScene_20211013133853.brs
create mode 100644 .history/components/keyboardScene_20211013133936.brs
create mode 100644 .history/components/keyboardScene_20211013134505.brs
create mode 100644 .history/components/keyboardScene_20211013134544.brs
create mode 100644 .history/components/keyboardScene_20211013134546.brs
create mode 100644 .history/components/keyboardScene_20211013134551.brs
create mode 100644 .history/components/keyboardScene_20211013134614.brs
create mode 100644 .history/components/keyboardScene_20211013134659.brs
create mode 100644 .history/components/keyboardScene_20211013134857.brs
create mode 100644 .history/components/keyboardScene_20211013134858.brs
create mode 100644 .history/components/keyboardScene_20211013134903.brs
create mode 100644 .history/components/keyboardScene_20211013134949.brs
create mode 100644 .history/components/keyboardScene_20211013135052.brs
create mode 100644 .history/components/keyboardScene_20211013135201.brs
create mode 100644 .history/components/keyboardScene_20211013135245.brs
create mode 100644 .history/components/keyboardScene_20211013135311.brs
create mode 100644 .history/components/keyboardScene_20211013135323.brs
create mode 100644 .history/components/keyboardScene_20211013135421.brs
create mode 100644 .history/components/keyboardScene_20211013135423.brs
create mode 100644 .history/components/keyboardScene_20211013135438.brs
create mode 100644 .history/components/keyboardScene_20211013135941.brs
create mode 100644 .history/components/keyboardScene_20211013140045.brs
create mode 100644 .history/components/keyboardScene_20211013140050.brs
create mode 100644 .history/components/keyboardScene_20211013140143.brs
create mode 100644 .history/components/keyboardScene_20211013140205.brs
create mode 100644 .history/components/keyboardScene_20211013140225.brs
create mode 100644 .history/components/keyboardScene_20211013140252.brs
create mode 100644 .history/components/keyboardScene_20211013140501.brs
create mode 100644 .history/components/keyboardScene_20211013140635.brs
create mode 100644 .history/components/keyboardScene_20211013140749.brs
create mode 100644 .history/components/keyboardScene_20211013140847.brs
create mode 100644 .history/components/keyboardScene_20211013141218.brs
create mode 100644 .history/components/keyboardScene_20211013142600.brs
create mode 100644 .history/components/keyboardScene_20211013142605.brs
create mode 100644 .history/components/keyboardScene_20211013143004.brs
create mode 100644 .history/components/keyboardScene_20211013143124.brs
create mode 100644 .history/components/keyboardScene_20211013143327.brs
create mode 100644 .history/components/keyboardScene_20211013143425.brs
create mode 100644 .history/components/keyboardScene_20211013143546.brs
create mode 100644 .history/components/keyboardScene_20211013144033.brs
create mode 100644 .history/components/keyboardScene_20211013144219.brs
create mode 100644 .history/components/keyboardScene_20211013144311.brs
create mode 100644 .history/components/keyboardScene_20211013144317.brs
create mode 100644 .history/components/keyboardScene_20211013144410.brs
create mode 100644 .history/components/keyboardScene_20211013144558.brs
create mode 100644 .history/components/keyboardScene_20211013144626.brs
create mode 100644 .history/components/keyboardScene_20211013144935.brs
create mode 100644 .history/components/keyboardScene_20211013144950.brs
create mode 100644 .history/components/keyboardScene_20211013145019.brs
create mode 100644 .history/components/keyboardScene_20211013145139.brs
create mode 100644 .history/components/keyboardScene_20211013145506.brs
create mode 100644 .history/components/keyboardScene_20211013145513.brs
create mode 100644 .history/components/keyboardScene_20211013145610.brs
create mode 100644 .history/components/keyboardScene_20211013145626.brs
create mode 100644 .history/components/keyboardScene_20211013145743.brs
create mode 100644 .history/components/keyboardScene_20211013145848.brs
create mode 100644 .history/components/keyboardScene_20211013145849.brs
create mode 100644 .history/components/keyboardScene_20211013145926.brs
create mode 100644 .history/components/keyboardScene_20211013150159.brs
create mode 100644 .history/components/keyboardScene_20211013150327.brs
create mode 100644 .history/components/keyboardScene_20211013150822.brs
create mode 100644 .history/components/keyboardScene_20211013151157.brs
create mode 100644 .history/components/play_20211012131733.xml
create mode 100644 .history/components/play_20211012131742.xml
create mode 100644 .history/components/rowListContent_20211008145905.brs
create mode 100644 .history/components/rowListContent_20211010122436.xml
create mode 100644 .history/components/rowListContent_20211010122446.brs
create mode 100644 .history/components/rowListContent_20211010122452.xml
create mode 100644 .history/components/rowListContent_20211011134627.xml
create mode 100644 .history/components/rowListContent_20211012145223.xml
create mode 100644 .history/components/rowListItem_20211010122403.xml
create mode 100644 .history/components/rowListItem_20211010122413.xml
create mode 100644 .history/components/rowListItem_20211010122425.xml
create mode 100644 .history/components/rowListItem_20211011134635.xml
create mode 100644 .history/components/rowListItem_20211012145217.xml
create mode 100644 .history/components/rowListScene_20211008145905.brs
create mode 100644 .history/components/rowListScene_20211008145905.xml
create mode 100644 .history/components/rowListScene_20211008145927.xml
create mode 100644 .history/components/rowListScene_20211008150133.xml
create mode 100644 .history/components/rowListScene_20211008150134.xml
create mode 100644 .history/components/rowListScene_20211008150139.xml
create mode 100644 .history/components/rowListScene_20211008150146.xml
create mode 100644 .history/components/rowListScene_20211008150412.brs
create mode 100644 .history/components/rowListScene_20211008150439.brs
create mode 100644 .history/components/rowListScene_20211008150452.brs
create mode 100644 .history/components/rowListScene_20211008150508.brs
create mode 100644 .history/components/rowListScene_20211008150514.brs
create mode 100644 .history/components/rowListScene_20211008150559.brs
create mode 100644 .history/components/rowListScene_20211008150612.brs
create mode 100644 .history/components/rowListScene_20211008150619.brs
create mode 100644 .history/components/rowListScene_20211008150659.brs
create mode 100644 .history/components/rowListScene_20211008150803.brs
create mode 100644 .history/components/rowListScene_20211008150813.brs
create mode 100644 .history/components/rowListScene_20211008150839.brs
create mode 100644 .history/components/rowListScene_20211008150851.brs
create mode 100644 .history/components/rowListScene_20211008150910.brs
create mode 100644 .history/components/rowListScene_20211008150944.brs
create mode 100644 .history/components/rowListScene_20211008151000.brs
create mode 100644 .history/components/rowListScene_20211008151026.brs
create mode 100644 .history/components/rowListScene_20211008151203.xml
create mode 100644 .history/components/rowListScene_20211008151217.brs
create mode 100644 .history/components/rowListScene_20211008151221.xml
create mode 100644 .history/components/rowListScene_20211008151233.brs
create mode 100644 .history/components/rowListScene_20211008151244.brs
create mode 100644 .history/components/rowListScene_20211008151305.brs
create mode 100644 .history/components/rowListScene_20211008151346.xml
create mode 100644 .history/components/rowListScene_20211008151554.brs
create mode 100644 .history/components/rowListScene_20211008151601.xml
create mode 100644 .history/components/rowListScene_20211008151608.brs
create mode 100644 .history/components/rowListScene_20211008151648.brs
create mode 100644 .history/components/rowListScene_20211008151716.brs
create mode 100644 .history/components/rowListScene_20211008151748.brs
create mode 100644 .history/components/rowListScene_20211008151751.brs
create mode 100644 .history/components/rowListScene_20211008151753.brs
create mode 100644 .history/components/rowListScene_20211010122343.xml
create mode 100644 .history/components/rowListScene_20211010122348.xml
create mode 100644 .history/components/rowListScene_20211010122743.brs
create mode 100644 .history/components/rowListScene_20211010122855.brs
create mode 100644 .history/components/rowListScene_20211010122902.brs
create mode 100644 .history/components/rowListScene_20211010123116.xml
create mode 100644 .history/components/rowListScene_20211010123149.brs
create mode 100644 .history/components/rowListScene_20211010123557.brs
create mode 100644 .history/components/rowListScene_20211010123606.brs
create mode 100644 .history/components/rowListScene_20211010123612.brs
create mode 100644 .history/components/rowListScene_20211010123656.brs
create mode 100644 .history/components/rowListScene_20211010123711.brs
create mode 100644 .history/components/rowListScene_20211010123739.brs
create mode 100644 .history/components/rowListScene_20211010123753.brs
create mode 100644 .history/components/rowListScene_20211010123754.brs
create mode 100644 .history/components/rowListScene_20211010123821.brs
create mode 100644 .history/components/rowListScene_20211010123912.brs
create mode 100644 .history/components/rowListScene_20211010123926.brs
create mode 100644 .history/components/rowListScene_20211010124004.brs
create mode 100644 .history/components/rowListScene_20211010124048.brs
create mode 100644 .history/components/rowListScene_20211010124059.brs
create mode 100644 .history/components/rowListScene_20211010124155.brs
create mode 100644 .history/components/rowListScene_20211010124210.brs
create mode 100644 .history/components/rowListScene_20211010124225.brs
create mode 100644 .history/components/rowListScene_20211010124416.brs
create mode 100644 .history/components/rowListScene_20211010124457.brs
create mode 100644 .history/components/rowListScene_20211010124504.brs
create mode 100644 .history/components/rowListScene_20211010124545.brs
create mode 100644 .history/components/rowListScene_20211010124549.brs
create mode 100644 .history/components/rowListScene_20211010124817.brs
create mode 100644 .history/components/rowListScene_20211010124832.brs
create mode 100644 .history/components/rowListScene_20211010124834.brs
create mode 100644 .history/components/rowListScene_20211010124838.brs
create mode 100644 .history/components/rowListScene_20211010124840.brs
create mode 100644 .history/components/rowListScene_20211010124841.brs
create mode 100644 .history/components/rowListScene_20211010124855.brs
create mode 100644 .history/components/rowListScene_20211010124857.brs
create mode 100644 .history/components/rowListScene_20211010124910.brs
create mode 100644 .history/components/rowListScene_20211010124917.brs
create mode 100644 .history/components/rowListScene_20211010125016.brs
create mode 100644 .history/components/rowListScene_20211010125023.brs
create mode 100644 .history/components/rowListScene_20211010125035.brs
create mode 100644 .history/components/rowListScene_20211010125125.brs
create mode 100644 .history/components/rowListScene_20211010125153.brs
create mode 100644 .history/components/rowListScene_20211010125251.brs
create mode 100644 .history/components/rowListScene_20211010125317.brs
create mode 100644 .history/components/rowListScene_20211010125328.brs
create mode 100644 .history/components/rowListScene_20211010125350.brs
create mode 100644 .history/components/rowListScene_20211010125431.brs
create mode 100644 .history/components/rowListScene_20211010125509.brs
create mode 100644 .history/components/rowListScene_20211010125709.brs
create mode 100644 .history/components/rowListScene_20211010125712.brs
create mode 100644 .history/components/rowListScene_20211010125717.brs
create mode 100644 .history/components/rowListScene_20211010125756.brs
create mode 100644 .history/components/rowListScene_20211010125848.brs
create mode 100644 .history/components/rowListScene_20211010125855.brs
create mode 100644 .history/components/rowListScene_20211010125904.brs
create mode 100644 .history/components/rowListScene_20211010130310.brs
create mode 100644 .history/components/rowListScene_20211010130315.brs
create mode 100644 .history/components/rowListScene_20211010130435.brs
create mode 100644 .history/components/rowListScene_20211010130553.brs
create mode 100644 .history/components/rowListScene_20211010130642.brs
create mode 100644 .history/components/rowListScene_20211010130800.brs
create mode 100644 .history/components/rowListScene_20211010130847.brs
create mode 100644 .history/components/rowListScene_20211010130910.brs
create mode 100644 .history/components/rowListScene_20211010130927.brs
create mode 100644 .history/components/rowListScene_20211010131020.brs
create mode 100644 .history/components/rowListScene_20211010131021.brs
create mode 100644 .history/components/rowListScene_20211010131044.brs
create mode 100644 .history/components/rowListScene_20211010131134.brs
create mode 100644 .history/components/rowListScene_20211010131150.brs
create mode 100644 .history/components/rowListScene_20211010131237.brs
create mode 100644 .history/components/rowListScene_20211010131430.brs
create mode 100644 .history/components/rowListScene_20211010131442.brs
create mode 100644 .history/components/rowListScene_20211010131514.brs
create mode 100644 .history/components/rowListScene_20211010131649.brs
create mode 100644 .history/components/rowListScene_20211010131725.brs
create mode 100644 .history/components/rowListScene_20211010131734.brs
create mode 100644 .history/components/rowListScene_20211010132014.brs
create mode 100644 .history/components/rowListScene_20211010132049.brs
create mode 100644 .history/components/rowListScene_20211010132232.brs
create mode 100644 .history/components/rowListScene_20211010132443.brs
create mode 100644 .history/components/rowListScene_20211010132532.brs
create mode 100644 .history/components/rowListScene_20211010132545.brs
create mode 100644 .history/components/rowListScene_20211010132642.brs
create mode 100644 .history/components/rowListScene_20211010132714.brs
create mode 100644 .history/components/rowListScene_20211010132739.brs
create mode 100644 .history/components/rowListScene_20211010132742.brs
create mode 100644 .history/components/rowListScene_20211010132749.brs
create mode 100644 .history/components/rowListScene_20211010132943.brs
create mode 100644 .history/components/rowListScene_20211010132944.brs
create mode 100644 .history/components/rowListScene_20211010132947.brs
create mode 100644 .history/components/rowListScene_20211010133121.brs
create mode 100644 .history/components/rowListScene_20211010133129.brs
create mode 100644 .history/components/rowListScene_20211010133140.brs
create mode 100644 .history/components/rowListScene_20211010133142.brs
create mode 100644 .history/components/rowListScene_20211010133202.brs
create mode 100644 .history/components/rowListScene_20211010133442.xml
create mode 100644 .history/components/rowListScene_20211010133449.brs
create mode 100644 .history/components/rowListScene_20211010133458.brs
create mode 100644 .history/components/rowListScene_20211011134546.xml
create mode 100644 .history/components/rowListScene_20211011134642.xml
create mode 100644 .history/components/rowListScene_20211011134809.xml
create mode 100644 .history/components/rowListScene_20211011134907.xml
create mode 100644 .history/components/rowListScene_20211011134920.xml
create mode 100644 .history/components/rowListScene_20211011135127.xml
create mode 100644 .history/components/rowListScene_20211011135145.brs
create mode 100644 .history/components/rowListScene_20211011135201.brs
create mode 100644 .history/components/rowListScene_20211011135220.xml
create mode 100644 .history/components/rowListScene_20211011135315.xml
create mode 100644 .history/components/rowListScene_20211011135328.xml
create mode 100644 .history/components/rowListScene_20211011135342.xml
create mode 100644 .history/components/rowListScene_20211011135727.xml
create mode 100644 .history/components/rowListScene_20211011135742.xml
create mode 100644 .history/components/rowListScene_20211011135756.xml
create mode 100644 .history/components/rowListScene_20211011135757.xml
create mode 100644 .history/components/rowListScene_20211011140317.xml
create mode 100644 .history/components/rowListScene_20211011140321.xml
create mode 100644 .history/components/rowListScene_20211011142206.xml
create mode 100644 .history/components/rowListScene_20211011142420.xml
create mode 100644 .history/components/rowListScene_20211011142458.xml
create mode 100644 .history/components/rowListScene_20211011142525.brs
create mode 100644 .history/components/rowListScene_20211011142610.brs
create mode 100644 .history/components/rowListScene_20211011142646.brs
create mode 100644 .history/components/rowListScene_20211011142657.brs
create mode 100644 .history/components/rowListScene_20211011142700.brs
create mode 100644 .history/components/rowListScene_20211011143048.brs
create mode 100644 .history/components/rowListScene_20211011143119.brs
create mode 100644 .history/components/rowListScene_20211011143203.brs
create mode 100644 .history/components/rowListScene_20211011143204.brs
create mode 100644 .history/components/rowListScene_20211011143521.brs
create mode 100644 .history/components/rowListScene_20211011143557.brs
create mode 100644 .history/components/rowListScene_20211011144019.xml
create mode 100644 .history/components/rowListScene_20211011144025.xml
create mode 100644 .history/components/rowListScene_20211011144115.xml
create mode 100644 .history/components/rowListScene_20211011144141.xml
create mode 100644 .history/components/rowListScene_20211011144330.xml
create mode 100644 .history/components/rowListScene_20211011144343.brs
create mode 100644 .history/components/rowListScene_20211011144638.brs
create mode 100644 .history/components/rowListScene_20211011144659.brs
create mode 100644 .history/components/rowListScene_20211011144718.brs
create mode 100644 .history/components/rowListScene_20211011151753.xml
create mode 100644 .history/components/rowListScene_20211011151755.xml
create mode 100644 .history/components/rowListScene_20211011151829.brs
create mode 100644 .history/components/rowListScene_20211011151922.xml
create mode 100644 .history/components/rowListScene_20211011152047.xml
create mode 100644 .history/components/rowListScene_20211011152054.xml
create mode 100644 .history/components/rowListScene_20211011152249.xml
create mode 100644 .history/components/rowListScene_20211011152637.xml
create mode 100644 .history/components/rowListScene_20211011152704.xml
create mode 100644 .history/components/rowListScene_20211011152741.brs
create mode 100644 .history/components/rowListScene_20211011152745.brs
create mode 100644 .history/components/rowListScene_20211011152820.brs
create mode 100644 .history/components/rowListScene_20211011154834.xml
create mode 100644 .history/components/rowListScene_20211011154858.xml
create mode 100644 .history/components/rowListScene_20211011160212.xml
create mode 100644 .history/components/rowListScene_20211011160214.xml
create mode 100644 .history/components/rowListScene_20211011160217.xml
create mode 100644 .history/components/rowListScene_20211011160729.xml
create mode 100644 .history/components/rowListScene_20211011160824.xml
create mode 100644 .history/components/rowListScene_20211011161430.xml
create mode 100644 .history/components/rowListScene_20211011161441.brs
create mode 100644 .history/components/rowListScene_20211011161505.xml
create mode 100644 .history/components/rowListScene_20211011161514.xml
create mode 100644 .history/components/rowListScene_20211011161556.xml
create mode 100644 .history/components/rowListScene_20211011161820.brs
create mode 100644 .history/components/rowListScene_20211011161851.xml
create mode 100644 .history/components/rowListScene_20211011161853.xml
create mode 100644 .history/components/rowListScene_20211011161900.xml
create mode 100644 .history/components/rowListScene_20211011161906.xml
create mode 100644 .history/components/rowListScene_20211011161926.xml
create mode 100644 .history/components/rowListScene_20211011163824.xml
create mode 100644 .history/components/rowListScene_20211011163856.xml
create mode 100644 .history/components/rowListScene_20211011163858.xml
create mode 100644 .history/components/rowListScene_20211011163948.xml
create mode 100644 .history/components/rowListScene_20211011163950.xml
create mode 100644 .history/components/rowListScene_20211012030439.xml
create mode 100644 .history/components/rowListScene_20211012030442.xml
create mode 100644 .history/components/rowListScene_20211012030443.xml
create mode 100644 .history/components/rowListScene_20211012030617.xml
create mode 100644 .history/components/rowListScene_20211012030618.xml
create mode 100644 .history/components/rowListScene_20211012030641.xml
create mode 100644 .history/components/rowListScene_20211012030736.xml
create mode 100644 .history/components/rowListScene_20211012030753.xml
create mode 100644 .history/components/rowListScene_20211012030805.brs
create mode 100644 .history/components/rowListScene_20211012030811.brs
create mode 100644 .history/components/rowListScene_20211012031004.xml
create mode 100644 .history/components/rowListScene_20211012031006.xml
create mode 100644 .history/components/rowListScene_20211012031011.xml
create mode 100644 .history/components/rowListScene_20211012031223.brs
create mode 100644 .history/components/rowListScene_20211012031226.brs
create mode 100644 .history/components/rowListScene_20211012031230.brs
create mode 100644 .history/components/rowListScene_20211012031231.brs
create mode 100644 .history/components/rowListScene_20211012031235.brs
create mode 100644 .history/components/rowListScene_20211012031408.xml
create mode 100644 .history/components/rowListScene_20211012032157.xml
create mode 100644 .history/components/rowListScene_20211012122112.xml
create mode 100644 .history/components/rowListScene_20211012122632.xml
create mode 100644 .history/components/rowListScene_20211012122658.xml
create mode 100644 .history/components/rowListScene_20211012122713.xml
create mode 100644 .history/components/rowListScene_20211012122732.xml
create mode 100644 .history/components/trickplay/trickplay_20211013105704.xml
create mode 100644 .history/components/trickplay/trickplay_20211013105742.xml
create mode 100644 .history/components/trickplay/trickplay_20211013105805.xml
create mode 100644 .history/components/trickplay/trickplay_20211013105810.xml
create mode 100644 .history/components/trickplay/trickplay_20211013105834.xml
create mode 100644 .history/components/trickplay/trickplay_20211013105854.xml
create mode 100644 .history/components/trickplay/trickplay_20211013105904.xml
create mode 100644 .history/components/trickplay/trickplay_20211013105925.xml
create mode 100644 .history/components/trickplay/trickplay_20211013105928.xml
create mode 100644 .history/components/trickplay/trickplay_20211013105940.xml
create mode 100644 .history/components/trickplay/trickplay_20211013105959.xml
create mode 100644 .history/components/trickplay/trickplay_20211013110019.xml
create mode 100644 .history/components/trickplay/trickplay_20211013110037.xml
create mode 100644 .history/components/trickplay/trickplay_20211013110049.xml
create mode 100644 .history/components/trickplay/trickplay_20211013110104.xml
create mode 100644 .history/components/trickplay/trickplay_20211013110225.xml
create mode 100644 .history/components/trickplay/trickplay_20211013110317.xml
create mode 100644 .history/components/trickplay/trickplay_20211013110331.xml
create mode 100644 .history/components/trickplay/trickplay_20211013110335.xml
create mode 100644 .history/components/trickplay/trickplay_20211013110343.xml
create mode 100644 .history/components/trickplay/trickplay_20211013110709.xml
create mode 100644 .history/components/trickplay/trickplay_20211013110830.xml
create mode 100644 .history/components/trickplay/trickplay_20211013110853.xml
create mode 100644 .history/components/trickplay/trickplay_20211013110857.xml
create mode 100644 .history/components/trickplay/trickplay_20211013110936.xml
create mode 100644 .history/components/trickplay/trickplay_20211013111004.xml
create mode 100644 .history/components/trickplay/trickplay_20211013111014.xml
create mode 100644 .history/components/trickplay/trickplay_20211013111030.xml
create mode 100644 .history/components/trickplay/trickplay_20211013111143.xml
create mode 100644 .history/components/trickplay/trickplay_20211013111202.xml
create mode 100644 .history/components/trickplay/trickplay_20211013111214.xml
create mode 100644 .history/components/trickplay/trickplay_20211013111237.xml
create mode 100644 .history/components/trickplay/trickplay_20211013111254.xml
create mode 100644 .history/components/trickplay/trickplay_20211013111726.xml
create mode 100644 .history/components/trickplay/trickplay_20211013111834.xml
create mode 100644 .history/components/trickplay/trickplay_20211013111845.xml
create mode 100644 .history/components/trickplay/trickplay_20211013111942.xml
create mode 100644 .history/components/trickplay/trickplay_20211013112043.xml
create mode 100644 .history/components/trickplay/trickplay_20211013113737.xml
create mode 100644 .history/components/trickplay/trickplay_20211013113755.xml
create mode 100644 .history/components/trickplay/trickplay_20211013113757.xml
create mode 100644 .history/components/trickplay/trickplay_20211013114712.xml
create mode 100644 images/white.jpg
diff --git a/.history/.gitignore_20211008145905 b/.history/.gitignore_20211008145905
new file mode 100644
index 0000000..fa001aa
--- /dev/null
+++ b/.history/.gitignore_20211008145905
@@ -0,0 +1,2 @@
+out/
+out/roku-deploy.zip
diff --git a/.history/.gitignore_20211010133726 b/.history/.gitignore_20211010133726
new file mode 100644
index 0000000..a2a1892
--- /dev/null
+++ b/.history/.gitignore_20211010133726
@@ -0,0 +1,4 @@
+out/
+out/roku-deploy.zip
+.history/
+.vscode
\ No newline at end of file
diff --git a/.history/.gitignore_20211011133958 b/.history/.gitignore_20211011133958
new file mode 100644
index 0000000..6da9f97
--- /dev/null
+++ b/.history/.gitignore_20211011133958
@@ -0,0 +1,4 @@
+out/
+out/roku-deploy.zip
+.vscode/
+.history/
\ No newline at end of file
diff --git a/.history/.gitignore_20211011134525 b/.history/.gitignore_20211011134525
new file mode 100644
index 0000000..6da9f97
--- /dev/null
+++ b/.history/.gitignore_20211011134525
@@ -0,0 +1,4 @@
+out/
+out/roku-deploy.zip
+.vscode/
+.history/
\ No newline at end of file
diff --git a/.history/components/MainScreen_20161215154627.xml b/.history/components/MainScreen_20161215154627.xml
new file mode 100644
index 0000000..762ac43
--- /dev/null
+++ b/.history/components/MainScreen_20161215154627.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.history/components/MainScreen_20211011143248.xml b/.history/components/MainScreen_20211011143248.xml
new file mode 100644
index 0000000..30a1786
--- /dev/null
+++ b/.history/components/MainScreen_20211011143248.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/Play_20211012131737.brs b/.history/components/Play_20211012131737.brs
new file mode 100644
index 0000000..a5fcad0
--- /dev/null
+++ b/.history/components/Play_20211012131737.brs
@@ -0,0 +1,27 @@
+sub init()
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.control = "RUN"
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=1FL22N1EXDo", requestType: "GET" }
+ m.http.observeFieldScoped("response", "useResponse")
+ m.video = m.top.findNode("video")
+
+ play()
+end sub
+
+sub play()
+ m.video.control = "play"
+end sub
+
+sub useResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.http.response.body)
+ m.content = createObject("roSGNode", "ContentNode")
+ m.content.streamFormat = "mp4"
+ m.content.url = ParseJson(matches[1]).streamingData.formats[0].url
+ m.video.content = m.content
+ play()
+end sub
+
diff --git a/.history/components/Play_20211012131808.brs b/.history/components/Play_20211012131808.brs
new file mode 100644
index 0000000..3e8f14b
--- /dev/null
+++ b/.history/components/Play_20211012131808.brs
@@ -0,0 +1,28 @@
+sub init()
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.control = "RUN"
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=1FL22N1EXDo", requestType: "GET" }
+ m.http.observeFieldScoped("response", "useResponse")
+ m.video = m.top.findNode("video")
+ ?m.video
+
+ play()
+end sub
+
+sub play()
+ m.video.control = "play"
+end sub
+
+sub useResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.http.response.body)
+ m.content = createObject("roSGNode", "ContentNode")
+ m.content.streamFormat = "mp4"
+ m.content.url = ParseJson(matches[1]).streamingData.formats[0].url
+ m.video.content = m.content
+ play()
+end sub
+
diff --git a/.history/components/Play_20211012131900.brs b/.history/components/Play_20211012131900.brs
new file mode 100644
index 0000000..a5fcad0
--- /dev/null
+++ b/.history/components/Play_20211012131900.brs
@@ -0,0 +1,27 @@
+sub init()
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.control = "RUN"
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=1FL22N1EXDo", requestType: "GET" }
+ m.http.observeFieldScoped("response", "useResponse")
+ m.video = m.top.findNode("video")
+
+ play()
+end sub
+
+sub play()
+ m.video.control = "play"
+end sub
+
+sub useResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.http.response.body)
+ m.content = createObject("roSGNode", "ContentNode")
+ m.content.streamFormat = "mp4"
+ m.content.url = ParseJson(matches[1]).streamingData.formats[0].url
+ m.video.content = m.content
+ play()
+end sub
+
diff --git a/.history/components/keyboardScene_20211012131932.brs b/.history/components/keyboardScene_20211012131932.brs
new file mode 100644
index 0000000..ff84590
--- /dev/null
+++ b/.history/components/keyboardScene_20211012131932.brs
@@ -0,0 +1,93 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012132158.brs b/.history/components/keyboardScene_20211012132158.brs
new file mode 100644
index 0000000..052d489
--- /dev/null
+++ b/.history/components/keyboardScene_20211012132158.brs
@@ -0,0 +1,94 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012133530.brs b/.history/components/keyboardScene_20211012133530.brs
new file mode 100644
index 0000000..602d379
--- /dev/null
+++ b/.history/components/keyboardScene_20211012133530.brs
@@ -0,0 +1,95 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableTricKPlay = false
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012133904.brs b/.history/components/keyboardScene_20211012133904.brs
new file mode 100644
index 0000000..2b5832d
--- /dev/null
+++ b/.history/components/keyboardScene_20211012133904.brs
@@ -0,0 +1,95 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012134451.brs b/.history/components/keyboardScene_20211012134451.brs
new file mode 100644
index 0000000..35ee359
--- /dev/null
+++ b/.history/components/keyboardScene_20211012134451.brs
@@ -0,0 +1,96 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFF00FFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012134544.brs b/.history/components/keyboardScene_20211012134544.brs
new file mode 100644
index 0000000..2cec4e2
--- /dev/null
+++ b/.history/components/keyboardScene_20211012134544.brs
@@ -0,0 +1,96 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012134647.brs b/.history/components/keyboardScene_20211012134647.brs
new file mode 100644
index 0000000..b215172
--- /dev/null
+++ b/.history/components/keyboardScene_20211012134647.brs
@@ -0,0 +1,97 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012134937.brs b/.history/components/keyboardScene_20211012134937.brs
new file mode 100644
index 0000000..e3a67e2
--- /dev/null
+++ b/.history/components/keyboardScene_20211012134937.brs
@@ -0,0 +1,98 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
+ m.video.trickPlayBar.filledBarBlendColor = "0x000000FF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012135037.brs b/.history/components/keyboardScene_20211012135037.brs
new file mode 100644
index 0000000..39eab47
--- /dev/null
+++ b/.history/components/keyboardScene_20211012135037.brs
@@ -0,0 +1,98 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
+ m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012135227.brs b/.history/components/keyboardScene_20211012135227.brs
new file mode 100644
index 0000000..04fffc4
--- /dev/null
+++ b/.history/components/keyboardScene_20211012135227.brs
@@ -0,0 +1,99 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
+ m.video.trickPlayBar.filledBarImageUri = ""
+ m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012135232.brs b/.history/components/keyboardScene_20211012135232.brs
new file mode 100644
index 0000000..1b56228
--- /dev/null
+++ b/.history/components/keyboardScene_20211012135232.brs
@@ -0,0 +1,99 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
+ m.video.trickPlayBar.filledBarImageUri = invalid
+ m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012135345.brs b/.history/components/keyboardScene_20211012135345.brs
new file mode 100644
index 0000000..aa974ff
--- /dev/null
+++ b/.history/components/keyboardScene_20211012135345.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
+ m.video.trickPlayBar.filledBarImageUri = invalid
+ m.video.trickPlayBar.trackImageUri = "https://png.pngtree.com/thumb_back/fh260/background/20200714/pngtree-modern-double-color-futuristic-neon-background-image_351866.jpg"
+ m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012135459.brs b/.history/components/keyboardScene_20211012135459.brs
new file mode 100644
index 0000000..634b31f
--- /dev/null
+++ b/.history/components/keyboardScene_20211012135459.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
+ m.video.trickPlayBar.filledBarImageUri = "https://png.pngtree.com/thumb_back/fh260/background/20200714/pngtree-modern-double-color-futuristic-neon-background-image_351866.jpg"
+ m.video.trickPlayBar.trackImageUri = ""
+ m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012135654.brs b/.history/components/keyboardScene_20211012135654.brs
new file mode 100644
index 0000000..8ef80c0
--- /dev/null
+++ b/.history/components/keyboardScene_20211012135654.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
+ m.video.trickPlayBar.filledBarImageUri = "0xFFFFFF00"
+ m.video.trickPlayBar.trackImageUri = ""
+ m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012135833.brs b/.history/components/keyboardScene_20211012135833.brs
new file mode 100644
index 0000000..c866245
--- /dev/null
+++ b/.history/components/keyboardScene_20211012135833.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ m.video.trickPlayBar.filledBarImageUri = ""
+ m.video.trickPlayBar.trackImageUri = ""
+ m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012135835.brs b/.history/components/keyboardScene_20211012135835.brs
new file mode 100644
index 0000000..c866245
--- /dev/null
+++ b/.history/components/keyboardScene_20211012135835.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ m.video.trickPlayBar.filledBarImageUri = ""
+ m.video.trickPlayBar.trackImageUri = ""
+ m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012135845.brs b/.history/components/keyboardScene_20211012135845.brs
new file mode 100644
index 0000000..465016c
--- /dev/null
+++ b/.history/components/keyboardScene_20211012135845.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFF00FF00"
+ m.video.trickPlayBar.filledBarImageUri = ""
+ m.video.trickPlayBar.trackImageUri = ""
+ m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012135848.brs b/.history/components/keyboardScene_20211012135848.brs
new file mode 100644
index 0000000..56d06f2
--- /dev/null
+++ b/.history/components/keyboardScene_20211012135848.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFF00FFFF"
+ m.video.trickPlayBar.filledBarImageUri = ""
+ m.video.trickPlayBar.trackImageUri = ""
+ m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012135849.brs b/.history/components/keyboardScene_20211012135849.brs
new file mode 100644
index 0000000..56d06f2
--- /dev/null
+++ b/.history/components/keyboardScene_20211012135849.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFF00FFFF"
+ m.video.trickPlayBar.filledBarImageUri = ""
+ m.video.trickPlayBar.trackImageUri = ""
+ m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012140044.brs b/.history/components/keyboardScene_20211012140044.brs
new file mode 100644
index 0000000..18bea9b
--- /dev/null
+++ b/.history/components/keyboardScene_20211012140044.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = ""
+ m.video.trickPlayBar.trackImageUri = ""
+ m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012140310.brs b/.history/components/keyboardScene_20211012140310.brs
new file mode 100644
index 0000000..cb4d537
--- /dev/null
+++ b/.history/components/keyboardScene_20211012140310.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012140322.brs b/.history/components/keyboardScene_20211012140322.brs
new file mode 100644
index 0000000..e3ae4fc
--- /dev/null
+++ b/.history/components/keyboardScene_20211012140322.brs
@@ -0,0 +1,97 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012140753.brs b/.history/components/keyboardScene_20211012140753.brs
new file mode 100644
index 0000000..8caef93
--- /dev/null
+++ b/.history/components/keyboardScene_20211012140753.brs
@@ -0,0 +1,101 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.emptyBarImageUri = "pkg:/images/white.jpg"
+
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012140755.brs b/.history/components/keyboardScene_20211012140755.brs
new file mode 100644
index 0000000..dda45f3
--- /dev/null
+++ b/.history/components/keyboardScene_20211012140755.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.emptyBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012140756.brs b/.history/components/keyboardScene_20211012140756.brs
new file mode 100644
index 0000000..dda45f3
--- /dev/null
+++ b/.history/components/keyboardScene_20211012140756.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.emptyBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012140816.brs b/.history/components/keyboardScene_20211012140816.brs
new file mode 100644
index 0000000..912a333
--- /dev/null
+++ b/.history/components/keyboardScene_20211012140816.brs
@@ -0,0 +1,101 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0x0000FFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.emptyBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.emptyBarBlendColor = "0x00000033"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012140911.brs b/.history/components/keyboardScene_20211012140911.brs
new file mode 100644
index 0000000..32f8d27
--- /dev/null
+++ b/.history/components/keyboardScene_20211012140911.brs
@@ -0,0 +1,101 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.emptyBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.emptyBarBlendColor = "0x00000033"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012140929.brs b/.history/components/keyboardScene_20211012140929.brs
new file mode 100644
index 0000000..1d4cf18
--- /dev/null
+++ b/.history/components/keyboardScene_20211012140929.brs
@@ -0,0 +1,101 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.emptyBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x00000033"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012140932.brs b/.history/components/keyboardScene_20211012140932.brs
new file mode 100644
index 0000000..64a8f30
--- /dev/null
+++ b/.history/components/keyboardScene_20211012140932.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x00000033"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012140933.brs b/.history/components/keyboardScene_20211012140933.brs
new file mode 100644
index 0000000..64a8f30
--- /dev/null
+++ b/.history/components/keyboardScene_20211012140933.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x00000033"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012140937.brs b/.history/components/keyboardScene_20211012140937.brs
new file mode 100644
index 0000000..9a1c68b
--- /dev/null
+++ b/.history/components/keyboardScene_20211012140937.brs
@@ -0,0 +1,99 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x00000033"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012141120.brs b/.history/components/keyboardScene_20211012141120.brs
new file mode 100644
index 0000000..6ece5bb
--- /dev/null
+++ b/.history/components/keyboardScene_20211012141120.brs
@@ -0,0 +1,99 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ?m.video.trickPlayBar
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012141140.brs b/.history/components/keyboardScene_20211012141140.brs
new file mode 100644
index 0000000..84cfbf5
--- /dev/null
+++ b/.history/components/keyboardScene_20211012141140.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ trackBlendColor = "0x000000FF"
+ ?m.video.trickPlayBar
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012141147.brs b/.history/components/keyboardScene_20211012141147.brs
new file mode 100644
index 0000000..0ce2fee
--- /dev/null
+++ b/.history/components/keyboardScene_20211012141147.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x000000FF"
+ ?m.video.trickPlayBar
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012141326.brs b/.history/components/keyboardScene_20211012141326.brs
new file mode 100644
index 0000000..308809a
--- /dev/null
+++ b/.history/components/keyboardScene_20211012141326.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x000000FF"
+ ?m.video.trickPlayBar.getParent()
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012141443.brs b/.history/components/keyboardScene_20211012141443.brs
new file mode 100644
index 0000000..0c7d4c5
--- /dev/null
+++ b/.history/components/keyboardScene_20211012141443.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ?m.video.trickPlayBar.getParent()
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012141637.brs b/.history/components/keyboardScene_20211012141637.brs
new file mode 100644
index 0000000..b88483d
--- /dev/null
+++ b/.history/components/keyboardScene_20211012141637.brs
@@ -0,0 +1,101 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent()
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012141641.brs b/.history/components/keyboardScene_20211012141641.brs
new file mode 100644
index 0000000..dd51c0a
--- /dev/null
+++ b/.history/components/keyboardScene_20211012141641.brs
@@ -0,0 +1,100 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012141813.brs b/.history/components/keyboardScene_20211012141813.brs
new file mode 100644
index 0000000..7458c4d
--- /dev/null
+++ b/.history/components/keyboardScene_20211012141813.brs
@@ -0,0 +1,101 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren()
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012141843.brs b/.history/components/keyboardScene_20211012141843.brs
new file mode 100644
index 0000000..b88483d
--- /dev/null
+++ b/.history/components/keyboardScene_20211012141843.brs
@@ -0,0 +1,101 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent()
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012141913.brs b/.history/components/keyboardScene_20211012141913.brs
new file mode 100644
index 0000000..03ddcec
--- /dev/null
+++ b/.history/components/keyboardScene_20211012141913.brs
@@ -0,0 +1,101 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildCount()
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012141947.brs b/.history/components/keyboardScene_20211012141947.brs
new file mode 100644
index 0000000..e8b9c0f
--- /dev/null
+++ b/.history/components/keyboardScene_20211012141947.brs
@@ -0,0 +1,101 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12)
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012142027.brs b/.history/components/keyboardScene_20211012142027.brs
new file mode 100644
index 0000000..6232d4f
--- /dev/null
+++ b/.history/components/keyboardScene_20211012142027.brs
@@ -0,0 +1,101 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012142112.brs b/.history/components/keyboardScene_20211012142112.brs
new file mode 100644
index 0000000..4e77d8f
--- /dev/null
+++ b/.history/components/keyboardScene_20211012142112.brs
@@ -0,0 +1,102 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getParent().getChild(1)
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012142206.brs b/.history/components/keyboardScene_20211012142206.brs
new file mode 100644
index 0000000..51060a3
--- /dev/null
+++ b/.history/components/keyboardScene_20211012142206.brs
@@ -0,0 +1,102 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012142301.brs b/.history/components/keyboardScene_20211012142301.brs
new file mode 100644
index 0000000..90a7908
--- /dev/null
+++ b/.history/components/keyboardScene_20211012142301.brs
@@ -0,0 +1,102 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012142428.brs b/.history/components/keyboardScene_20211012142428.brs
new file mode 100644
index 0000000..e0004a4
--- /dev/null
+++ b/.history/components/keyboardScene_20211012142428.brs
@@ -0,0 +1,103 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012142431.brs b/.history/components/keyboardScene_20211012142431.brs
new file mode 100644
index 0000000..c1aa572
--- /dev/null
+++ b/.history/components/keyboardScene_20211012142431.brs
@@ -0,0 +1,103 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012142554.brs b/.history/components/keyboardScene_20211012142554.brs
new file mode 100644
index 0000000..d6b5f9c
--- /dev/null
+++ b/.history/components/keyboardScene_20211012142554.brs
@@ -0,0 +1,104 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(5)
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012142834.brs b/.history/components/keyboardScene_20211012142834.brs
new file mode 100644
index 0000000..545b791
--- /dev/null
+++ b/.history/components/keyboardScene_20211012142834.brs
@@ -0,0 +1,104 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11)
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012142946.brs b/.history/components/keyboardScene_20211012142946.brs
new file mode 100644
index 0000000..a745468
--- /dev/null
+++ b/.history/components/keyboardScene_20211012142946.brs
@@ -0,0 +1,104 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildrenCount()
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012143030.brs b/.history/components/keyboardScene_20211012143030.brs
new file mode 100644
index 0000000..0ebc4d4
--- /dev/null
+++ b/.history/components/keyboardScene_20211012143030.brs
@@ -0,0 +1,104 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildCount()
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012143106.brs b/.history/components/keyboardScene_20211012143106.brs
new file mode 100644
index 0000000..2b670e0
--- /dev/null
+++ b/.history/components/keyboardScene_20211012143106.brs
@@ -0,0 +1,104 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012143144.brs b/.history/components/keyboardScene_20211012143144.brs
new file mode 100644
index 0000000..2a72bc6
--- /dev/null
+++ b/.history/components/keyboardScene_20211012143144.brs
@@ -0,0 +1,105 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ ?m.video.trickPlayBar.getParent().getChild(11).getChild(0)
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012143255.brs b/.history/components/keyboardScene_20211012143255.brs
new file mode 100644
index 0000000..2b7c743
--- /dev/null
+++ b/.history/components/keyboardScene_20211012143255.brs
@@ -0,0 +1,105 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ ?m.video.trickPlayBar.getParent().getChild(3)
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012143425.brs b/.history/components/keyboardScene_20211012143425.brs
new file mode 100644
index 0000000..ac0d1be
--- /dev/null
+++ b/.history/components/keyboardScene_20211012143425.brs
@@ -0,0 +1,104 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(2)
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012143432.brs b/.history/components/keyboardScene_20211012143432.brs
new file mode 100644
index 0000000..a5f55a3
--- /dev/null
+++ b/.history/components/keyboardScene_20211012143432.brs
@@ -0,0 +1,104 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.setFocus(true)
+ m.video.control = "play"
+ ?m.video.trickPlayBar.getParent().getChild(2)
+end sub
+
diff --git a/.history/components/keyboardScene_20211012143506.brs b/.history/components/keyboardScene_20211012143506.brs
new file mode 100644
index 0000000..a400f4d
--- /dev/null
+++ b/.history/components/keyboardScene_20211012143506.brs
@@ -0,0 +1,104 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.setFocus(true)
+ m.video.control = "play"
+ ?m.video.trickPlayBar.getParent().getChild(2).visible = false
+end sub
+
diff --git a/.history/components/keyboardScene_20211012143547.brs b/.history/components/keyboardScene_20211012143547.brs
new file mode 100644
index 0000000..0271cff
--- /dev/null
+++ b/.history/components/keyboardScene_20211012143547.brs
@@ -0,0 +1,104 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.setFocus(true)
+ m.video.control = "play"
+ m.video.trickPlayBar.getParent().getChild(2).visible = false
+end sub
+
diff --git a/.history/components/keyboardScene_20211012143803.brs b/.history/components/keyboardScene_20211012143803.brs
new file mode 100644
index 0000000..2c610b0
--- /dev/null
+++ b/.history/components/keyboardScene_20211012143803.brs
@@ -0,0 +1,105 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ ?m.video.trickPlayBar.getParent().getChild(5)
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012143849.brs b/.history/components/keyboardScene_20211012143849.brs
new file mode 100644
index 0000000..8b40144
--- /dev/null
+++ b/.history/components/keyboardScene_20211012143849.brs
@@ -0,0 +1,105 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ ?m.video.trickPlayBar.getParent().getChild(5).height = 40
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012144059.brs b/.history/components/keyboardScene_20211012144059.brs
new file mode 100644
index 0000000..2c610b0
--- /dev/null
+++ b/.history/components/keyboardScene_20211012144059.brs
@@ -0,0 +1,105 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ ?m.video.trickPlayBar.getParent().getChild(5)
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012144148.brs b/.history/components/keyboardScene_20211012144148.brs
new file mode 100644
index 0000000..3a69a2d
--- /dev/null
+++ b/.history/components/keyboardScene_20211012144148.brs
@@ -0,0 +1,105 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ ?m.video.trickPlayBar.getParent().getChild(5).height = 0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012144149.brs b/.history/components/keyboardScene_20211012144149.brs
new file mode 100644
index 0000000..78966ac
--- /dev/null
+++ b/.history/components/keyboardScene_20211012144149.brs
@@ -0,0 +1,105 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ m.video.trickPlayBar.getParent().getChild(5).height = 0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012144401.brs b/.history/components/keyboardScene_20211012144401.brs
new file mode 100644
index 0000000..78d2df6
--- /dev/null
+++ b/.history/components/keyboardScene_20211012144401.brs
@@ -0,0 +1,105 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ m.video.trickPlayBar.getParent().getChild(5)
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012144506.brs b/.history/components/keyboardScene_20211012144506.brs
new file mode 100644
index 0000000..aab76b0
--- /dev/null
+++ b/.history/components/keyboardScene_20211012144506.brs
@@ -0,0 +1,106 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ m.video.trickPlayBar.getParent().getChild(5)
+ m.video.bufferingBar.height = 20
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012144537.brs b/.history/components/keyboardScene_20211012144537.brs
new file mode 100644
index 0000000..c30147e
--- /dev/null
+++ b/.history/components/keyboardScene_20211012144537.brs
@@ -0,0 +1,107 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ m.video.trickPlayBar.getParent().getChild(5)
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012144610.brs b/.history/components/keyboardScene_20211012144610.brs
new file mode 100644
index 0000000..4b8921f
--- /dev/null
+++ b/.history/components/keyboardScene_20211012144610.brs
@@ -0,0 +1,108 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ m.video.trickPlayBar.getParent().getChild(5)
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012144744.brs b/.history/components/keyboardScene_20211012144744.brs
new file mode 100644
index 0000000..72240e4
--- /dev/null
+++ b/.history/components/keyboardScene_20211012144744.brs
@@ -0,0 +1,109 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ m.video.trickPlayBar.getParent().getChild(5)
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012144754.brs b/.history/components/keyboardScene_20211012144754.brs
new file mode 100644
index 0000000..c608295
--- /dev/null
+++ b/.history/components/keyboardScene_20211012144754.brs
@@ -0,0 +1,109 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ m.video.trickPlayBar.getParent().getChild(5)
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012144806.brs b/.history/components/keyboardScene_20211012144806.brs
new file mode 100644
index 0000000..4c2dc5a
--- /dev/null
+++ b/.history/components/keyboardScene_20211012144806.brs
@@ -0,0 +1,110 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ m.video.trickPlayBar.getParent().getChild(5)
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012144812.brs b/.history/components/keyboardScene_20211012144812.brs
new file mode 100644
index 0000000..7b2f393
--- /dev/null
+++ b/.history/components/keyboardScene_20211012144812.brs
@@ -0,0 +1,110 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ m.video.trickPlayBar.getParent().getChild(5)
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012144825.brs b/.history/components/keyboardScene_20211012144825.brs
new file mode 100644
index 0000000..39f08b8
--- /dev/null
+++ b/.history/components/keyboardScene_20211012144825.brs
@@ -0,0 +1,110 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
+ m.video.trickPlayBar.getParent().getChild(5)
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012145038.brs b/.history/components/keyboardScene_20211012145038.brs
new file mode 100644
index 0000000..7e67136
--- /dev/null
+++ b/.history/components/keyboardScene_20211012145038.brs
@@ -0,0 +1,109 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(5)
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012145051.brs b/.history/components/keyboardScene_20211012145051.brs
new file mode 100644
index 0000000..baba9db
--- /dev/null
+++ b/.history/components/keyboardScene_20211012145051.brs
@@ -0,0 +1,110 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(10).getChildren(6, 0)
+ m.video.trickPlayBar.getParent().getChild(5)
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012145100.brs b/.history/components/keyboardScene_20211012145100.brs
new file mode 100644
index 0000000..660d001
--- /dev/null
+++ b/.history/components/keyboardScene_20211012145100.brs
@@ -0,0 +1,110 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(10)
+ m.video.trickPlayBar.getParent().getChild(5)
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012145914.brs b/.history/components/keyboardScene_20211012145914.brs
new file mode 100644
index 0000000..3a6b0a5
--- /dev/null
+++ b/.history/components/keyboardScene_20211012145914.brs
@@ -0,0 +1,110 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(10)
+ ?m.video.trickPlayBar.getParent().getChild(5)
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012145926.brs b/.history/components/keyboardScene_20211012145926.brs
new file mode 100644
index 0000000..2491089
--- /dev/null
+++ b/.history/components/keyboardScene_20211012145926.brs
@@ -0,0 +1,110 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(10)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChildCount()
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012150040.brs b/.history/components/keyboardScene_20211012150040.brs
new file mode 100644
index 0000000..3992887
--- /dev/null
+++ b/.history/components/keyboardScene_20211012150040.brs
@@ -0,0 +1,109 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(5).getChildCount()
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012150053.brs b/.history/components/keyboardScene_20211012150053.brs
new file mode 100644
index 0000000..f2de7f6
--- /dev/null
+++ b/.history/components/keyboardScene_20211012150053.brs
@@ -0,0 +1,109 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(5).getChildren(19, 0)
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012150212.brs b/.history/components/keyboardScene_20211012150212.brs
new file mode 100644
index 0000000..90c040e
--- /dev/null
+++ b/.history/components/keyboardScene_20211012150212.brs
@@ -0,0 +1,109 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(5)
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012150318.brs b/.history/components/keyboardScene_20211012150318.brs
new file mode 100644
index 0000000..31c423e
--- /dev/null
+++ b/.history/components/keyboardScene_20211012150318.brs
@@ -0,0 +1,113 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(5).observeField("visible", "tellMeText")
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub tellMeText()
+
+ endsb
+
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012150319.brs b/.history/components/keyboardScene_20211012150319.brs
new file mode 100644
index 0000000..4e33a8d
--- /dev/null
+++ b/.history/components/keyboardScene_20211012150319.brs
@@ -0,0 +1,112 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(5).observeField("visible", "tellMeText")
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub tellMeText()
+
+end sub
diff --git a/.history/components/keyboardScene_20211012150416.brs b/.history/components/keyboardScene_20211012150416.brs
new file mode 100644
index 0000000..10d5f7e
--- /dev/null
+++ b/.history/components/keyboardScene_20211012150416.brs
@@ -0,0 +1,113 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(5).observeField("visible", "tellMeText")
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub tellMeText()
+ ?m.video.trickPlayBar.getParent().getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(3)
+end sub
diff --git a/.history/components/keyboardScene_20211012150424.brs b/.history/components/keyboardScene_20211012150424.brs
new file mode 100644
index 0000000..6f610a8
--- /dev/null
+++ b/.history/components/keyboardScene_20211012150424.brs
@@ -0,0 +1,113 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(5).observeField("visible", "tellMeText")
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub tellMeText()
+ ?m.video.trickPlayBar.getParent().getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(3)
+end sub
diff --git a/.history/components/keyboardScene_20211012150555.brs b/.history/components/keyboardScene_20211012150555.brs
new file mode 100644
index 0000000..39f97b1
--- /dev/null
+++ b/.history/components/keyboardScene_20211012150555.brs
@@ -0,0 +1,113 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(5).observeField("visible", "tellMeText")
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub tellMeText()
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+end sub
diff --git a/.history/components/keyboardScene_20211012150601.brs b/.history/components/keyboardScene_20211012150601.brs
new file mode 100644
index 0000000..155be2f
--- /dev/null
+++ b/.history/components/keyboardScene_20211012150601.brs
@@ -0,0 +1,114 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(5).observeField("visible", "tellMeText")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub tellMeText()
+
+end sub
diff --git a/.history/components/keyboardScene_20211012150644.brs b/.history/components/keyboardScene_20211012150644.brs
new file mode 100644
index 0000000..1d79406
--- /dev/null
+++ b/.history/components/keyboardScene_20211012150644.brs
@@ -0,0 +1,115 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(5).observeField("visible", "tellMeText")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub tellMeText()
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ ?m.video.trickPlayBar.getParent().getChild(10)
+end sub
diff --git a/.history/components/keyboardScene_20211012150915.brs b/.history/components/keyboardScene_20211012150915.brs
new file mode 100644
index 0000000..28d9bd9
--- /dev/null
+++ b/.history/components/keyboardScene_20211012150915.brs
@@ -0,0 +1,111 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(8).text = m.video.bufferingBar.percentage
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012150920.brs b/.history/components/keyboardScene_20211012150920.brs
new file mode 100644
index 0000000..323f8a6
--- /dev/null
+++ b/.history/components/keyboardScene_20211012150920.brs
@@ -0,0 +1,111 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(8).text = m.video.bufferingBar.percentage + "%"
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012151005.brs b/.history/components/keyboardScene_20211012151005.brs
new file mode 100644
index 0000000..47c73e0
--- /dev/null
+++ b/.history/components/keyboardScene_20211012151005.brs
@@ -0,0 +1,111 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012151105.brs b/.history/components/keyboardScene_20211012151105.brs
new file mode 100644
index 0000000..2ee5276
--- /dev/null
+++ b/.history/components/keyboardScene_20211012151105.brs
@@ -0,0 +1,112 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.bufferingBar.observeField("pecentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
diff --git a/.history/components/keyboardScene_20211012151115.brs b/.history/components/keyboardScene_20211012151115.brs
new file mode 100644
index 0000000..0103d70
--- /dev/null
+++ b/.history/components/keyboardScene_20211012151115.brs
@@ -0,0 +1,115 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.bufferingBar.observeField("pecentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+
+end sub
diff --git a/.history/components/keyboardScene_20211012151125.brs b/.history/components/keyboardScene_20211012151125.brs
new file mode 100644
index 0000000..9f4070f
--- /dev/null
+++ b/.history/components/keyboardScene_20211012151125.brs
@@ -0,0 +1,115 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.bufferingBar.observeField("pecentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
diff --git a/.history/components/keyboardScene_20211012151129.brs b/.history/components/keyboardScene_20211012151129.brs
new file mode 100644
index 0000000..8c4b540
--- /dev/null
+++ b/.history/components/keyboardScene_20211012151129.brs
@@ -0,0 +1,114 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.bufferingBar.observeField("pecentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
diff --git a/.history/components/keyboardScene_20211012151328.brs b/.history/components/keyboardScene_20211012151328.brs
new file mode 100644
index 0000000..5425ad6
--- /dev/null
+++ b/.history/components/keyboardScene_20211012151328.brs
@@ -0,0 +1,114 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
diff --git a/.history/components/keyboardScene_20211012151452.brs b/.history/components/keyboardScene_20211012151452.brs
new file mode 100644
index 0000000..0f58975
--- /dev/null
+++ b/.history/components/keyboardScene_20211012151452.brs
@@ -0,0 +1,115 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
diff --git a/.history/components/keyboardScene_20211012151718.brs b/.history/components/keyboardScene_20211012151718.brs
new file mode 100644
index 0000000..0e5cad1
--- /dev/null
+++ b/.history/components/keyboardScene_20211012151718.brs
@@ -0,0 +1,116 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.observeField("visible", "log")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
diff --git a/.history/components/keyboardScene_20211012151724.brs b/.history/components/keyboardScene_20211012151724.brs
new file mode 100644
index 0000000..4c0ea8e
--- /dev/null
+++ b/.history/components/keyboardScene_20211012151724.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.observeField("visible", "log")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
+
+sub log()
+
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012151741.brs b/.history/components/keyboardScene_20211012151741.brs
new file mode 100644
index 0000000..b0600cf
--- /dev/null
+++ b/.history/components/keyboardScene_20211012151741.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.observeField("visible", "log")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
+
+sub log()
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012151753.brs b/.history/components/keyboardScene_20211012151753.brs
new file mode 100644
index 0000000..8882c91
--- /dev/null
+++ b/.history/components/keyboardScene_20211012151753.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.observeField("visible", "logy")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
+
+sub logy()
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012151815.brs b/.history/components/keyboardScene_20211012151815.brs
new file mode 100644
index 0000000..b47758c
--- /dev/null
+++ b/.history/components/keyboardScene_20211012151815.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.observeField("visible", "logy")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
+
+sub logy()
+ ?m.video.trickPlayBar.getParent().getChild(2).text
+ ?m.video.trickPlayBar.getParent().getChild(3).text
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012151941.brs b/.history/components/keyboardScene_20211012151941.brs
new file mode 100644
index 0000000..546383a
--- /dev/null
+++ b/.history/components/keyboardScene_20211012151941.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.observeField("visible", "logy")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
+
+sub logy()
+ ?m.video.trickPlayBar.getParent().getChild(8).text
+ ?m.video.trickPlayBar.getParent().getChild(10).text
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012151947.brs b/.history/components/keyboardScene_20211012151947.brs
new file mode 100644
index 0000000..64e1400
--- /dev/null
+++ b/.history/components/keyboardScene_20211012151947.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.observeField("visible", "logy")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
+
+sub logy()
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ ?m.video.trickPlayBar.getParent().getChild(10)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152121.brs b/.history/components/keyboardScene_20211012152121.brs
new file mode 100644
index 0000000..b73f241
--- /dev/null
+++ b/.history/components/keyboardScene_20211012152121.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.observeField("visible", "logy")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
+
+sub logy()
+ ?m.video.trickPlayBar.getChildCount()
+ ?m.video.trickPlayBar.getParent().getChild(10)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152125.brs b/.history/components/keyboardScene_20211012152125.brs
new file mode 100644
index 0000000..4676f6b
--- /dev/null
+++ b/.history/components/keyboardScene_20211012152125.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.observeField("visible", "logy")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
+
+sub logy()
+ ?m.video.trickPlayBar.getChildCount()
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152229.brs b/.history/components/keyboardScene_20211012152229.brs
new file mode 100644
index 0000000..005386f
--- /dev/null
+++ b/.history/components/keyboardScene_20211012152229.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.observeField("visible", "logy")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
+
+sub logy()
+ ?m.video.trickPlayBar.getChildren(19), 0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152237.brs b/.history/components/keyboardScene_20211012152237.brs
new file mode 100644
index 0000000..8583a1a
--- /dev/null
+++ b/.history/components/keyboardScene_20211012152237.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.observeField("visible", "logy")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
+
+sub logy()
+ ?m.video.trickPlayBar.getChildren(19, 0)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152352.brs b/.history/components/keyboardScene_20211012152352.brs
new file mode 100644
index 0000000..b124259
--- /dev/null
+++ b/.history/components/keyboardScene_20211012152352.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.observeField("visible", "logy")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
+
+sub logy()
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ ?m.video.trickPlayBar.getChild(10)
+ ?m.video.trickPlayBar.getChild(9)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152354.brs b/.history/components/keyboardScene_20211012152354.brs
new file mode 100644
index 0000000..a839c35
--- /dev/null
+++ b/.history/components/keyboardScene_20211012152354.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.observeField("visible", "logy")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
+
+sub logy()
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ ?m.video.trickPlayBar.getChild(9)
+ ?m.video.trickPlayBar.getChild(10)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152507.brs b/.history/components/keyboardScene_20211012152507.brs
new file mode 100644
index 0000000..8583a1a
--- /dev/null
+++ b/.history/components/keyboardScene_20211012152507.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.observeField("visible", "logy")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
+
+sub logy()
+ ?m.video.trickPlayBar.getChildren(19, 0)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152518.brs b/.history/components/keyboardScene_20211012152518.brs
new file mode 100644
index 0000000..d12173b
--- /dev/null
+++ b/.history/components/keyboardScene_20211012152518.brs
@@ -0,0 +1,115 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152520.brs b/.history/components/keyboardScene_20211012152520.brs
new file mode 100644
index 0000000..d12173b
--- /dev/null
+++ b/.history/components/keyboardScene_20211012152520.brs
@@ -0,0 +1,115 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013084544.brs b/.history/components/keyboardScene_20211013084544.brs
new file mode 100644
index 0000000..71332f8
--- /dev/null
+++ b/.history/components/keyboardScene_20211013084544.brs
@@ -0,0 +1,115 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 14
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013084609.brs b/.history/components/keyboardScene_20211013084609.brs
new file mode 100644
index 0000000..fa806c2
--- /dev/null
+++ b/.history/components/keyboardScene_20211013084609.brs
@@ -0,0 +1,115 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013084830.brs b/.history/components/keyboardScene_20211013084830.brs
new file mode 100644
index 0000000..87f705c
--- /dev/null
+++ b/.history/components/keyboardScene_20211013084830.brs
@@ -0,0 +1,116 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013084919.brs b/.history/components/keyboardScene_20211013084919.brs
new file mode 100644
index 0000000..3df97ef
--- /dev/null
+++ b/.history/components/keyboardScene_20211013084919.brs
@@ -0,0 +1,117 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.getChildren(12, 0)
+ ?m.video.getChild(5)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013084931.brs b/.history/components/keyboardScene_20211013084931.brs
new file mode 100644
index 0000000..14edd82
--- /dev/null
+++ b/.history/components/keyboardScene_20211013084931.brs
@@ -0,0 +1,117 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.getChildren(12, 0)
+ ?m.video.getChild(5)
+ ' Hides the black background in the scrubber
+ m.video.getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013084953.brs b/.history/components/keyboardScene_20211013084953.brs
new file mode 100644
index 0000000..14edd82
--- /dev/null
+++ b/.history/components/keyboardScene_20211013084953.brs
@@ -0,0 +1,117 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.getChildren(12, 0)
+ ?m.video.getChild(5)
+ ' Hides the black background in the scrubber
+ m.video.getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085016.brs b/.history/components/keyboardScene_20211013085016.brs
new file mode 100644
index 0000000..3df97ef
--- /dev/null
+++ b/.history/components/keyboardScene_20211013085016.brs
@@ -0,0 +1,117 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.getChildren(12, 0)
+ ?m.video.getChild(5)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085019.brs b/.history/components/keyboardScene_20211013085019.brs
new file mode 100644
index 0000000..c1986cd
--- /dev/null
+++ b/.history/components/keyboardScene_20211013085019.brs
@@ -0,0 +1,116 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085029.brs b/.history/components/keyboardScene_20211013085029.brs
new file mode 100644
index 0000000..af07381
--- /dev/null
+++ b/.history/components/keyboardScene_20211013085029.brs
@@ -0,0 +1,117 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085134.brs b/.history/components/keyboardScene_20211013085134.brs
new file mode 100644
index 0000000..8ea9891
--- /dev/null
+++ b/.history/components/keyboardScene_20211013085134.brs
@@ -0,0 +1,117 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildCount()
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085212.brs b/.history/components/keyboardScene_20211013085212.brs
new file mode 100644
index 0000000..d0a2ca1
--- /dev/null
+++ b/.history/components/keyboardScene_20211013085212.brs
@@ -0,0 +1,117 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085303.brs b/.history/components/keyboardScene_20211013085303.brs
new file mode 100644
index 0000000..3b175ff
--- /dev/null
+++ b/.history/components/keyboardScene_20211013085303.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ ?m.video.trickPlayBar.getChild(1)
+ ?m.video.trickPlayBar.getChild(2)
+ ?m.video.trickPlayBar.getChild(3)
+ ?m.video.trickPlayBar.getChild(4)
+
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085427.brs b/.history/components/keyboardScene_20211013085427.brs
new file mode 100644
index 0000000..f8fa6ea
--- /dev/null
+++ b/.history/components/keyboardScene_20211013085427.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ ?m.video.trickPlayBar.getChild(0)
+ ?m.video.trickPlayBar.getChild(1)
+
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085504.brs b/.history/components/keyboardScene_20211013085504.brs
new file mode 100644
index 0000000..35a4cab
--- /dev/null
+++ b/.history/components/keyboardScene_20211013085504.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ ?m.video.trickPlayBar.getChild(0).height = 8
+ ?m.video.trickPlayBar.getChild(1).height = 8
+
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085622.brs b/.history/components/keyboardScene_20211013085622.brs
new file mode 100644
index 0000000..0ea86b9
--- /dev/null
+++ b/.history/components/keyboardScene_20211013085622.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ ?m.video.trickPlayBar.getChild(0).height = 8
+ ?m.video.trickPlayBar.getChild(1).height = 8
+
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 4
+ m.video.bufferingBar.height = 4
+ ?
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085645.brs b/.history/components/keyboardScene_20211013085645.brs
new file mode 100644
index 0000000..f67488c
--- /dev/null
+++ b/.history/components/keyboardScene_20211013085645.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085719.brs b/.history/components/keyboardScene_20211013085719.brs
new file mode 100644
index 0000000..dace9e0
--- /dev/null
+++ b/.history/components/keyboardScene_20211013085719.brs
@@ -0,0 +1,126 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(9)
+ ?m.video.trickPlayBar.getChild(10)
+ ?m.video.trickPlayBar.getChild(11)
+ ?m.video.trickPlayBar.getChild(12)
+ ?m.video.trickPlayBar.getChild(13)
+ ?m.video.trickPlayBar.getChild(14)
+ ?m.video.trickPlayBar.getChild(15)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085937.brs b/.history/components/keyboardScene_20211013085937.brs
new file mode 100644
index 0000000..ab1cf24
--- /dev/null
+++ b/.history/components/keyboardScene_20211013085937.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(9)
+ ?m.video.trickPlayBar.getChild(10).visible = false
+ ?m.video.trickPlayBar.getChild(11).visible = false
+ ?m.video.trickPlayBar.getChild(12).visible = false
+ ?m.video.trickPlayBar.getChild(13).visible = false
+ ?m.video.trickPlayBar.getChild(14).visible = false
+ ?m.video.trickPlayBar.getChild(15).visible = false
+ ?m.video.trickPlayBar.getChild(16).visible = false
+ ?m.video.trickPlayBar.getChild(17).visible = false
+ ?m.video.trickPlayBar.getChild(18).visible = false
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085941.brs b/.history/components/keyboardScene_20211013085941.brs
new file mode 100644
index 0000000..779c5c7
--- /dev/null
+++ b/.history/components/keyboardScene_20211013085941.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(9)
+ m.video.trickPlayBar.getChild(10).visible = false
+ m.video.trickPlayBar.getChild(11).visible = false
+ m.video.trickPlayBar.getChild(12).visible = false
+ m.video.trickPlayBar.getChild(13).visible = false
+ m.video.trickPlayBar.getChild(14).visible = false
+ m.video.trickPlayBar.getChild(15).visible = false
+ m.video.trickPlayBar.getChild(16).visible = false
+ m.video.trickPlayBar.getChild(17).visible = false
+ m.video.trickPlayBar.getChild(18).visible = false
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090029.brs b/.history/components/keyboardScene_20211013090029.brs
new file mode 100644
index 0000000..62998c3
--- /dev/null
+++ b/.history/components/keyboardScene_20211013090029.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).height = 8
+ m.video.trickPlayBar.getChild(3).height = 8
+ m.video.trickPlayBar.getChild(4).height = 8
+ m.video.trickPlayBar.getChild(5).height = 8
+ m.video.trickPlayBar.getChild(6).height = 8
+ m.video.trickPlayBar.getChild(7).height = 8
+ m.video.trickPlayBar.getChild(8).height = 8
+ ?m.video.trickPlayBar.getChild(9)
+ m.video.trickPlayBar.getChild(10).visible = false
+ m.video.trickPlayBar.getChild(11).visible = false
+ m.video.trickPlayBar.getChild(12).visible = false
+ m.video.trickPlayBar.getChild(13).visible = false
+ m.video.trickPlayBar.getChild(14).visible = false
+ m.video.trickPlayBar.getChild(15).visible = false
+ m.video.trickPlayBar.getChild(16).visible = false
+ m.video.trickPlayBar.getChild(17).visible = false
+ m.video.trickPlayBar.getChild(18).visible = false
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090032.brs b/.history/components/keyboardScene_20211013090032.brs
new file mode 100644
index 0000000..53b071a
--- /dev/null
+++ b/.history/components/keyboardScene_20211013090032.brs
@@ -0,0 +1,135 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).height = 8
+ m.video.trickPlayBar.getChild(3).height = 8
+ m.video.trickPlayBar.getChild(4).height = 8
+ m.video.trickPlayBar.getChild(5).height = 8
+ m.video.trickPlayBar.getChild(6).height = 8
+ m.video.trickPlayBar.getChild(7).height = 8
+ m.video.trickPlayBar.getChild(8).height = 8
+ m.video.trickPlayBar.getChild(10).visible = false
+ m.video.trickPlayBar.getChild(11).visible = false
+ m.video.trickPlayBar.getChild(12).visible = false
+ m.video.trickPlayBar.getChild(13).visible = false
+ m.video.trickPlayBar.getChild(14).visible = false
+ m.video.trickPlayBar.getChild(15).visible = false
+ m.video.trickPlayBar.getChild(16).visible = false
+ m.video.trickPlayBar.getChild(17).visible = false
+ m.video.trickPlayBar.getChild(18).visible = false
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090124.brs b/.history/components/keyboardScene_20211013090124.brs
new file mode 100644
index 0000000..ec56bec
--- /dev/null
+++ b/.history/components/keyboardScene_20211013090124.brs
@@ -0,0 +1,135 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).height = 8
+ m.video.trickPlayBar.getChild(3).height = 8
+ m.video.trickPlayBar.getChild(4).height = 8
+ m.video.trickPlayBar.getChild(5).height = 8
+ m.video.trickPlayBar.getChild(6).height = 8
+ m.video.trickPlayBar.getChild(7).height = 8
+ m.video.trickPlayBar.getChild(8).height = 8
+ m.video.trickPlayBar.getChild(10).visible = false
+ m.video.trickPlayBar.getChild(11).visible = false
+ m.video.trickPlayBar.getChild(12).visible = false
+ m.video.trickPlayBar.getChild(13).visible = false
+ m.video.trickPlayBar.getChild(14).visible = false
+ m.video.trickPlayBar.getChild(15).visible = false
+ m.video.trickPlayBar.getChild(16).visible = false
+ m.video.trickPlayBar.getChild(17).visible = false
+ m.video.trickPlayBar.getChild(18).visible = false
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090236.brs b/.history/components/keyboardScene_20211013090236.brs
new file mode 100644
index 0000000..9045cf2
--- /dev/null
+++ b/.history/components/keyboardScene_20211013090236.brs
@@ -0,0 +1,137 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ ?m.video.trickPlayBar.getChild(7)
+
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).height = 8
+ m.video.trickPlayBar.getChild(3).height = 8
+ m.video.trickPlayBar.getChild(4).height = 8
+ m.video.trickPlayBar.getChild(5).height = 8
+ m.video.trickPlayBar.getChild(6).height = 8
+ m.video.trickPlayBar.getChild(7).height = 8
+ m.video.trickPlayBar.getChild(8).height = 8
+ m.video.trickPlayBar.getChild(10).visible = false
+ m.video.trickPlayBar.getChild(11).visible = false
+ m.video.trickPlayBar.getChild(12).visible = false
+ m.video.trickPlayBar.getChild(13).visible = false
+ m.video.trickPlayBar.getChild(14).visible = false
+ m.video.trickPlayBar.getChild(15).visible = false
+ m.video.trickPlayBar.getChild(16).visible = false
+ m.video.trickPlayBar.getChild(17).visible = false
+ m.video.trickPlayBar.getChild(18).visible = false
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090237.brs b/.history/components/keyboardScene_20211013090237.brs
new file mode 100644
index 0000000..93f22b7
--- /dev/null
+++ b/.history/components/keyboardScene_20211013090237.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ ?m.video.trickPlayBar.getChild(7)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).height = 8
+ m.video.trickPlayBar.getChild(3).height = 8
+ m.video.trickPlayBar.getChild(4).height = 8
+ m.video.trickPlayBar.getChild(5).height = 8
+ m.video.trickPlayBar.getChild(6).height = 8
+ m.video.trickPlayBar.getChild(7).height = 8
+ m.video.trickPlayBar.getChild(8).height = 8
+ m.video.trickPlayBar.getChild(10).visible = false
+ m.video.trickPlayBar.getChild(11).visible = false
+ m.video.trickPlayBar.getChild(12).visible = false
+ m.video.trickPlayBar.getChild(13).visible = false
+ m.video.trickPlayBar.getChild(14).visible = false
+ m.video.trickPlayBar.getChild(15).visible = false
+ m.video.trickPlayBar.getChild(16).visible = false
+ m.video.trickPlayBar.getChild(17).visible = false
+ m.video.trickPlayBar.getChild(18).visible = false
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090246.brs b/.history/components/keyboardScene_20211013090246.brs
new file mode 100644
index 0000000..6fba3b5
--- /dev/null
+++ b/.history/components/keyboardScene_20211013090246.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ ?m.video.trickPlayBar.getChild(7)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(10).visible = false
+ m.video.trickPlayBar.getChild(11).visible = false
+ m.video.trickPlayBar.getChild(12).visible = false
+ m.video.trickPlayBar.getChild(13).visible = false
+ m.video.trickPlayBar.getChild(14).visible = false
+ m.video.trickPlayBar.getChild(15).visible = false
+ m.video.trickPlayBar.getChild(16).visible = false
+ m.video.trickPlayBar.getChild(17).visible = false
+ m.video.trickPlayBar.getChild(18).visible = false
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090357.brs b/.history/components/keyboardScene_20211013090357.brs
new file mode 100644
index 0000000..4f86140
--- /dev/null
+++ b/.history/components/keyboardScene_20211013090357.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ?m.video.trickPlayBar.getChild(10)
+ ?m.video.trickPlayBar.getChild(11)
+ ?m.video.trickPlayBar.getChild(12)
+ ?m.video.trickPlayBar.getChild(13)
+ ?m.video.trickPlayBar.getChild(14)
+ ?m.video.trickPlayBar.getChild(15)
+ ?m.video.trickPlayBar.getChild(16)
+ ?m.video.trickPlayBar.getChild(17)
+ ?m.video.trickPlayBar.getChild(18)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090424.brs b/.history/components/keyboardScene_20211013090424.brs
new file mode 100644
index 0000000..171f642
--- /dev/null
+++ b/.history/components/keyboardScene_20211013090424.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.trickPlayBar.getParent().getChild(7)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ?m.video.trickPlayBar.getChild(10)
+ ?m.video.trickPlayBar.getChild(11)
+ ?m.video.trickPlayBar.getChild(12)
+ ?m.video.trickPlayBar.getChild(13)
+ ?m.video.trickPlayBar.getChild(14)
+ ?m.video.trickPlayBar.getChild(15)
+ ?m.video.trickPlayBar.getChild(16)
+ ?m.video.trickPlayBar.getChild(17)
+ ?m.video.trickPlayBar.getChild(18)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090428.brs b/.history/components/keyboardScene_20211013090428.brs
new file mode 100644
index 0000000..f354aa2
--- /dev/null
+++ b/.history/components/keyboardScene_20211013090428.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.trickPlayBar.getParent().getChild(7)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ?m.video.trickPlayBar.getChild(10)
+ ?m.video.trickPlayBar.getChild(11)
+ ?m.video.trickPlayBar.getChild(12)
+ ?m.video.trickPlayBar.getChild(13)
+ ?m.video.trickPlayBar.getChild(14)
+ ?m.video.trickPlayBar.getChild(15)
+ ?m.video.trickPlayBar.getChild(16)
+ ?m.video.trickPlayBar.getChild(17)
+ ?m.video.trickPlayBar.getChild(18)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090430.brs b/.history/components/keyboardScene_20211013090430.brs
new file mode 100644
index 0000000..fa96ef7
--- /dev/null
+++ b/.history/components/keyboardScene_20211013090430.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.trickPlayBar.getParent().getChild(7)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ?m.video.trickPlayBar.getChild(10)
+ ?m.video.trickPlayBar.getChild(11)
+ ?m.video.trickPlayBar.getChild(12)
+ ?m.video.trickPlayBar.getChild(13)
+ ?m.video.trickPlayBar.getChild(14)
+ ?m.video.trickPlayBar.getChild(15)
+ ?m.video.trickPlayBar.getChild(16)
+ ?m.video.trickPlayBar.getChild(17)
+ ?m.video.trickPlayBar.getChild(18)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090606.brs b/.history/components/keyboardScene_20211013090606.brs
new file mode 100644
index 0000000..f2a067d
--- /dev/null
+++ b/.history/components/keyboardScene_20211013090606.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ?m.video.trickPlayBar.getChild(10)
+ ?m.video.trickPlayBar.getChild(11)
+ ?m.video.trickPlayBar.getChild(12)
+ ?m.video.trickPlayBar.getChild(13)
+ ?m.video.trickPlayBar.getChild(14)
+ ?m.video.trickPlayBar.getChild(15)
+ ?m.video.trickPlayBar.getChild(16)
+ ?m.video.trickPlayBar.getChild(17)
+ ?m.video.trickPlayBar.getChild(18)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090650.brs b/.history/components/keyboardScene_20211013090650.brs
new file mode 100644
index 0000000..85baf00
--- /dev/null
+++ b/.history/components/keyboardScene_20211013090650.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ?m.video.trickPlayBar.getChild(1)
+ ?m.video.trickPlayBar.getChild(2)
+ ?m.video.trickPlayBar.getChild(3)
+ ?m.video.trickPlayBar.getChild(4)
+ ?m.video.trickPlayBar.getChild(14)
+ ?m.video.trickPlayBar.getChild(15)
+ ?m.video.trickPlayBar.getChild(16)
+ ?m.video.trickPlayBar.getChild(17)
+ ?m.video.trickPlayBar.getChild(18)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091239.brs b/.history/components/keyboardScene_20211013091239.brs
new file mode 100644
index 0000000..c617de9
--- /dev/null
+++ b/.history/components/keyboardScene_20211013091239.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.trickPlayBar.getChild(1).visible = false
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ ?m.video.trickPlayBar.getChild(14)
+ ?m.video.trickPlayBar.getChild(15)
+ ?m.video.trickPlayBar.getChild(16)
+ ?m.video.trickPlayBar.getChild(17)
+ ?m.video.trickPlayBar.getChild(18)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091250.brs b/.history/components/keyboardScene_20211013091250.brs
new file mode 100644
index 0000000..091a2e0
--- /dev/null
+++ b/.history/components/keyboardScene_20211013091250.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber
+ ' test
+ m.video.trickPlayBar.getChild(1).visible = false
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ?m.video.trickPlayBar.getChild(14)
+ ?m.video.trickPlayBar.getChild(15)
+ ?m.video.trickPlayBar.getChild(16)
+ ?m.video.trickPlayBar.getChild(17)
+ ?m.video.trickPlayBar.getChild(18)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091409.brs b/.history/components/keyboardScene_20211013091409.brs
new file mode 100644
index 0000000..8724b9d
--- /dev/null
+++ b/.history/components/keyboardScene_20211013091409.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber
+ ' test
+ m.video.trickPlayBar.getChild(1).visible = true
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ?m.video.trickPlayBar.getChild(14)
+ ?m.video.trickPlayBar.getChild(15)
+ ?m.video.trickPlayBar.getChild(16)
+ ?m.video.trickPlayBar.getChild(17)
+ ?m.video.trickPlayBar.getChild(18)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091433.brs b/.history/components/keyboardScene_20211013091433.brs
new file mode 100644
index 0000000..71b7471
--- /dev/null
+++ b/.history/components/keyboardScene_20211013091433.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber
+ ' test
+ m.video.trickPlayBar.getChild(1).visible = true
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ?m.video.trickPlayBar.getChild(14)
+ ?m.video.trickPlayBar.getChild(15)
+ ?m.video.trickPlayBar.getChild(16)
+ ?m.video.trickPlayBar.getChild(17)
+ ?m.video.trickPlayBar.getChild(18)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091435.brs b/.history/components/keyboardScene_20211013091435.brs
new file mode 100644
index 0000000..81dc453
--- /dev/null
+++ b/.history/components/keyboardScene_20211013091435.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber
+ ' test
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ?m.video.trickPlayBar.getChild(14)
+ ?m.video.trickPlayBar.getChild(15)
+ ?m.video.trickPlayBar.getChild(16)
+ ?m.video.trickPlayBar.getChild(17)
+ ?m.video.trickPlayBar.getChild(18)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091614.brs b/.history/components/keyboardScene_20211013091614.brs
new file mode 100644
index 0000000..6a5de2c
--- /dev/null
+++ b/.history/components/keyboardScene_20211013091614.brs
@@ -0,0 +1,126 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber
+ ' test
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091744.brs b/.history/components/keyboardScene_20211013091744.brs
new file mode 100644
index 0000000..fe529ae
--- /dev/null
+++ b/.history/components/keyboardScene_20211013091744.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091801.brs b/.history/components/keyboardScene_20211013091801.brs
new file mode 100644
index 0000000..8db9fb6
--- /dev/null
+++ b/.history/components/keyboardScene_20211013091801.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091824.brs b/.history/components/keyboardScene_20211013091824.brs
new file mode 100644
index 0000000..8c9ddea
--- /dev/null
+++ b/.history/components/keyboardScene_20211013091824.brs
@@ -0,0 +1,126 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091843.brs b/.history/components/keyboardScene_20211013091843.brs
new file mode 100644
index 0000000..24b2dd4
--- /dev/null
+++ b/.history/components/keyboardScene_20211013091843.brs
@@ -0,0 +1,126 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChildCount()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013092139.brs b/.history/components/keyboardScene_20211013092139.brs
new file mode 100644
index 0000000..197b91d
--- /dev/null
+++ b/.history/components/keyboardScene_20211013092139.brs
@@ -0,0 +1,127 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(0)
+ ?m.video.getChild(1)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013092550.brs b/.history/components/keyboardScene_20211013092550.brs
new file mode 100644
index 0000000..1814aa7
--- /dev/null
+++ b/.history/components/keyboardScene_20211013092550.brs
@@ -0,0 +1,126 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildCount()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013092609.brs b/.history/components/keyboardScene_20211013092609.brs
new file mode 100644
index 0000000..7ca691e
--- /dev/null
+++ b/.history/components/keyboardScene_20211013092609.brs
@@ -0,0 +1,127 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildCount()
+ ?m.video.trickPlayBar
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013092733.brs b/.history/components/keyboardScene_20211013092733.brs
new file mode 100644
index 0000000..880ef42
--- /dev/null
+++ b/.history/components/keyboardScene_20211013092733.brs
@@ -0,0 +1,127 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ ?m.video.trickPlayBar
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013092747.brs b/.history/components/keyboardScene_20211013092747.brs
new file mode 100644
index 0000000..f7d8969
--- /dev/null
+++ b/.history/components/keyboardScene_20211013092747.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093145.brs b/.history/components/keyboardScene_20211013093145.brs
new file mode 100644
index 0000000..c62669e
--- /dev/null
+++ b/.history/components/keyboardScene_20211013093145.brs
@@ -0,0 +1,127 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093216.brs b/.history/components/keyboardScene_20211013093216.brs
new file mode 100644
index 0000000..ac2ff6c
--- /dev/null
+++ b/.history/components/keyboardScene_20211013093216.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ ?m.video.trickPlayBar.getParent().getChild(7)
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093416.brs b/.history/components/keyboardScene_20211013093416.brs
new file mode 100644
index 0000000..397c2ab
--- /dev/null
+++ b/.history/components/keyboardScene_20211013093416.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChildCount()
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getParent().getChild(7)
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093425.brs b/.history/components/keyboardScene_20211013093425.brs
new file mode 100644
index 0000000..f40f734
--- /dev/null
+++ b/.history/components/keyboardScene_20211013093425.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChildCount()
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChildCount
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093427.brs b/.history/components/keyboardScene_20211013093427.brs
new file mode 100644
index 0000000..3968b20
--- /dev/null
+++ b/.history/components/keyboardScene_20211013093427.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChildCount()
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChildCount()
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093435.brs b/.history/components/keyboardScene_20211013093435.brs
new file mode 100644
index 0000000..d9b7f3f
--- /dev/null
+++ b/.history/components/keyboardScene_20211013093435.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChildCount()
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093609.brs b/.history/components/keyboardScene_20211013093609.brs
new file mode 100644
index 0000000..c3a3d52
--- /dev/null
+++ b/.history/components/keyboardScene_20211013093609.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093716.brs b/.history/components/keyboardScene_20211013093716.brs
new file mode 100644
index 0000000..9482fd0
--- /dev/null
+++ b/.history/components/keyboardScene_20211013093716.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(8).vertiAlign = right
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093742.brs b/.history/components/keyboardScene_20211013093742.brs
new file mode 100644
index 0000000..dca2f0a
--- /dev/null
+++ b/.history/components/keyboardScene_20211013093742.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(8).vertAlign = right
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093901.brs b/.history/components/keyboardScene_20211013093901.brs
new file mode 100644
index 0000000..33f0ea0
--- /dev/null
+++ b/.history/components/keyboardScene_20211013093901.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(8).vertAlign = "right"
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094038.brs b/.history/components/keyboardScene_20211013094038.brs
new file mode 100644
index 0000000..d8cd21d
--- /dev/null
+++ b/.history/components/keyboardScene_20211013094038.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ m.video.trickPlayBar.getParent().getChild(8).vertAlign = "right"
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094149.brs b/.history/components/keyboardScene_20211013094149.brs
new file mode 100644
index 0000000..6046dec
--- /dev/null
+++ b/.history/components/keyboardScene_20211013094149.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
+ m.video.trickPlayBar.getParent().getChild(8).vertAlign = "right"
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094200.brs b/.history/components/keyboardScene_20211013094200.brs
new file mode 100644
index 0000000..3318142
--- /dev/null
+++ b/.history/components/keyboardScene_20211013094200.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).vertAlign = "right"
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094215.brs b/.history/components/keyboardScene_20211013094215.brs
new file mode 100644
index 0000000..2813bd8
--- /dev/null
+++ b/.history/components/keyboardScene_20211013094215.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
+ m.video.trickPlayBar.getParent().getChild(8).vertAlign = "right"
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094311.brs b/.history/components/keyboardScene_20211013094311.brs
new file mode 100644
index 0000000..1bc5596
--- /dev/null
+++ b/.history/components/keyboardScene_20211013094311.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
+ m.video.trickPlayBar.getParent().getChild(8).vertAlign = "center"
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094327.brs b/.history/components/keyboardScene_20211013094327.brs
new file mode 100644
index 0000000..6d94a25
--- /dev/null
+++ b/.history/components/keyboardScene_20211013094327.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
+ m.video.trickPlayBar.getParent().getChild(8).vertAlign = "center"
+ m.video.trickPlayBar.getParent().getChild(8).horizAlign = "right"
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094446.brs b/.history/components/keyboardScene_20211013094446.brs
new file mode 100644
index 0000000..4999272
--- /dev/null
+++ b/.history/components/keyboardScene_20211013094446.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
+ m.video.trickPlayBar.getParent().getChild(8).vertAlign = "center"
+ m.video.trickPlayBar.getParent().getChild(8).horizAlgin = "right"
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094518.brs b/.history/components/keyboardScene_20211013094518.brs
new file mode 100644
index 0000000..e80fd85
--- /dev/null
+++ b/.history/components/keyboardScene_20211013094518.brs
@@ -0,0 +1,137 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
+ m.video.trickPlayBar.getParent().getChild(8).vertAlign = "center"
+ m.video.trickPlayBar.getParent().getChild(8).horizAlgin = "right"
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(7)
+ ?m.video.trickPlayBar.getParent().getChild(8)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094725.brs b/.history/components/keyboardScene_20211013094725.brs
new file mode 100644
index 0000000..14d5e8b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013094725.brs
@@ -0,0 +1,140 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
+ m.video.trickPlayBar.getParent().getChild(8).vertAlign = "center"
+ m.video.trickPlayBar.getParent().getChild(8).horizAlgin = "right"
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(8)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094755.brs b/.history/components/keyboardScene_20211013094755.brs
new file mode 100644
index 0000000..db51cd3
--- /dev/null
+++ b/.history/components/keyboardScene_20211013094755.brs
@@ -0,0 +1,138 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(8)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094801.brs b/.history/components/keyboardScene_20211013094801.brs
new file mode 100644
index 0000000..d1a27e3
--- /dev/null
+++ b/.history/components/keyboardScene_20211013094801.brs
@@ -0,0 +1,138 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(8)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094955.brs b/.history/components/keyboardScene_20211013094955.brs
new file mode 100644
index 0000000..3e24701
--- /dev/null
+++ b/.history/components/keyboardScene_20211013094955.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(7).getChild(0).bitmapHeight = 8
+ m.video.trickPlayBar.getParent().getChild(7).getChild(2).bitmapHeight = 8
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(8)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095125.brs b/.history/components/keyboardScene_20211013095125.brs
new file mode 100644
index 0000000..220bd75
--- /dev/null
+++ b/.history/components/keyboardScene_20211013095125.brs
@@ -0,0 +1,137 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getParent().getChild(7).getChild(0).bitmapHeight = 8.0
+ m.video.trickPlayBar.getParent().getChild(7).getChild(1).bitmapHeight = 8.0
+ m.video.trickPlayBar.getParent().getChild(7).getChild(2).bitmapHeight = 8.0
+ m.video.trickPlayBar.getParent().getChild(7).getChild(3).bitmapHeight = 8.0
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(8)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095129.brs b/.history/components/keyboardScene_20211013095129.brs
new file mode 100644
index 0000000..b734c72
--- /dev/null
+++ b/.history/components/keyboardScene_20211013095129.brs
@@ -0,0 +1,133 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(8)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095302.brs b/.history/components/keyboardScene_20211013095302.brs
new file mode 100644
index 0000000..33ce3e1
--- /dev/null
+++ b/.history/components/keyboardScene_20211013095302.brs
@@ -0,0 +1,135 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?subType(m.video.trickPlayBar.getParent().getChild(7))
+ ?m.video.trickPlayBar.getParent().getChild(8)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095309.brs b/.history/components/keyboardScene_20211013095309.brs
new file mode 100644
index 0000000..17a64ce
--- /dev/null
+++ b/.history/components/keyboardScene_20211013095309.brs
@@ -0,0 +1,135 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(7).subType()
+ ?m.video.trickPlayBar.getParent().getChild(8)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095313.brs b/.history/components/keyboardScene_20211013095313.brs
new file mode 100644
index 0000000..540ac47
--- /dev/null
+++ b/.history/components/keyboardScene_20211013095313.brs
@@ -0,0 +1,139 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(7).subType()
+ ?m.video.trickPlayBar.getParent().getChild(8)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(7).getChild(0).bitmapHeight = 8.0
+ m.video.trickPlayBar.getParent().getChild(7).getChild(1).bitmapHeight = 8.0
+ m.video.trickPlayBar.getParent().getChild(7).getChild(2).bitmapHeight = 8.0
+ m.video.trickPlayBar.getParent().getChild(7).getChild(3).bitmapHeight = 8.0
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095352.brs b/.history/components/keyboardScene_20211013095352.brs
new file mode 100644
index 0000000..7ea1c4a
--- /dev/null
+++ b/.history/components/keyboardScene_20211013095352.brs
@@ -0,0 +1,138 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(8)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(7).getChild(0).bitmapHeight = 8.0
+ m.video.trickPlayBar.getParent().getChild(7).getChild(1).bitmapHeight = 8.0
+ m.video.trickPlayBar.getParent().getChild(7).getChild(2).bitmapHeight = 8.0
+ m.video.trickPlayBar.getParent().getChild(7).getChild(3).bitmapHeight = 8.0
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095507.brs b/.history/components/keyboardScene_20211013095507.brs
new file mode 100644
index 0000000..d5646e5
--- /dev/null
+++ b/.history/components/keyboardScene_20211013095507.brs
@@ -0,0 +1,134 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(4)
+ ?m.video.trickPlayBar.getParent().getChild(8)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095619.brs b/.history/components/keyboardScene_20211013095619.brs
new file mode 100644
index 0000000..f82dedd
--- /dev/null
+++ b/.history/components/keyboardScene_20211013095619.brs
@@ -0,0 +1,133 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(8)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095915.brs b/.history/components/keyboardScene_20211013095915.brs
new file mode 100644
index 0000000..405a314
--- /dev/null
+++ b/.history/components/keyboardScene_20211013095915.brs
@@ -0,0 +1,133 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(8)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100109.brs b/.history/components/keyboardScene_20211013100109.brs
new file mode 100644
index 0000000..c0c36e8
--- /dev/null
+++ b/.history/components/keyboardScene_20211013100109.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ ?m.video.trickPlayBar.getParent().getChild(9).getChild(0)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100114.brs b/.history/components/keyboardScene_20211013100114.brs
new file mode 100644
index 0000000..9c94fb4
--- /dev/null
+++ b/.history/components/keyboardScene_20211013100114.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ ?m.video.trickPlayBar.getParent().getChild(9)
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100321.brs b/.history/components/keyboardScene_20211013100321.brs
new file mode 100644
index 0000000..353d1d2
--- /dev/null
+++ b/.history/components/keyboardScene_20211013100321.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ ?m.video.trickPlayBar.getParent().getChild(10)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100413.brs b/.history/components/keyboardScene_20211013100413.brs
new file mode 100644
index 0000000..f3de087
--- /dev/null
+++ b/.history/components/keyboardScene_20211013100413.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ?m.video.trickPlayBar.getParent().getChild(10)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100611.brs b/.history/components/keyboardScene_20211013100611.brs
new file mode 100644
index 0000000..b3f2e66
--- /dev/null
+++ b/.history/components/keyboardScene_20211013100611.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100704.brs b/.history/components/keyboardScene_20211013100704.brs
new file mode 100644
index 0000000..b3f2e66
--- /dev/null
+++ b/.history/components/keyboardScene_20211013100704.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100732.brs b/.history/components/keyboardScene_20211013100732.brs
new file mode 100644
index 0000000..43402d6
--- /dev/null
+++ b/.history/components/keyboardScene_20211013100732.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(7)
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100741.brs b/.history/components/keyboardScene_20211013100741.brs
new file mode 100644
index 0000000..b3f2e66
--- /dev/null
+++ b/.history/components/keyboardScene_20211013100741.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getParent().getChild(7).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101010.brs b/.history/components/keyboardScene_20211013101010.brs
new file mode 100644
index 0000000..6a133e5
--- /dev/null
+++ b/.history/components/keyboardScene_20211013101010.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChildCount()
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101053.brs b/.history/components/keyboardScene_20211013101053.brs
new file mode 100644
index 0000000..99fda62
--- /dev/null
+++ b/.history/components/keyboardScene_20211013101053.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChildCount()
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101209.brs b/.history/components/keyboardScene_20211013101209.brs
new file mode 100644
index 0000000..4a94f80
--- /dev/null
+++ b/.history/components/keyboardScene_20211013101209.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ?m.video.trickPlayBar.getChild(0)
+ ?m.video.trickPlayBar.getChild(1)
+ ?m.video.trickPlayBar.getChild(2)
+ ?m.video.trickPlayBar.getChild(2)
+ ?m.video.trickPlayBar.getChild(3)
+ ?m.video.trickPlayBar.getChild(4)
+ ?m.video.trickPlayBar.getChild(5)
+ ?m.video.trickPlayBar.getChild(6)
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101219.brs b/.history/components/keyboardScene_20211013101219.brs
new file mode 100644
index 0000000..d00c9c9
--- /dev/null
+++ b/.history/components/keyboardScene_20211013101219.brs
@@ -0,0 +1,138 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ?m.video.trickPlayBar.getChild(0)
+ ?m.video.trickPlayBar.getChild(1)
+ ?m.video.trickPlayBar.getChild(2)
+ ?m.video.trickPlayBar.getChild(2)
+ ?m.video.trickPlayBar.getChild(3)
+ ?m.video.trickPlayBar.getChild(4)
+ ?m.video.trickPlayBar.getChild(5)
+ ?m.video.trickPlayBar.getChild(6)
+ ?m.video.trickPlayBar.getChild(7)
+ ?m.video.trickPlayBar.getChild(8)
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101612.brs b/.history/components/keyboardScene_20211013101612.brs
new file mode 100644
index 0000000..fa94b56
--- /dev/null
+++ b/.history/components/keyboardScene_20211013101612.brs
@@ -0,0 +1,139 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ?m.video.trickPlayBar.getChild(0)
+ ?m.video.trickPlayBar.getChild(1)
+ ?m.video.trickPlayBar.getChild(2)
+ ?m.video.trickPlayBar.getChild(2)
+ ?m.video.trickPlayBar.getChild(3)
+ ?m.video.trickPlayBar.getChild(4)
+ ?m.video.trickPlayBar.getChild(5)
+ ?m.video.trickPlayBar.getChild(6)
+ ?m.video.trickPlayBar.getChild(7)
+ ?m.video.trickPlayBar.getChild(8)
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101628.brs b/.history/components/keyboardScene_20211013101628.brs
new file mode 100644
index 0000000..fa94b56
--- /dev/null
+++ b/.history/components/keyboardScene_20211013101628.brs
@@ -0,0 +1,139 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ?m.video.trickPlayBar.getChild(0)
+ ?m.video.trickPlayBar.getChild(1)
+ ?m.video.trickPlayBar.getChild(2)
+ ?m.video.trickPlayBar.getChild(2)
+ ?m.video.trickPlayBar.getChild(3)
+ ?m.video.trickPlayBar.getChild(4)
+ ?m.video.trickPlayBar.getChild(5)
+ ?m.video.trickPlayBar.getChild(6)
+ ?m.video.trickPlayBar.getChild(7)
+ ?m.video.trickPlayBar.getChild(8)
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101701.brs b/.history/components/keyboardScene_20211013101701.brs
new file mode 100644
index 0000000..490fe15
--- /dev/null
+++ b/.history/components/keyboardScene_20211013101701.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101702.brs b/.history/components/keyboardScene_20211013101702.brs
new file mode 100644
index 0000000..bda3921
--- /dev/null
+++ b/.history/components/keyboardScene_20211013101702.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.height = 10
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101804.brs b/.history/components/keyboardScene_20211013101804.brs
new file mode 100644
index 0000000..4179798
--- /dev/null
+++ b/.history/components/keyboardScene_20211013101804.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 8.0
+ m.video.bufferingBar.height = 8.0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101906.brs b/.history/components/keyboardScene_20211013101906.brs
new file mode 100644
index 0000000..9ef3a7b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013101906.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 8.0
+ m.video.bufferingBar.height = 8.0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.retrievingBar.height = 8.0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102044.brs b/.history/components/keyboardScene_20211013102044.brs
new file mode 100644
index 0000000..3ccf95c
--- /dev/null
+++ b/.history/components/keyboardScene_20211013102044.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 8.0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.retrievingBar.height = 8.0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102050.brs b/.history/components/keyboardScene_20211013102050.brs
new file mode 100644
index 0000000..38bfdcf
--- /dev/null
+++ b/.history/components/keyboardScene_20211013102050.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 8.0
+ ?m.video.bufferingBar.height
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.retrievingBar.height = 8.0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102112.brs b/.history/components/keyboardScene_20211013102112.brs
new file mode 100644
index 0000000..6b58380
--- /dev/null
+++ b/.history/components/keyboardScene_20211013102112.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 8.0
+ ?m.video.bufferingBar.height
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.retrievingBar.height = 8.0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102231.brs b/.history/components/keyboardScene_20211013102231.brs
new file mode 100644
index 0000000..497a261
--- /dev/null
+++ b/.history/components/keyboardScene_20211013102231.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 8.0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.retrievingBar.height = 8.0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102345.brs b/.history/components/keyboardScene_20211013102345.brs
new file mode 100644
index 0000000..b7ff957
--- /dev/null
+++ b/.history/components/keyboardScene_20211013102345.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 8.0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.retrievingBar.height = 8.0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.width = 50
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102451.brs b/.history/components/keyboardScene_20211013102451.brs
new file mode 100644
index 0000000..bb15b9b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013102451.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 4.0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.retrievingBar.height = 8.0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.width = 50
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102459.brs b/.history/components/keyboardScene_20211013102459.brs
new file mode 100644
index 0000000..e9df415
--- /dev/null
+++ b/.history/components/keyboardScene_20211013102459.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 4.0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.retrievingBar.height = 8.0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102726.brs b/.history/components/keyboardScene_20211013102726.brs
new file mode 100644
index 0000000..a584454
--- /dev/null
+++ b/.history/components/keyboardScene_20211013102726.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 4.0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.retrievingBar.height = 8.0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102731.brs b/.history/components/keyboardScene_20211013102731.brs
new file mode 100644
index 0000000..25c5e45
--- /dev/null
+++ b/.history/components/keyboardScene_20211013102731.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 8.0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.retrievingBar.height = 8.0
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102735.brs b/.history/components/keyboardScene_20211013102735.brs
new file mode 100644
index 0000000..ca88203
--- /dev/null
+++ b/.history/components/keyboardScene_20211013102735.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 8.0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102942.brs b/.history/components/keyboardScene_20211013102942.brs
new file mode 100644
index 0000000..cf8097d
--- /dev/null
+++ b/.history/components/keyboardScene_20211013102942.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103048.brs b/.history/components/keyboardScene_20211013103048.brs
new file mode 100644
index 0000000..692ef6f
--- /dev/null
+++ b/.history/components/keyboardScene_20211013103048.brs
@@ -0,0 +1,126 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103053.brs b/.history/components/keyboardScene_20211013103053.brs
new file mode 100644
index 0000000..19556b5
--- /dev/null
+++ b/.history/components/keyboardScene_20211013103053.brs
@@ -0,0 +1,124 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103117.brs b/.history/components/keyboardScene_20211013103117.brs
new file mode 100644
index 0000000..19556b5
--- /dev/null
+++ b/.history/components/keyboardScene_20211013103117.brs
@@ -0,0 +1,124 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103253.brs b/.history/components/keyboardScene_20211013103253.brs
new file mode 100644
index 0000000..16a41c3
--- /dev/null
+++ b/.history/components/keyboardScene_20211013103253.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103329.brs b/.history/components/keyboardScene_20211013103329.brs
new file mode 100644
index 0000000..ef36ed3
--- /dev/null
+++ b/.history/components/keyboardScene_20211013103329.brs
@@ -0,0 +1,126 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(3)
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103340.brs b/.history/components/keyboardScene_20211013103340.brs
new file mode 100644
index 0000000..ef1aaae
--- /dev/null
+++ b/.history/components/keyboardScene_20211013103340.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(3)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103508.brs b/.history/components/keyboardScene_20211013103508.brs
new file mode 100644
index 0000000..29b5cb6
--- /dev/null
+++ b/.history/components/keyboardScene_20211013103508.brs
@@ -0,0 +1,124 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103610.brs b/.history/components/keyboardScene_20211013103610.brs
new file mode 100644
index 0000000..506e4c1
--- /dev/null
+++ b/.history/components/keyboardScene_20211013103610.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ ?m.video.trickPlayBar.getParent().getChild(10)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103822.brs b/.history/components/keyboardScene_20211013103822.brs
new file mode 100644
index 0000000..11b3c43
--- /dev/null
+++ b/.history/components/keyboardScene_20211013103822.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ ?m.video.bufferingBar
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013104007.brs b/.history/components/keyboardScene_20211013104007.brs
new file mode 100644
index 0000000..cee0f8d
--- /dev/null
+++ b/.history/components/keyboardScene_20211013104007.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ ?m.video.bufferingBar.getChildCount()
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013104125.brs b/.history/components/keyboardScene_20211013104125.brs
new file mode 100644
index 0000000..1a824c7
--- /dev/null
+++ b/.history/components/keyboardScene_20211013104125.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ ?m.video.bufferingBar.getChild(0)
+ ?m.video.bufferingBar.getChild(2)
+ ?m.video.bufferingBar.getChild(3)
+ ?m.video.bufferingBar.getChild(4)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013104129.brs b/.history/components/keyboardScene_20211013104129.brs
new file mode 100644
index 0000000..d952426
--- /dev/null
+++ b/.history/components/keyboardScene_20211013104129.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+ ?m.video.bufferingBar.getChild(0)
+ ?m.video.bufferingBar.getChild(1)
+ ?m.video.bufferingBar.getChild(2)
+ ?m.video.bufferingBar.getChild(3)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013104607.brs b/.history/components/keyboardScene_20211013104607.brs
new file mode 100644
index 0000000..69b3d8b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013104607.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013111804.brs b/.history/components/keyboardScene_20211013111804.brs
new file mode 100644
index 0000000..705add1
--- /dev/null
+++ b/.history/components/keyboardScene_20211013111804.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013112056.brs b/.history/components/keyboardScene_20211013112056.brs
new file mode 100644
index 0000000..701cfd7
--- /dev/null
+++ b/.history/components/keyboardScene_20211013112056.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013112130.brs b/.history/components/keyboardScene_20211013112130.brs
new file mode 100644
index 0000000..7ae7ecc
--- /dev/null
+++ b/.history/components/keyboardScene_20211013112130.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013112734.brs b/.history/components/keyboardScene_20211013112734.brs
new file mode 100644
index 0000000..567d1d8
--- /dev/null
+++ b/.history/components/keyboardScene_20211013112734.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013112809.brs b/.history/components/keyboardScene_20211013112809.brs
new file mode 100644
index 0000000..240722e
--- /dev/null
+++ b/.history/components/keyboardScene_20211013112809.brs
@@ -0,0 +1,149 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ handled = false
+ if press then
+ if (key = "back") then
+ handled = false
+ else
+ if (m.warninglabel.visible = false)
+ m.warninglabel.visible = "true"
+ else
+ if (key = "OK") then
+ m.warninglabel.visible = "false"
+ end if
+ end if
+ handled = true
+ end if
+ end if
+ return handled
+end function
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013112832.brs b/.history/components/keyboardScene_20211013112832.brs
new file mode 100644
index 0000000..42fcd6b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013112832.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013112904.brs b/.history/components/keyboardScene_20211013112904.brs
new file mode 100644
index 0000000..42fcd6b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013112904.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013112911.brs b/.history/components/keyboardScene_20211013112911.brs
new file mode 100644
index 0000000..737aebb
--- /dev/null
+++ b/.history/components/keyboardScene_20211013112911.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013112916.brs b/.history/components/keyboardScene_20211013112916.brs
new file mode 100644
index 0000000..3ff9784
--- /dev/null
+++ b/.history/components/keyboardScene_20211013112916.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013112931.brs b/.history/components/keyboardScene_20211013112931.brs
new file mode 100644
index 0000000..0c776d0
--- /dev/null
+++ b/.history/components/keyboardScene_20211013112931.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND m.video.trickPlayBar.visible = false
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013112957.brs b/.history/components/keyboardScene_20211013112957.brs
new file mode 100644
index 0000000..798b48c
--- /dev/null
+++ b/.history/components/keyboardScene_20211013112957.brs
@@ -0,0 +1,134 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND m.video.trickPlayBar.visible = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.visible.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013113346.brs b/.history/components/keyboardScene_20211013113346.brs
new file mode 100644
index 0000000..59d6599
--- /dev/null
+++ b/.history/components/keyboardScene_20211013113346.brs
@@ -0,0 +1,134 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND tricky = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.visible.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ tricky = createObject("roSGNode", "TrickPlay")
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013113353.brs b/.history/components/keyboardScene_20211013113353.brs
new file mode 100644
index 0000000..643b7c1
--- /dev/null
+++ b/.history/components/keyboardScene_20211013113353.brs
@@ -0,0 +1,134 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND tricky.visible = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.visible.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ tricky = createObject("roSGNode", "TrickPlay")
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013113420.brs b/.history/components/keyboardScene_20211013113420.brs
new file mode 100644
index 0000000..93a4349
--- /dev/null
+++ b/.history/components/keyboardScene_20211013113420.brs
@@ -0,0 +1,135 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND tricky.visible = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.visible.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ tricky = createObject("roSGNode", "TrickPlay")
+ tricky.visible = false
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013113430.brs b/.history/components/keyboardScene_20211013113430.brs
new file mode 100644
index 0000000..a6019c4
--- /dev/null
+++ b/.history/components/keyboardScene_20211013113430.brs
@@ -0,0 +1,135 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND, .tricky.visible = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.visible.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ , .tricky = createObject("roSGNode", "TrickPlay")
+ , .tricky.visible = false
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013113434.brs b/.history/components/keyboardScene_20211013113434.brs
new file mode 100644
index 0000000..576400d
--- /dev/null
+++ b/.history/components/keyboardScene_20211013113434.brs
@@ -0,0 +1,135 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND m.tricky.visible = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.visible.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.tricky.visible = false
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013113448.brs b/.history/components/keyboardScene_20211013113448.brs
new file mode 100644
index 0000000..6a0b6b4
--- /dev/null
+++ b/.history/components/keyboardScene_20211013113448.brs
@@ -0,0 +1,135 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND m.tricky.visible = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.tricky.visible = false
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013113930.brs b/.history/components/keyboardScene_20211013113930.brs
new file mode 100644
index 0000000..ce2bccd
--- /dev/null
+++ b/.history/components/keyboardScene_20211013113930.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND m.tricky.visible = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.tricky.visible = false
+ m.video.appendChild(m.tricky)
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013114149.brs b/.history/components/keyboardScene_20211013114149.brs
new file mode 100644
index 0000000..08772fa
--- /dev/null
+++ b/.history/components/keyboardScene_20211013114149.brs
@@ -0,0 +1,135 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND m.tricky.visible = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.video.appendChild(m.tricky)
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013114208.brs b/.history/components/keyboardScene_20211013114208.brs
new file mode 100644
index 0000000..801dd7c
--- /dev/null
+++ b/.history/components/keyboardScene_20211013114208.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND m.tricky.visible = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.video.appendChild(m.tricky)
+ ?m.video.getChildren(2, 0)
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013114259.brs b/.history/components/keyboardScene_20211013114259.brs
new file mode 100644
index 0000000..b1f96f4
--- /dev/null
+++ b/.history/components/keyboardScene_20211013114259.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND m.tricky.visible = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.video.appendChild(m.tricky)
+ ?m.video.getChild(1)
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013114359.brs b/.history/components/keyboardScene_20211013114359.brs
new file mode 100644
index 0000000..9700396
--- /dev/null
+++ b/.history/components/keyboardScene_20211013114359.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND m.tricky.visible = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.video.appendChild(m.tricky)
+ ?m.video.getChild(1).getChildCount()
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013114558.brs b/.history/components/keyboardScene_20211013114558.brs
new file mode 100644
index 0000000..7b70857
--- /dev/null
+++ b/.history/components/keyboardScene_20211013114558.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND m.tricky.visible = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ ?m.video.removeChildrenIndex(1, 1)
+ m.video.appendChild(m.tricky)
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013114601.brs b/.history/components/keyboardScene_20211013114601.brs
new file mode 100644
index 0000000..f899858
--- /dev/null
+++ b/.history/components/keyboardScene_20211013114601.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND m.tricky.visible = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.video.removeChildrenIndex(1, 1)
+ m.video.appendChild(m.tricky)
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013114638.brs b/.history/components/keyboardScene_20211013114638.brs
new file mode 100644
index 0000000..ae035b9
--- /dev/null
+++ b/.history/components/keyboardScene_20211013114638.brs
@@ -0,0 +1,137 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND m.tricky.visible = false
+ m.video.trickPlayBar.visible = true
+ m.video.trickPlayBar.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.enableTrickPlay = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.video.removeChildrenIndex(1, 1)
+ m.video.appendChild(m.tricky)
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013114900.brs b/.history/components/keyboardScene_20211013114900.brs
new file mode 100644
index 0000000..80b1e57
--- /dev/null
+++ b/.history/components/keyboardScene_20211013114900.brs
@@ -0,0 +1,137 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND m.tricky.visible = false
+ m.video.visible = true
+ m.video.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.enableTrickPlay = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.video.removeChildrenIndex(1, 1)
+ m.video.appendChild(m.tricky)
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013114903.brs b/.history/components/keyboardScene_20211013114903.brs
new file mode 100644
index 0000000..f7b1399
--- /dev/null
+++ b/.history/components/keyboardScene_20211013114903.brs
@@ -0,0 +1,137 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ else if press AND m.tricky.visible = false
+ m.video.tricky.visible = true
+ m.video.tricky.setFocus(true)
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.enableTrickPlay = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.video.removeChildrenIndex(1, 1)
+ m.video.appendChild(m.tricky)
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013114922.brs b/.history/components/keyboardScene_20211013114922.brs
new file mode 100644
index 0000000..17d7d12
--- /dev/null
+++ b/.history/components/keyboardScene_20211013114922.brs
@@ -0,0 +1,134 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.enableTrickPlay = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.video.removeChildrenIndex(1, 1)
+ m.video.appendChild(m.tricky)
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013114926.brs b/.history/components/keyboardScene_20211013114926.brs
new file mode 100644
index 0000000..265e29f
--- /dev/null
+++ b/.history/components/keyboardScene_20211013114926.brs
@@ -0,0 +1,135 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.enableTrickPlay = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.video.removeChildrenIndex(1, 1)
+ m.video.appendChild(m.tricky)
+ m.video.tricky.setFocus(true)
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013115137.brs b/.history/components/keyboardScene_20211013115137.brs
new file mode 100644
index 0000000..265e29f
--- /dev/null
+++ b/.history/components/keyboardScene_20211013115137.brs
@@ -0,0 +1,135 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.enableTrickPlay = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.video.removeChildrenIndex(1, 1)
+ m.video.appendChild(m.tricky)
+ m.video.tricky.setFocus(true)
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013115148.brs b/.history/components/keyboardScene_20211013115148.brs
new file mode 100644
index 0000000..10747a0
--- /dev/null
+++ b/.history/components/keyboardScene_20211013115148.brs
@@ -0,0 +1,135 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.enableTrickPlay = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.video.removeChildrenIndex(1, 1)
+ m.video.appendChild(m.tricky)
+ m.video.getChild(1).setFocus(true)
+ ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ ' m.video.trickPlayBar.getChild(0).height = 8
+ ' m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013115449.brs b/.history/components/keyboardScene_20211013115449.brs
new file mode 100644
index 0000000..a584fac
--- /dev/null
+++ b/.history/components/keyboardScene_20211013115449.brs
@@ -0,0 +1,115 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = false
+ m.video.enableTrickPlay = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.video.removeChildrenIndex(1, 1)
+ m.video.appendChild(m.tricky)
+ m.video.getChild(1).setFocus(true)
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013115508.brs b/.history/components/keyboardScene_20211013115508.brs
new file mode 100644
index 0000000..f44d00f
--- /dev/null
+++ b/.history/components/keyboardScene_20211013115508.brs
@@ -0,0 +1,115 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = true
+ m.video.enableTrickPlay = false
+ m.video.seekMode = "accurate"
+ m.tricky = createObject("roSGNode", "TrickPlay")
+ m.video.removeChildrenIndex(1, 1)
+ m.video.appendChild(m.tricky)
+ m.video.getChild(1).setFocus(true)
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013115641.brs b/.history/components/keyboardScene_20211013115641.brs
new file mode 100644
index 0000000..cdbf5d1
--- /dev/null
+++ b/.history/components/keyboardScene_20211013115641.brs
@@ -0,0 +1,113 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = true
+ m.video.enableTrickPlay = false
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
+
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013115642.brs b/.history/components/keyboardScene_20211013115642.brs
new file mode 100644
index 0000000..63d1170
--- /dev/null
+++ b/.history/components/keyboardScene_20211013115642.brs
@@ -0,0 +1,112 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.enableUI = true
+ m.video.enableTrickPlay = false
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
+
diff --git a/.history/components/keyboardScene_20211013120029.brs b/.history/components/keyboardScene_20211013120029.brs
new file mode 100644
index 0000000..e28a087
--- /dev/null
+++ b/.history/components/keyboardScene_20211013120029.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120221.brs b/.history/components/keyboardScene_20211013120221.brs
new file mode 100644
index 0000000..e28a087
--- /dev/null
+++ b/.history/components/keyboardScene_20211013120221.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120222.brs b/.history/components/keyboardScene_20211013120222.brs
new file mode 100644
index 0000000..e28a087
--- /dev/null
+++ b/.history/components/keyboardScene_20211013120222.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120224.brs b/.history/components/keyboardScene_20211013120224.brs
new file mode 100644
index 0000000..e28a087
--- /dev/null
+++ b/.history/components/keyboardScene_20211013120224.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ' ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120310.brs b/.history/components/keyboardScene_20211013120310.brs
new file mode 100644
index 0000000..9710723
--- /dev/null
+++ b/.history/components/keyboardScene_20211013120310.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120433.brs b/.history/components/keyboardScene_20211013120433.brs
new file mode 100644
index 0000000..51fa59b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013120433.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).opacity = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120455.brs b/.history/components/keyboardScene_20211013120455.brs
new file mode 100644
index 0000000..fcab9aa
--- /dev/null
+++ b/.history/components/keyboardScene_20211013120455.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).opacity = false
+ m.video.trickPlayBar.getChild(3).opacity = false
+ m.video.trickPlayBar.getChild(4).opacity = false
+ m.video.trickPlayBar.getChild(5).opacity = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120556.brs b/.history/components/keyboardScene_20211013120556.brs
new file mode 100644
index 0000000..5c27072
--- /dev/null
+++ b/.history/components/keyboardScene_20211013120556.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120716.brs b/.history/components/keyboardScene_20211013120716.brs
new file mode 100644
index 0000000..69b3d8b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013120716.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120749.brs b/.history/components/keyboardScene_20211013120749.brs
new file mode 100644
index 0000000..5a7c9c2
--- /dev/null
+++ b/.history/components/keyboardScene_20211013120749.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120941.brs b/.history/components/keyboardScene_20211013120941.brs
new file mode 100644
index 0000000..5a7c9c2
--- /dev/null
+++ b/.history/components/keyboardScene_20211013120941.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120950.brs b/.history/components/keyboardScene_20211013120950.brs
new file mode 100644
index 0000000..69b3d8b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013120950.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121009.brs b/.history/components/keyboardScene_20211013121009.brs
new file mode 100644
index 0000000..b1f829e
--- /dev/null
+++ b/.history/components/keyboardScene_20211013121009.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.thumbBlendColor = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121301.brs b/.history/components/keyboardScene_20211013121301.brs
new file mode 100644
index 0000000..8308af8
--- /dev/null
+++ b/.history/components/keyboardScene_20211013121301.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.thumbBlendColor = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121308.brs b/.history/components/keyboardScene_20211013121308.brs
new file mode 100644
index 0000000..f8e277a
--- /dev/null
+++ b/.history/components/keyboardScene_20211013121308.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121430.brs b/.history/components/keyboardScene_20211013121430.brs
new file mode 100644
index 0000000..f8e277a
--- /dev/null
+++ b/.history/components/keyboardScene_20211013121430.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121510.brs b/.history/components/keyboardScene_20211013121510.brs
new file mode 100644
index 0000000..55d51e5
--- /dev/null
+++ b/.history/components/keyboardScene_20211013121510.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChild(1)
+
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121513.brs b/.history/components/keyboardScene_20211013121513.brs
new file mode 100644
index 0000000..deaceb2
--- /dev/null
+++ b/.history/components/keyboardScene_20211013121513.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChild(1)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121642.brs b/.history/components/keyboardScene_20211013121642.brs
new file mode 100644
index 0000000..8f1ce32
--- /dev/null
+++ b/.history/components/keyboardScene_20211013121642.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121733.brs b/.history/components/keyboardScene_20211013121733.brs
new file mode 100644
index 0000000..8b599cc
--- /dev/null
+++ b/.history/components/keyboardScene_20211013121733.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(9)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121813.brs b/.history/components/keyboardScene_20211013121813.brs
new file mode 100644
index 0000000..abfbe1a
--- /dev/null
+++ b/.history/components/keyboardScene_20211013121813.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(9)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121920.brs b/.history/components/keyboardScene_20211013121920.brs
new file mode 100644
index 0000000..07543be
--- /dev/null
+++ b/.history/components/keyboardScene_20211013121920.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getParent().getChild(9)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013122052.brs b/.history/components/keyboardScene_20211013122052.brs
new file mode 100644
index 0000000..05c4663
--- /dev/null
+++ b/.history/components/keyboardScene_20211013122052.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getParent().getChild(5)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013122203.brs b/.history/components/keyboardScene_20211013122203.brs
new file mode 100644
index 0000000..c1157a7
--- /dev/null
+++ b/.history/components/keyboardScene_20211013122203.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getParent().getChild(5).getChildCount()
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013122255.brs b/.history/components/keyboardScene_20211013122255.brs
new file mode 100644
index 0000000..9309175
--- /dev/null
+++ b/.history/components/keyboardScene_20211013122255.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getParent().getChild(5).getChildren(19, 0)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013122346.brs b/.history/components/keyboardScene_20211013122346.brs
new file mode 100644
index 0000000..e17ba6d
--- /dev/null
+++ b/.history/components/keyboardScene_20211013122346.brs
@@ -0,0 +1,138 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(4)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(5)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(6)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(7)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(8)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+ ?m.video.trickPlayBar.getParent().getChild(8)
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013122751.brs b/.history/components/keyboardScene_20211013122751.brs
new file mode 100644
index 0000000..94f155d
--- /dev/null
+++ b/.history/components/keyboardScene_20211013122751.brs
@@ -0,0 +1,137 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(4)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(5)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(6)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(7)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(8)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013122827.brs b/.history/components/keyboardScene_20211013122827.brs
new file mode 100644
index 0000000..ed9fcd6
--- /dev/null
+++ b/.history/components/keyboardScene_20211013122827.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013122956.brs b/.history/components/keyboardScene_20211013122956.brs
new file mode 100644
index 0000000..cd491c1
--- /dev/null
+++ b/.history/components/keyboardScene_20211013122956.brs
@@ -0,0 +1,137 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(2).translation = [200, 200]
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(4)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(5)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(6)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(7)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(8)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123106.brs b/.history/components/keyboardScene_20211013123106.brs
new file mode 100644
index 0000000..cf99521
--- /dev/null
+++ b/.history/components/keyboardScene_20211013123106.brs
@@ -0,0 +1,137 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(1)
+ m.video.trickPlayBar.getParent().getChild(5).getChild(2).translation = [200, 200]
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(4)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(5)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(6)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(7)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(8)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123338.brs b/.history/components/keyboardScene_20211013123338.brs
new file mode 100644
index 0000000..919845d
--- /dev/null
+++ b/.history/components/keyboardScene_20211013123338.brs
@@ -0,0 +1,137 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(4)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(5)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(6)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(7)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(8)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ?m.video.trickPlayBar.getChild(2).visible = false
+ ?m.video.trickPlayBar.getChild(3)
+ ?m.video.trickPlayBar.getChild(4)
+ ?m.video.trickPlayBar.getChild(5)
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123348.brs b/.history/components/keyboardScene_20211013123348.brs
new file mode 100644
index 0000000..1bcbdb1
--- /dev/null
+++ b/.history/components/keyboardScene_20211013123348.brs
@@ -0,0 +1,137 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(4)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(5)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(6)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(7)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(8)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ?m.video.trickPlayBar.getChild(2)
+ ?m.video.trickPlayBar.getChild(3)
+ ?m.video.trickPlayBar.getChild(4)
+ ?m.video.trickPlayBar.getChild(5)
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123553.brs b/.history/components/keyboardScene_20211013123553.brs
new file mode 100644
index 0000000..94f155d
--- /dev/null
+++ b/.history/components/keyboardScene_20211013123553.brs
@@ -0,0 +1,137 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(0)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(1)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(2)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(3)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(4)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(5)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(6)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(7)
+ ?m.video.trickPlayBar.getParent().getChild(5).getChild(8)
+ ' ?m.video.trickPlayBar.getChildren(19, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' ?m.video.trickPlayBar.getChild(9)
+
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123635.brs b/.history/components/keyboardScene_20211013123635.brs
new file mode 100644
index 0000000..675098d
--- /dev/null
+++ b/.history/components/keyboardScene_20211013123635.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123640.brs b/.history/components/keyboardScene_20211013123640.brs
new file mode 100644
index 0000000..acdd585
--- /dev/null
+++ b/.history/components/keyboardScene_20211013123640.brs
@@ -0,0 +1,124 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123711.brs b/.history/components/keyboardScene_20211013123711.brs
new file mode 100644
index 0000000..7d4f295
--- /dev/null
+++ b/.history/components/keyboardScene_20211013123711.brs
@@ -0,0 +1,124 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(1).opacity = 0
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123930.brs b/.history/components/keyboardScene_20211013123930.brs
new file mode 100644
index 0000000..6d8dca9
--- /dev/null
+++ b/.history/components/keyboardScene_20211013123930.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123941.brs b/.history/components/keyboardScene_20211013123941.brs
new file mode 100644
index 0000000..417e8a5
--- /dev/null
+++ b/.history/components/keyboardScene_20211013123941.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ?m.video.getChild(0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124048.brs b/.history/components/keyboardScene_20211013124048.brs
new file mode 100644
index 0000000..b490b6e
--- /dev/null
+++ b/.history/components/keyboardScene_20211013124048.brs
@@ -0,0 +1,124 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124103.brs b/.history/components/keyboardScene_20211013124103.brs
new file mode 100644
index 0000000..654e960
--- /dev/null
+++ b/.history/components/keyboardScene_20211013124103.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ m.video.bufferingBar.height = 8.0
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ' m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124315.brs b/.history/components/keyboardScene_20211013124315.brs
new file mode 100644
index 0000000..b490b6e
--- /dev/null
+++ b/.history/components/keyboardScene_20211013124315.brs
@@ -0,0 +1,124 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124342.brs b/.history/components/keyboardScene_20211013124342.brs
new file mode 100644
index 0000000..654e960
--- /dev/null
+++ b/.history/components/keyboardScene_20211013124342.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ m.video.bufferingBar.height = 8.0
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ' m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124356.brs b/.history/components/keyboardScene_20211013124356.brs
new file mode 100644
index 0000000..3c3c212
--- /dev/null
+++ b/.history/components/keyboardScene_20211013124356.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.bufferingBar.height = 8.0
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ' m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124407.brs b/.history/components/keyboardScene_20211013124407.brs
new file mode 100644
index 0000000..95f30e9
--- /dev/null
+++ b/.history/components/keyboardScene_20211013124407.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.bufferingBar.height = 8.0
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ ' m.video.bufferingBar.height = 8.0
+
+
+ ' logging
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124600.brs b/.history/components/keyboardScene_20211013124600.brs
new file mode 100644
index 0000000..f11c535
--- /dev/null
+++ b/.history/components/keyboardScene_20211013124600.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124601.brs b/.history/components/keyboardScene_20211013124601.brs
new file mode 100644
index 0000000..77149f7
--- /dev/null
+++ b/.history/components/keyboardScene_20211013124601.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+
+
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124605.brs b/.history/components/keyboardScene_20211013124605.brs
new file mode 100644
index 0000000..296a08c
--- /dev/null
+++ b/.history/components/keyboardScene_20211013124605.brs
@@ -0,0 +1,119 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124801.brs b/.history/components/keyboardScene_20211013124801.brs
new file mode 100644
index 0000000..bf6f2dd
--- /dev/null
+++ b/.history/components/keyboardScene_20211013124801.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ØŸm.video.trickPlayBar.getChild(0)
+ ?m.video.trickPlayBar.getChild(1)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124803.brs b/.history/components/keyboardScene_20211013124803.brs
new file mode 100644
index 0000000..01ac070
--- /dev/null
+++ b/.history/components/keyboardScene_20211013124803.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(0)
+ ?m.video.trickPlayBar.getChild(1)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124813.brs b/.history/components/keyboardScene_20211013124813.brs
new file mode 100644
index 0000000..b3f7570
--- /dev/null
+++ b/.history/components/keyboardScene_20211013124813.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(0)
+ ?m.video.trickPlayBar.getChild(1)
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124917.brs b/.history/components/keyboardScene_20211013124917.brs
new file mode 100644
index 0000000..4f99faa
--- /dev/null
+++ b/.history/components/keyboardScene_20211013124917.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(0).translation
+ ?m.video.trickPlayBar.getChild(1).translation
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013125042.brs b/.history/components/keyboardScene_20211013125042.brs
new file mode 100644
index 0000000..95dfe87
--- /dev/null
+++ b/.history/components/keyboardScene_20211013125042.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 16]
+ ?m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 16]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013125125.brs b/.history/components/keyboardScene_20211013125125.brs
new file mode 100644
index 0000000..fd8d6c2
--- /dev/null
+++ b/.history/components/keyboardScene_20211013125125.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 16]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 16]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013125245.brs b/.history/components/keyboardScene_20211013125245.brs
new file mode 100644
index 0000000..9f59935
--- /dev/null
+++ b/.history/components/keyboardScene_20211013125245.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013125422.brs b/.history/components/keyboardScene_20211013125422.brs
new file mode 100644
index 0000000..48bf2e1
--- /dev/null
+++ b/.history/components/keyboardScene_20211013125422.brs
@@ -0,0 +1,123 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(0)
+ ?m.video.trickPlayBar.getChild(1)
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013125550.brs b/.history/components/keyboardScene_20211013125550.brs
new file mode 100644
index 0000000..b985ba6
--- /dev/null
+++ b/.history/components/keyboardScene_20211013125550.brs
@@ -0,0 +1,123 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(0).getParent()
+ ?m.video.trickPlayBar.getChild(1).getParent()
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013125740.brs b/.history/components/keyboardScene_20211013125740.brs
new file mode 100644
index 0000000..d6e7bc4
--- /dev/null
+++ b/.history/components/keyboardScene_20211013125740.brs
@@ -0,0 +1,123 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(0).getParent()
+ ?m.video.trickPlayBar.getChild(1).getParent()
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013125813.brs b/.history/components/keyboardScene_20211013125813.brs
new file mode 100644
index 0000000..126c08a
--- /dev/null
+++ b/.history/components/keyboardScene_20211013125813.brs
@@ -0,0 +1,123 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(0).getParent().translation
+ ?m.video.trickPlayBar.getChild(1).getParent()
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130232.brs b/.history/components/keyboardScene_20211013130232.brs
new file mode 100644
index 0000000..d6e7bc4
--- /dev/null
+++ b/.history/components/keyboardScene_20211013130232.brs
@@ -0,0 +1,123 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(0).getParent()
+ ?m.video.trickPlayBar.getChild(1).getParent()
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130255.brs b/.history/components/keyboardScene_20211013130255.brs
new file mode 100644
index 0000000..e012856
--- /dev/null
+++ b/.history/components/keyboardScene_20211013130255.brs
@@ -0,0 +1,123 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(0).getParent().hashMarkPositions
+ ?m.video.trickPlayBar.getChild(1).getParent()
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130450.brs b/.history/components/keyboardScene_20211013130450.brs
new file mode 100644
index 0000000..92611e3
--- /dev/null
+++ b/.history/components/keyboardScene_20211013130450.brs
@@ -0,0 +1,123 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(0).getParent()
+ ?m.video.trickPlayBar.getChild(1).getParent()
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130504.brs b/.history/components/keyboardScene_20211013130504.brs
new file mode 100644
index 0000000..4c10ca0
--- /dev/null
+++ b/.history/components/keyboardScene_20211013130504.brs
@@ -0,0 +1,123 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(0).getParent().getChildCount()
+ ?m.video.trickPlayBar.getChild(1).getParent()
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130610.brs b/.history/components/keyboardScene_20211013130610.brs
new file mode 100644
index 0000000..4c10ca0
--- /dev/null
+++ b/.history/components/keyboardScene_20211013130610.brs
@@ -0,0 +1,123 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(0).getParent().getChildCount()
+ ?m.video.trickPlayBar.getChild(1).getParent()
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130615.brs b/.history/components/keyboardScene_20211013130615.brs
new file mode 100644
index 0000000..a1af799
--- /dev/null
+++ b/.history/components/keyboardScene_20211013130615.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(1).getParent()
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130800.brs b/.history/components/keyboardScene_20211013130800.brs
new file mode 100644
index 0000000..6255784
--- /dev/null
+++ b/.history/components/keyboardScene_20211013130800.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(1).getParent().getParent()
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130841.brs b/.history/components/keyboardScene_20211013130841.brs
new file mode 100644
index 0000000..a1af799
--- /dev/null
+++ b/.history/components/keyboardScene_20211013130841.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(1).getParent()
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130923.brs b/.history/components/keyboardScene_20211013130923.brs
new file mode 100644
index 0000000..47a8d8c
--- /dev/null
+++ b/.history/components/keyboardScene_20211013130923.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131007.brs b/.history/components/keyboardScene_20211013131007.brs
new file mode 100644
index 0000000..85a3d10
--- /dev/null
+++ b/.history/components/keyboardScene_20211013131007.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild()
+ ?m.video.trickPlayBar.getChild()
+ ?m.video.trickPlayBar.getChild()
+ ?m.video.trickPlayBar.getChild()
+ ?m.video.trickPlayBar.getChild()
+ ?m.video.trickPlayBar.getChild()
+ ?m.video.trickPlayBar.getChild()
+ ?m.video.trickPlayBar.getChild()
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131022.brs b/.history/components/keyboardScene_20211013131022.brs
new file mode 100644
index 0000000..361c9a4
--- /dev/null
+++ b/.history/components/keyboardScene_20211013131022.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(2)
+ ?m.video.trickPlayBar.getChild(3)
+ ?m.video.trickPlayBar.getChild(4)
+ ?m.video.trickPlayBar.getChild(5)
+ ?m.video.trickPlayBar.getChild(6)
+ ?m.video.trickPlayBar.getChild(7)
+ ?m.video.trickPlayBar.getChild(8)
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131110.brs b/.history/components/keyboardScene_20211013131110.brs
new file mode 100644
index 0000000..5b3a78b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013131110.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(2).opacity = 0
+ ?m.video.trickPlayBar.getChild(3).opacity = 0
+ ?m.video.trickPlayBar.getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).opacity = 0
+ ?m.video.trickPlayBar.getChild(7).opacity = 0
+ ?m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131111.brs b/.history/components/keyboardScene_20211013131111.brs
new file mode 100644
index 0000000..5b3a78b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013131111.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(2).opacity = 0
+ ?m.video.trickPlayBar.getChild(3).opacity = 0
+ ?m.video.trickPlayBar.getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).opacity = 0
+ ?m.video.trickPlayBar.getChild(7).opacity = 0
+ ?m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131430.brs b/.history/components/keyboardScene_20211013131430.brs
new file mode 100644
index 0000000..5b3a78b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013131430.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(2).opacity = 0
+ ?m.video.trickPlayBar.getChild(3).opacity = 0
+ ?m.video.trickPlayBar.getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).opacity = 0
+ ?m.video.trickPlayBar.getChild(7).opacity = 0
+ ?m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131507.brs b/.history/components/keyboardScene_20211013131507.brs
new file mode 100644
index 0000000..3975321
--- /dev/null
+++ b/.history/components/keyboardScene_20211013131507.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).items
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(2).opacity = 0
+ ?m.video.trickPlayBar.getChild(3).opacity = 0
+ ?m.video.trickPlayBar.getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).opacity = 0
+ ?m.video.trickPlayBar.getChild(7).opacity = 0
+ ?m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131514.brs b/.history/components/keyboardScene_20211013131514.brs
new file mode 100644
index 0000000..eb3b9b9
--- /dev/null
+++ b/.history/components/keyboardScene_20211013131514.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(2).opacity = 0
+ ?m.video.trickPlayBar.getChild(3).opacity = 0
+ ?m.video.trickPlayBar.getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).opacity = 0
+ ?m.video.trickPlayBar.getChild(7).opacity = 0
+ ?m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131516.brs b/.history/components/keyboardScene_20211013131516.brs
new file mode 100644
index 0000000..14e2524
--- /dev/null
+++ b/.history/components/keyboardScene_20211013131516.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body)
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(2).opacity = 0
+ ?m.video.trickPlayBar.getChild(3).opacity = 0
+ ?m.video.trickPlayBar.getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).opacity = 0
+ ?m.video.trickPlayBar.getChild(7).opacity = 0
+ ?m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131537.brs b/.history/components/keyboardScene_20211013131537.brs
new file mode 100644
index 0000000..8d9d900
--- /dev/null
+++ b/.history/components/keyboardScene_20211013131537.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(2).opacity = 0
+ ?m.video.trickPlayBar.getChild(3).opacity = 0
+ ?m.video.trickPlayBar.getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).opacity = 0
+ ?m.video.trickPlayBar.getChild(7).opacity = 0
+ ?m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131756.brs b/.history/components/keyboardScene_20211013131756.brs
new file mode 100644
index 0000000..2c3b110
--- /dev/null
+++ b/.history/components/keyboardScene_20211013131756.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(2).opacity = 0
+ ?m.video.trickPlayBar.getChild(3).opacity = 0
+ ?m.video.trickPlayBar.getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).opacity = 0
+ ?m.video.trickPlayBar.getChild(7).opacity = 0
+ ?m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131908.brs b/.history/components/keyboardScene_20211013131908.brs
new file mode 100644
index 0000000..f2565ce
--- /dev/null
+++ b/.history/components/keyboardScene_20211013131908.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ handleVideoPlaybackResponse
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(2).opacity = 0
+ ?m.video.trickPlayBar.getChild(3).opacity = 0
+ ?m.video.trickPlayBar.getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).opacity = 0
+ ?m.video.trickPlayBar.getChild(7).opacity = 0
+ ?m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131909.brs b/.history/components/keyboardScene_20211013131909.brs
new file mode 100644
index 0000000..e779399
--- /dev/null
+++ b/.history/components/keyboardScene_20211013131909.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ handleVideoPlaybackResponse()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(2).opacity = 0
+ ?m.video.trickPlayBar.getChild(3).opacity = 0
+ ?m.video.trickPlayBar.getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).opacity = 0
+ ?m.video.trickPlayBar.getChild(7).opacity = 0
+ ?m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131944.brs b/.history/components/keyboardScene_20211013131944.brs
new file mode 100644
index 0000000..66195f1
--- /dev/null
+++ b/.history/components/keyboardScene_20211013131944.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ handleVideoPlaybackResponse()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(2).opacity = 0
+ ?m.video.trickPlayBar.getChild(3).opacity = 0
+ ?m.video.trickPlayBar.getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).opacity = 0
+ ?m.video.trickPlayBar.getChild(7).opacity = 0
+ ?m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132015.brs b/.history/components/keyboardScene_20211013132015.brs
new file mode 100644
index 0000000..969b420
--- /dev/null
+++ b/.history/components/keyboardScene_20211013132015.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+' sub handleSubmit()
+' m.http.request = { payload: {
+' userId: 1,
+' title: "WOW, IT WORKED ^_^",
+' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ handleVideoPlaybackResponse()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(2).opacity = 0
+ ?m.video.trickPlayBar.getChild(3).opacity = 0
+ ?m.video.trickPlayBar.getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).opacity = 0
+ ?m.video.trickPlayBar.getChild(7).opacity = 0
+ ?m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132042.brs b/.history/components/keyboardScene_20211013132042.brs
new file mode 100644
index 0000000..cb0563a
--- /dev/null
+++ b/.history/components/keyboardScene_20211013132042.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ ?m.video.trickPlayBar.getChild(2).opacity = 0
+ ?m.video.trickPlayBar.getChild(3).opacity = 0
+ ?m.video.trickPlayBar.getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).opacity = 0
+ ?m.video.trickPlayBar.getChild(7).opacity = 0
+ ?m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132113.brs b/.history/components/keyboardScene_20211013132113.brs
new file mode 100644
index 0000000..886de9e
--- /dev/null
+++ b/.history/components/keyboardScene_20211013132113.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.trickPlayBar.getChild(6).opacity = 0
+ m.video.trickPlayBar.getChild(7).opacity = 0
+ m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132154.brs b/.history/components/keyboardScene_20211013132154.brs
new file mode 100644
index 0000000..60791e2
--- /dev/null
+++ b/.history/components/keyboardScene_20211013132154.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).visible = 0
+ m.video.trickPlayBar.getChild(3).visible = 0
+ m.video.trickPlayBar.getChild(4).visible = 0
+ m.video.trickPlayBar.getChild(5).visible = 0
+ m.video.trickPlayBar.getChild(6).visible = 0
+ m.video.trickPlayBar.getChild(7).visible = 0
+ m.video.trickPlayBar.getChild(8).visible = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132231.brs b/.history/components/keyboardScene_20211013132231.brs
new file mode 100644
index 0000000..1859858
--- /dev/null
+++ b/.history/components/keyboardScene_20211013132231.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132325.brs b/.history/components/keyboardScene_20211013132325.brs
new file mode 100644
index 0000000..90a9224
--- /dev/null
+++ b/.history/components/keyboardScene_20211013132325.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getChild(6).visible = false
+ m.video.trickPlayBar.getChild(7).visible = false
+ m.video.trickPlayBar.getChild(8).visible = false
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132328.brs b/.history/components/keyboardScene_20211013132328.brs
new file mode 100644
index 0000000..f3bc007
--- /dev/null
+++ b/.history/components/keyboardScene_20211013132328.brs
@@ -0,0 +1,132 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ m.video.trickPlayBar.getChild(6).visible = false
+ m.video.trickPlayBar.getChild(7).visible = false
+ m.video.trickPlayBar.getChild(8).visible = false
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ ' m.video.trickPlayBar.getChild(2).visible = false
+ ' m.video.trickPlayBar.getChild(3).visible = false
+ ' m.video.trickPlayBar.getChild(4).visible = false
+ ' m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132822.brs b/.history/components/keyboardScene_20211013132822.brs
new file mode 100644
index 0000000..1859858
--- /dev/null
+++ b/.history/components/keyboardScene_20211013132822.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132836.brs b/.history/components/keyboardScene_20211013132836.brs
new file mode 100644
index 0000000..e0946b4
--- /dev/null
+++ b/.history/components/keyboardScene_20211013132836.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132919.brs b/.history/components/keyboardScene_20211013132919.brs
new file mode 100644
index 0000000..e0946b4
--- /dev/null
+++ b/.history/components/keyboardScene_20211013132919.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132923.brs b/.history/components/keyboardScene_20211013132923.brs
new file mode 100644
index 0000000..1859858
--- /dev/null
+++ b/.history/components/keyboardScene_20211013132923.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ ?parseJson(m.http.response.body).error
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' API Quota limit exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x33333300"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
+ ' Hides the black background in the scrubber and the white dots in the scrubber
+ m.video.trickPlayBar.getChild(2).visible = false
+ m.video.trickPlayBar.getChild(3).visible = false
+ m.video.trickPlayBar.getChild(4).visible = false
+ m.video.trickPlayBar.getChild(5).visible = false
+ ' m.video.trickPlayBar.getParent().getChild(9).height = 8
+ ' Update percentage on loading bar
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+ m.video.bufferingBar.height = 8.0
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133140.brs b/.history/components/keyboardScene_20211013133140.brs
new file mode 100644
index 0000000..d12173b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013133140.brs
@@ -0,0 +1,115 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ m.videoPlaybackTask.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ m.videoPlaybackTask.control = "RUN"
+ m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133235.brs b/.history/components/keyboardScene_20211013133235.brs
new file mode 100644
index 0000000..1ec03f6
--- /dev/null
+++ b/.history/components/keyboardScene_20211013133235.brs
@@ -0,0 +1,116 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133307.brs b/.history/components/keyboardScene_20211013133307.brs
new file mode 100644
index 0000000..bd2c6c7
--- /dev/null
+++ b/.history/components/keyboardScene_20211013133307.brs
@@ -0,0 +1,118 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ m.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133351.brs b/.history/components/keyboardScene_20211013133351.brs
new file mode 100644
index 0000000..c2387cc
--- /dev/null
+++ b/.history/components/keyboardScene_20211013133351.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133354.brs b/.history/components/keyboardScene_20211013133354.brs
new file mode 100644
index 0000000..61298b3
--- /dev/null
+++ b/.history/components/keyboardScene_20211013133354.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133416.brs b/.history/components/keyboardScene_20211013133416.brs
new file mode 100644
index 0000000..eb98474
--- /dev/null
+++ b/.history/components/keyboardScene_20211013133416.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133531.brs b/.history/components/keyboardScene_20211013133531.brs
new file mode 100644
index 0000000..e009983
--- /dev/null
+++ b/.history/components/keyboardScene_20211013133531.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.height = 20
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133535.brs b/.history/components/keyboardScene_20211013133535.brs
new file mode 100644
index 0000000..8f8c296
--- /dev/null
+++ b/.history/components/keyboardScene_20211013133535.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133645.brs b/.history/components/keyboardScene_20211013133645.brs
new file mode 100644
index 0000000..8f8c296
--- /dev/null
+++ b/.history/components/keyboardScene_20211013133645.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133851.brs b/.history/components/keyboardScene_20211013133851.brs
new file mode 100644
index 0000000..10c493e
--- /dev/null
+++ b/.history/components/keyboardScene_20211013133851.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.translation
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133853.brs b/.history/components/keyboardScene_20211013133853.brs
new file mode 100644
index 0000000..6b1e270
--- /dev/null
+++ b/.history/components/keyboardScene_20211013133853.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ ?m.video.bufferingBar.translation
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133936.brs b/.history/components/keyboardScene_20211013133936.brs
new file mode 100644
index 0000000..7e31a8b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013133936.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ ?m.video.bufferingBar.translation
+ ?m.video.bufferingBar.getChildrenCount()
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134505.brs b/.history/components/keyboardScene_20211013134505.brs
new file mode 100644
index 0000000..2cf611b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013134505.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ ?m.video.bufferingBar.translation
+ ?m.video.bufferingBar.getChildnCount()
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134544.brs b/.history/components/keyboardScene_20211013134544.brs
new file mode 100644
index 0000000..20ff1df
--- /dev/null
+++ b/.history/components/keyboardScene_20211013134544.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ ?m.video.bufferingBar.translation = [m.video.bufferingBar.translation[0] - 20, m.video.bufferingBar.translation[1]]
+ ?m.video.bufferingBar.getChildnCount()
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134546.brs b/.history/components/keyboardScene_20211013134546.brs
new file mode 100644
index 0000000..24c1094
--- /dev/null
+++ b/.history/components/keyboardScene_20211013134546.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ ?m.video.bufferingBar.translation = [m.video.bufferingBar.translation[0] - 30, m.video.bufferingBar.translation[1]]
+ ?m.video.bufferingBar.getChildnCount()
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134551.brs b/.history/components/keyboardScene_20211013134551.brs
new file mode 100644
index 0000000..bd92516
--- /dev/null
+++ b/.history/components/keyboardScene_20211013134551.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ ?m.video.bufferingBar.translation = [m.video.bufferingBar.translation[0] - 30, m.video.bufferingBar.translation[1]]
+ ?m.video.bufferingBar.getChildCount()
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134614.brs b/.history/components/keyboardScene_20211013134614.brs
new file mode 100644
index 0000000..2c23e65
--- /dev/null
+++ b/.history/components/keyboardScene_20211013134614.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.translation = [m.video.bufferingBar.translation[0] - 30, m.video.bufferingBar.translation[1]]
+ ?m.video.bufferingBar.getChildCount()
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134659.brs b/.history/components/keyboardScene_20211013134659.brs
new file mode 100644
index 0000000..01b2060
--- /dev/null
+++ b/.history/components/keyboardScene_20211013134659.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.translation = [m.video.bufferingBar.translation[0] - 3000, m.video.bufferingBar.translation[1]]
+ ?m.video.bufferingBar.getChildCount()
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134857.brs b/.history/components/keyboardScene_20211013134857.brs
new file mode 100644
index 0000000..3517230
--- /dev/null
+++ b/.history/components/keyboardScene_20211013134857.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134858.brs b/.history/components/keyboardScene_20211013134858.brs
new file mode 100644
index 0000000..8f8c296
--- /dev/null
+++ b/.history/components/keyboardScene_20211013134858.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134903.brs b/.history/components/keyboardScene_20211013134903.brs
new file mode 100644
index 0000000..8f8c296
--- /dev/null
+++ b/.history/components/keyboardScene_20211013134903.brs
@@ -0,0 +1,120 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134949.brs b/.history/components/keyboardScene_20211013134949.brs
new file mode 100644
index 0000000..40eff16
--- /dev/null
+++ b/.history/components/keyboardScene_20211013134949.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(5)
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135052.brs b/.history/components/keyboardScene_20211013135052.brs
new file mode 100644
index 0000000..39c78fa
--- /dev/null
+++ b/.history/components/keyboardScene_20211013135052.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135201.brs b/.history/components/keyboardScene_20211013135201.brs
new file mode 100644
index 0000000..4c4c4af
--- /dev/null
+++ b/.history/components/keyboardScene_20211013135201.brs
@@ -0,0 +1,121 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135245.brs b/.history/components/keyboardScene_20211013135245.brs
new file mode 100644
index 0000000..39c78fa
--- /dev/null
+++ b/.history/components/keyboardScene_20211013135245.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135311.brs b/.history/components/keyboardScene_20211013135311.brs
new file mode 100644
index 0000000..95a7bc0
--- /dev/null
+++ b/.history/components/keyboardScene_20211013135311.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(5).translation = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135323.brs b/.history/components/keyboardScene_20211013135323.brs
new file mode 100644
index 0000000..d7338ca
--- /dev/null
+++ b/.history/components/keyboardScene_20211013135323.brs
@@ -0,0 +1,122 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(5).translation
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135421.brs b/.history/components/keyboardScene_20211013135421.brs
new file mode 100644
index 0000000..f0a5e40
--- /dev/null
+++ b/.history/components/keyboardScene_20211013135421.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(0).opacity = 0
+ ?m.video.trickPlayBar.getChild(1).opacity = 0
+ ?m.video.trickPlayBar.getChild(2).opacity = 0
+ ?m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135423.brs b/.history/components/keyboardScene_20211013135423.brs
new file mode 100644
index 0000000..74d0633
--- /dev/null
+++ b/.history/components/keyboardScene_20211013135423.brs
@@ -0,0 +1,125 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ?m.video.trickPlayBar.getParent().getChildren(12, 0)
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).opacity = 0
+ m.video.trickPlayBar.getChild(1).opacity = 0
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135438.brs b/.history/components/keyboardScene_20211013135438.brs
new file mode 100644
index 0000000..c8c5bb7
--- /dev/null
+++ b/.history/components/keyboardScene_20211013135438.brs
@@ -0,0 +1,124 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).opacity = 0
+ m.video.trickPlayBar.getChild(1).opacity = 0
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135941.brs b/.history/components/keyboardScene_20211013135941.brs
new file mode 100644
index 0000000..13a3085
--- /dev/null
+++ b/.history/components/keyboardScene_20211013135941.brs
@@ -0,0 +1,124 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140045.brs b/.history/components/keyboardScene_20211013140045.brs
new file mode 100644
index 0000000..0c6196d
--- /dev/null
+++ b/.history/components/keyboardScene_20211013140045.brs
@@ -0,0 +1,126 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation
+ m.video.trickPlayBar.getChild(1).translation
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140050.brs b/.history/components/keyboardScene_20211013140050.brs
new file mode 100644
index 0000000..399947e
--- /dev/null
+++ b/.history/components/keyboardScene_20211013140050.brs
@@ -0,0 +1,126 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(0).translation
+ ?m.video.trickPlayBar.getChild(1).translation
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140143.brs b/.history/components/keyboardScene_20211013140143.brs
new file mode 100644
index 0000000..d4e21b3
--- /dev/null
+++ b/.history/components/keyboardScene_20211013140143.brs
@@ -0,0 +1,126 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ ?m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
+ ?m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140205.brs b/.history/components/keyboardScene_20211013140205.brs
new file mode 100644
index 0000000..150561b
--- /dev/null
+++ b/.history/components/keyboardScene_20211013140205.brs
@@ -0,0 +1,126 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
+ ?m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140225.brs b/.history/components/keyboardScene_20211013140225.brs
new file mode 100644
index 0000000..546256c
--- /dev/null
+++ b/.history/components/keyboardScene_20211013140225.brs
@@ -0,0 +1,126 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140252.brs b/.history/components/keyboardScene_20211013140252.brs
new file mode 100644
index 0000000..d29c2a2
--- /dev/null
+++ b/.history/components/keyboardScene_20211013140252.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140501.brs b/.history/components/keyboardScene_20211013140501.brs
new file mode 100644
index 0000000..a05693c
--- /dev/null
+++ b/.history/components/keyboardScene_20211013140501.brs
@@ -0,0 +1,127 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.vertAlign = "center"
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140635.brs b/.history/components/keyboardScene_20211013140635.brs
new file mode 100644
index 0000000..71624e5
--- /dev/null
+++ b/.history/components/keyboardScene_20211013140635.brs
@@ -0,0 +1,126 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.vertAlign = "center"
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140749.brs b/.history/components/keyboardScene_20211013140749.brs
new file mode 100644
index 0000000..a61cad6
--- /dev/null
+++ b/.history/components/keyboardScene_20211013140749.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], 200]
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(0).translation[0], 200]
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140847.brs b/.history/components/keyboardScene_20211013140847.brs
new file mode 100644
index 0000000..fbc17e8
--- /dev/null
+++ b/.history/components/keyboardScene_20211013140847.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], 200]
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], 200]
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013141218.brs b/.history/components/keyboardScene_20211013141218.brs
new file mode 100644
index 0000000..f974852
--- /dev/null
+++ b/.history/components/keyboardScene_20211013141218.brs
@@ -0,0 +1,126 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013142600.brs b/.history/components/keyboardScene_20211013142600.brs
new file mode 100644
index 0000000..ffcf908
--- /dev/null
+++ b/.history/components/keyboardScene_20211013142600.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ ØŸm.video.trickPlayBar.getChild(6)
+ ØŸm.video.trickPlayBar.getChild(7)
+ ØŸm.video.trickPlayBar.getChild(8)
+ ØŸm.video.trickPlayBar.getChild(9)
+ ØŸm.video.trickPlayBar.getChild(10)
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013142605.brs b/.history/components/keyboardScene_20211013142605.brs
new file mode 100644
index 0000000..85a73d8
--- /dev/null
+++ b/.history/components/keyboardScene_20211013142605.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6)
+ ?m.video.trickPlayBar.getChild(7)
+ ?m.video.trickPlayBar.getChild(8)
+ ?m.video.trickPlayBar.getChild(9)
+ ?m.video.trickPlayBar.getChild(10)
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013143004.brs b/.history/components/keyboardScene_20211013143004.brs
new file mode 100644
index 0000000..a414851
--- /dev/null
+++ b/.history/components/keyboardScene_20211013143004.brs
@@ -0,0 +1,131 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).translation
+ ?m.video.trickPlayBar.getChild(7).translation
+ ?m.video.trickPlayBar.getChild(8).translation
+ ?m.video.trickPlayBar.getChild(9).translation
+ ?m.video.trickPlayBar.getChild(10).translation
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013143124.brs b/.history/components/keyboardScene_20211013143124.brs
new file mode 100644
index 0000000..a3df994
--- /dev/null
+++ b/.history/components/keyboardScene_20211013143124.brs
@@ -0,0 +1,135 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(6).translation
+ ?m.video.trickPlayBar.getChild(7).translation
+ ?m.video.trickPlayBar.getChild(8).translation
+ ?m.video.trickPlayBar.getChild(9).translation
+ ?m.video.trickPlayBar.getChild(10).translation
+ ?m.video.trickPlayBar.getChild(11).translation
+ ?m.video.trickPlayBar.getChild(12).translation
+ ?m.video.trickPlayBar.getChild(13).translation
+ ?m.video.trickPlayBar.getChild(14).translation
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013143327.brs b/.history/components/keyboardScene_20211013143327.brs
new file mode 100644
index 0000000..cfb2576
--- /dev/null
+++ b/.history/components/keyboardScene_20211013143327.brs
@@ -0,0 +1,135 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(0).translation
+ ?m.video.trickPlayBar.getParent().getChild(1).translation
+ ?m.video.trickPlayBar.getParent().getChild(2).translation
+ ?m.video.trickPlayBar.getParent().getChild(3).translation
+ ?m.video.trickPlayBar.getParent().getChild(4).translation
+ ?m.video.trickPlayBar.getParent().getChild(5).translation
+ ?m.video.trickPlayBar.getParent().getChild(6).translation
+ ?m.video.trickPlayBar.getParent().getChild(7).translation
+ ?m.video.trickPlayBar.getParent().getChild(8).translation
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013143425.brs b/.history/components/keyboardScene_20211013143425.brs
new file mode 100644
index 0000000..9ead755
--- /dev/null
+++ b/.history/components/keyboardScene_20211013143425.brs
@@ -0,0 +1,138 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getParent().getChild(0).translation
+ ?m.video.trickPlayBar.getParent().getChild(1).translation
+ ?m.video.trickPlayBar.getParent().getChild(2).translation
+ ?m.video.trickPlayBar.getParent().getChild(3).translation
+ ?m.video.trickPlayBar.getParent().getChild(4).translation
+ ?m.video.trickPlayBar.getParent().getChild(5).translation
+ ?m.video.trickPlayBar.getParent().getChild(6).translation
+ ?m.video.trickPlayBar.getParent().getChild(7).translation
+ ?m.video.trickPlayBar.getParent().getChild(8).translation
+ ?m.video.trickPlayBar.getParent().getChild(9).translation
+ ?m.video.trickPlayBar.getParent().getChild(10).translation
+ ?m.video.trickPlayBar.getParent().getChild(11).translation
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013143546.brs b/.history/components/keyboardScene_20211013143546.brs
new file mode 100644
index 0000000..a1593f0
--- /dev/null
+++ b/.history/components/keyboardScene_20211013143546.brs
@@ -0,0 +1,145 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(0).translation
+ ?m.video.trickPlayBar.getChild(1).translation
+ ?m.video.trickPlayBar.getChild(2).translation
+ ?m.video.trickPlayBar.getChild(3).translation
+ ?m.video.trickPlayBar.getChild(4).translation
+ ?m.video.trickPlayBar.getChild(5).translation
+ ?m.video.trickPlayBar.getChild(6).translation
+ ?m.video.trickPlayBar.getChild(7).translation
+ ?m.video.trickPlayBar.getChild(8).translation
+ ?m.video.trickPlayBar.getChild(9).translation
+ ?m.video.trickPlayBar.getChild(10).translation
+ ?m.video.trickPlayBar.getChild(11).translation
+ ?m.video.trickPlayBar.getChild(12).translation
+ ?m.video.trickPlayBar.getChild(13).translation
+ ?m.video.trickPlayBar.getChild(14).translation
+ ?m.video.trickPlayBar.getChild(15).translation
+ ?m.video.trickPlayBar.getChild(16).translation
+ ?m.video.trickPlayBar.getChild(17).translation
+ ?m.video.trickPlayBar.getChild(18).translation
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144033.brs b/.history/components/keyboardScene_20211013144033.brs
new file mode 100644
index 0000000..d6ceb62
--- /dev/null
+++ b/.history/components/keyboardScene_20211013144033.brs
@@ -0,0 +1,145 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(0)
+ ?m.video.trickPlayBar.getChild(1)
+ ?m.video.trickPlayBar.getChild(2)
+ ?m.video.trickPlayBar.getChild(3)
+ ?m.video.trickPlayBar.getChild(4)
+ ?m.video.trickPlayBar.getChild(5)
+ ?m.video.trickPlayBar.getChild(6)
+ ?m.video.trickPlayBar.getChild(7)
+ ?m.video.trickPlayBar.getChild(8)
+ ?m.video.trickPlayBar.getChild(9)
+ ?m.video.trickPlayBar.getChild(10)
+ ?m.video.trickPlayBar.getChild(11)
+ ?m.video.trickPlayBar.getChild(12)
+ ?m.video.trickPlayBar.getChild(13)
+ ?m.video.trickPlayBar.getChild(14)
+ ?m.video.trickPlayBar.getChild(15)
+ ?m.video.trickPlayBar.getChild(16)
+ ?m.video.trickPlayBar.getChild(17)
+ ?m.video.trickPlayBar.getChild(18)
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144219.brs b/.history/components/keyboardScene_20211013144219.brs
new file mode 100644
index 0000000..608a082
--- /dev/null
+++ b/.history/components/keyboardScene_20211013144219.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(9).getChildCount()
+ ?m.video.trickPlayBar.getChild(10).getChildCount()
+ ?m.video.trickPlayBar.getChild(11).getChildCount()
+ ?m.video.trickPlayBar.getChild(12).getChildCount()
+ ?m.video.trickPlayBar.getChild(13).getChildCount()
+ ?m.video.trickPlayBar.getChild(14).getChildCount()
+ ?m.video.trickPlayBar.getChild(15).getChildCount()
+ ?m.video.trickPlayBar.getChild(16).getChildCount()
+ ?m.video.trickPlayBar.getChild(17).getChildCount()
+ ?m.video.trickPlayBar.getChild(18).getChildCount()
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144311.brs b/.history/components/keyboardScene_20211013144311.brs
new file mode 100644
index 0000000..5c6cd79
--- /dev/null
+++ b/.history/components/keyboardScene_20211013144311.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ ?m.video.trickPlayBar.getChild(9).text
+ ?m.video.trickPlayBar.getChild(10).text
+ ?m.video.trickPlayBar.getChild(11).text
+ ?m.video.trickPlayBar.getChild(12).text
+ ?m.video.trickPlayBar.getChild(13).text
+ ?m.video.trickPlayBar.getChild(14).text
+ ?m.video.trickPlayBar.getChild(15).text
+ ?m.video.trickPlayBar.getChild(16).text
+ ?m.video.trickPlayBar.getChild(17).text
+ ?m.video.trickPlayBar.getChild(18).text
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144317.brs b/.history/components/keyboardScene_20211013144317.brs
new file mode 100644
index 0000000..5e55c47
--- /dev/null
+++ b/.history/components/keyboardScene_20211013144317.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.trickPlayBar.getChild(9).text
+ ?m.video.trickPlayBar.getChild(10).text
+ ?m.video.trickPlayBar.getChild(11).text
+ ?m.video.trickPlayBar.getChild(12).text
+ ?m.video.trickPlayBar.getChild(13).text
+ ?m.video.trickPlayBar.getChild(14).text
+ ?m.video.trickPlayBar.getChild(15).text
+ ?m.video.trickPlayBar.getChild(16).text
+ ?m.video.trickPlayBar.getChild(17).text
+ ?m.video.trickPlayBar.getChild(18).text
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144410.brs b/.history/components/keyboardScene_20211013144410.brs
new file mode 100644
index 0000000..12bd303
--- /dev/null
+++ b/.history/components/keyboardScene_20211013144410.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.trickPlayBar.getChild(9)
+ ?m.video.trickPlayBar.getChild(10)
+ ?m.video.trickPlayBar.getChild(11)
+ ?m.video.trickPlayBar.getChild(12)
+ ?m.video.trickPlayBar.getChild(13)
+ ?m.video.trickPlayBar.getChild(14)
+ ?m.video.trickPlayBar.getChild(15)
+ ?m.video.trickPlayBar.getChild(16)
+ ?m.video.trickPlayBar.getChild(17)
+ ?m.video.trickPlayBar.getChild(18)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144558.brs b/.history/components/keyboardScene_20211013144558.brs
new file mode 100644
index 0000000..fe6b525
--- /dev/null
+++ b/.history/components/keyboardScene_20211013144558.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.trickPlayBar.getChild(9).opacity = 0
+ ?m.video.trickPlayBar.getChild(10).opacity = 0
+ ?m.video.trickPlayBar.getChild(11).opacity = 0
+ ?m.video.trickPlayBar.getChild(12).opacity = 0
+ ?m.video.trickPlayBar.getChild(13).opacity = 0
+ ?m.video.trickPlayBar.getChild(14).opacity = 0
+ ?m.video.trickPlayBar.getChild(15).opacity = 0
+ ?m.video.trickPlayBar.getChild(16).opacity = 0
+ ?m.video.trickPlayBar.getChild(17).opacity = 0
+ ?m.video.trickPlayBar.getChild(18).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144626.brs b/.history/components/keyboardScene_20211013144626.brs
new file mode 100644
index 0000000..89d45f9
--- /dev/null
+++ b/.history/components/keyboardScene_20211013144626.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getChild(9).opacity = 0
+ m.video.trickPlayBar.getChild(10).opacity = 0
+ m.video.trickPlayBar.getChild(11).opacity = 0
+ m.video.trickPlayBar.getChild(12).opacity = 0
+ m.video.trickPlayBar.getChild(13).opacity = 0
+ m.video.trickPlayBar.getChild(14).opacity = 0
+ m.video.trickPlayBar.getChild(15).opacity = 0
+ m.video.trickPlayBar.getChild(16).opacity = 0
+ m.video.trickPlayBar.getChild(17).opacity = 0
+ m.video.trickPlayBar.getChild(18).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144935.brs b/.history/components/keyboardScene_20211013144935.brs
new file mode 100644
index 0000000..1b19f06
--- /dev/null
+++ b/.history/components/keyboardScene_20211013144935.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getChild(0).opacity = 0
+ m.video.trickPlayBar.getChild(1).opacity = 0
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.trickPlayBar.getChild(6).opacity = 0
+ m.video.trickPlayBar.getChild(7).opacity = 0
+ m.video.trickPlayBar.getChild(8).opacity = 0
+ m.video.trickPlayBar.getChild(9).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144950.brs b/.history/components/keyboardScene_20211013144950.brs
new file mode 100644
index 0000000..0f94e0f
--- /dev/null
+++ b/.history/components/keyboardScene_20211013144950.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ m.video.trickPlayBar.getChild(0).getChildCount()
+ m.video.trickPlayBar.getChild(1).getChildCount()
+ m.video.trickPlayBar.getChild(2).getChildCount()
+ m.video.trickPlayBar.getChild(3).getChildCount()
+ m.video.trickPlayBar.getChild(4).getChildCount()
+ m.video.trickPlayBar.getChild(5).getChildCount()
+ m.video.trickPlayBar.getChild(6).getChildCount()
+ m.video.trickPlayBar.getChild(7).getChildCount()
+ m.video.trickPlayBar.getChild(8).getChildCount()
+ m.video.trickPlayBar.getChild(9).getChildCount()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145019.brs b/.history/components/keyboardScene_20211013145019.brs
new file mode 100644
index 0000000..1ee4558
--- /dev/null
+++ b/.history/components/keyboardScene_20211013145019.brs
@@ -0,0 +1,136 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.trickPlayBar.getChild(0).getChildCount()
+ ?m.video.trickPlayBar.getChild(1).getChildCount()
+ ?m.video.trickPlayBar.getChild(2).getChildCount()
+ ?m.video.trickPlayBar.getChild(3).getChildCount()
+ ?m.video.trickPlayBar.getChild(4).getChildCount()
+ ?m.video.trickPlayBar.getChild(5).getChildCount()
+ ?m.video.trickPlayBar.getChild(6).getChildCount()
+ ?m.video.trickPlayBar.getChild(7).getChildCount()
+ ?m.video.trickPlayBar.getChild(8).getChildCount()
+ ?m.video.trickPlayBar.getChild(9).getChildCount()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145139.brs b/.history/components/keyboardScene_20211013145139.brs
new file mode 100644
index 0000000..df92ed9
--- /dev/null
+++ b/.history/components/keyboardScene_20211013145139.brs
@@ -0,0 +1,127 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.trickPlayBar
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145506.brs b/.history/components/keyboardScene_20211013145506.brs
new file mode 100644
index 0000000..e36a68d
--- /dev/null
+++ b/.history/components/keyboardScene_20211013145506.brs
@@ -0,0 +1,127 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145513.brs b/.history/components/keyboardScene_20211013145513.brs
new file mode 100644
index 0000000..3484b21
--- /dev/null
+++ b/.history/components/keyboardScene_20211013145513.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.getChild(0)
+ ?m.video.getChild(1)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145610.brs b/.history/components/keyboardScene_20211013145610.brs
new file mode 100644
index 0000000..593771c
--- /dev/null
+++ b/.history/components/keyboardScene_20211013145610.brs
@@ -0,0 +1,127 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.getChild(1)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145626.brs b/.history/components/keyboardScene_20211013145626.brs
new file mode 100644
index 0000000..ebfb8c5
--- /dev/null
+++ b/.history/components/keyboardScene_20211013145626.brs
@@ -0,0 +1,129 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.getChild(1).getChild(0)
+ ?m.video.getChild(1).getChild(1)
+ ?m.video.getChild(1).getChild(2)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145743.brs b/.history/components/keyboardScene_20211013145743.brs
new file mode 100644
index 0000000..f48d5d9
--- /dev/null
+++ b/.history/components/keyboardScene_20211013145743.brs
@@ -0,0 +1,130 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.getChild(1).getChild(0)
+ m.video.getChild(1).getChild(1).height = 300
+ ?m.video.getChild(1).getChild(1).translation
+ ?m.video.getChild(1).getChild(2)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145848.brs b/.history/components/keyboardScene_20211013145848.brs
new file mode 100644
index 0000000..48596e5
--- /dev/null
+++ b/.history/components/keyboardScene_20211013145848.brs
@@ -0,0 +1,128 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+
+ ?m.video.getChild(1).getChildCount()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145849.brs b/.history/components/keyboardScene_20211013145849.brs
new file mode 100644
index 0000000..64096a1
--- /dev/null
+++ b/.history/components/keyboardScene_20211013145849.brs
@@ -0,0 +1,127 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.getChild(1).getChildCount()
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145926.brs b/.history/components/keyboardScene_20211013145926.brs
new file mode 100644
index 0000000..c9c11d4
--- /dev/null
+++ b/.history/components/keyboardScene_20211013145926.brs
@@ -0,0 +1,127 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.getChild(1).getChildren(12, 0)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013150159.brs b/.history/components/keyboardScene_20211013150159.brs
new file mode 100644
index 0000000..4b110de
--- /dev/null
+++ b/.history/components/keyboardScene_20211013150159.brs
@@ -0,0 +1,138 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.getChild(1).getChildren(12, 0).getChild(0)
+ ?m.video.getChild(1).getChildren(12, 0).getChild(1)
+ ?m.video.getChild(1).getChildren(12, 0).getChild(2)
+ ?m.video.getChild(1).getChildren(12, 0).getChild(3)
+ ?m.video.getChild(1).getChildren(12, 0).getChild(4)
+ ?m.video.getChild(1).getChildren(12, 0).getChild(5)
+ ?m.video.getChild(1).getChildren(12, 0).getChild(6)
+ ?m.video.getChild(1).getChildren(12, 0).getChild(7)
+ ?m.video.getChild(1).getChildren(12, 0).getChild(8)
+ ?m.video.getChild(1).getChildren(12, 0).getChild(9)
+ ?m.video.getChild(1).getChildren(12, 0).getChild(10)
+ ?m.video.getChild(1).getChildren(12, 0).getChild(11)
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013150327.brs b/.history/components/keyboardScene_20211013150327.brs
new file mode 100644
index 0000000..0394d20
--- /dev/null
+++ b/.history/components/keyboardScene_20211013150327.brs
@@ -0,0 +1,138 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.getChild(1).getChildren(12, 0)[0]
+ ?m.video.getChild(1).getChildren(12, 0)[1]
+ ?m.video.getChild(1).getChildren(12, 0)[2]
+ ?m.video.getChild(1).getChildren(12, 0)[3]
+ ?m.video.getChild(1).getChildren(12, 0)[4]
+ ?m.video.getChild(1).getChildren(12, 0)[5]
+ ?m.video.getChild(1).getChildren(12, 0)[6]
+ ?m.video.getChild(1).getChildren(12, 0)[7]
+ ?m.video.getChild(1).getChildren(12, 0)[8]
+ ?m.video.getChild(1).getChildren(12, 0)[9]
+ ?m.video.getChild(1).getChildren(12, 0)[10]
+ ?m.video.getChild(1).getChildren(12, 0)[11]
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013150822.brs b/.history/components/keyboardScene_20211013150822.brs
new file mode 100644
index 0000000..33dbe3e
--- /dev/null
+++ b/.history/components/keyboardScene_20211013150822.brs
@@ -0,0 +1,127 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.position
+ m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013151157.brs b/.history/components/keyboardScene_20211013151157.brs
new file mode 100644
index 0000000..4e3a8bc
--- /dev/null
+++ b/.history/components/keyboardScene_20211013151157.brs
@@ -0,0 +1,127 @@
+sub init()
+ m.keyboard = m.top.findNode("myKeyboard")
+ m.itemsList = m.top.findNode("searchList")
+ m.video = m.top.findNode("video")
+ m.itemsList.observeField("itemSelected", "handleItemSelected")
+ m.heading = m.top.findNode("heading")
+ m.keyboard.setFocus(true)
+ m.keyboard.observeField("text", "handleText")
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.observeFieldScoped("response", "useResponse")
+ m.keyboard.textBox.observeField("text", "handleText")
+ m.keyboard.observeField("submit", "handleSubmit")
+end sub
+
+sub handleText()
+ m.text = m.keyboard.textBox.text
+end sub
+
+sub handleSubmit()
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
+end sub
+
+sub useResponse()
+ m.itemsThatContainString = createObject("roSGNode", "ContentNode")
+ items = []
+ m.itemsList.numColumns = 3
+ for each item in parseJson(m.http.response.body).items
+ Content = m.itemsThatContainString.createChild("ContentNode")
+ Content.HDPosterUrl = item.snippet.thumbnails.medium.url
+ Content.id = item.id.videoId
+ items.push(item)
+ end for
+ if items.count() = 2
+ m.itemsList.numColumns = 2
+ else if items.count() = 1
+ m.itemsList.numColumns = 1
+ end if
+ ' handle empty text box
+ if m.keyboard.textBox.text = ""
+ m.itemsList.content = invalid
+ m.heading.visible = false
+ else
+ m.heading.visible = true
+ m.itemsList.content = m.itemsThatContainString
+ handleHeading()
+ end if
+end sub
+
+sub handleHeading()
+ m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
+end sub
+
+sub handleItemSelected()
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "right" and not m.itemsList.hasFocus()
+ m.itemsList.setFocus(true)
+ return true
+ else if key = "left" and not m.keyboard.hasFocus()
+ m.keyboard.setFocus(true)
+ end if
+ end if
+ return false
+end function
+
+sub playVideo(id as String)
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+end sub
+
+sub handleVideoPlaybackResponse()
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ videoContent = createObject("RoSGNode", "ContentNode")
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
+ videoContent.streamformat = "mp4"
+ m.video.content = videoContent
+ m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
+ m.video.control = "play"
+end sub
+
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.position
+ m.video.trickPlayBar.getParent().getChild(8).text = m.video.bufferingBar.percentage.toStr() + "%"
+end sub
\ No newline at end of file
diff --git a/.history/components/play_20211012131733.xml b/.history/components/play_20211012131733.xml
new file mode 100644
index 0000000..e56ae3b
--- /dev/null
+++ b/.history/components/play_20211012131733.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/play_20211012131742.xml b/.history/components/play_20211012131742.xml
new file mode 100644
index 0000000..8150ea1
--- /dev/null
+++ b/.history/components/play_20211012131742.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListContent_20211008145905.brs b/.history/components/rowListContent_20211008145905.brs
new file mode 100644
index 0000000..a37fbf2
--- /dev/null
+++ b/.history/components/rowListContent_20211008145905.brs
@@ -0,0 +1,11 @@
+sub init()
+ m.global.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://jsonplaceholder.typicode.com/albums", requestType: "GET"}
+ m.global.http.observeFieldScoped("response", "useResponse")
+end sub
+
+sub useResponse()
+ ?m.global.http.response
+end sub
diff --git a/.history/components/rowListContent_20211010122436.xml b/.history/components/rowListContent_20211010122436.xml
new file mode 100644
index 0000000..28e7d8e
--- /dev/null
+++ b/.history/components/rowListContent_20211010122436.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListContent_20211010122446.brs b/.history/components/rowListContent_20211010122446.brs
new file mode 100644
index 0000000..24c6956
--- /dev/null
+++ b/.history/components/rowListContent_20211010122446.brs
@@ -0,0 +1,11 @@
+sub init()
+ m.global.http.request = { payload: {
+ userId: 1,
+ title: "WOW, IT WORKED ^_^",
+ }, url: "https://jsonplaceholder.typicode.com/albums", requestType: "GET" }
+ m.global.http.observeFieldScoped("response", "useResponse")
+end sub
+
+sub useResponse()
+ ?m.global.http.response
+end sub
diff --git a/.history/components/rowListContent_20211010122452.xml b/.history/components/rowListContent_20211010122452.xml
new file mode 100644
index 0000000..f70ce16
--- /dev/null
+++ b/.history/components/rowListContent_20211010122452.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListContent_20211011134627.xml b/.history/components/rowListContent_20211011134627.xml
new file mode 100644
index 0000000..f70ce16
--- /dev/null
+++ b/.history/components/rowListContent_20211011134627.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListContent_20211012145223.xml b/.history/components/rowListContent_20211012145223.xml
new file mode 100644
index 0000000..f70ce16
--- /dev/null
+++ b/.history/components/rowListContent_20211012145223.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListItem_20211010122403.xml b/.history/components/rowListItem_20211010122403.xml
new file mode 100644
index 0000000..65e51b9
--- /dev/null
+++ b/.history/components/rowListItem_20211010122403.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListItem_20211010122413.xml b/.history/components/rowListItem_20211010122413.xml
new file mode 100644
index 0000000..65e51b9
--- /dev/null
+++ b/.history/components/rowListItem_20211010122413.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListItem_20211010122425.xml b/.history/components/rowListItem_20211010122425.xml
new file mode 100644
index 0000000..897af09
--- /dev/null
+++ b/.history/components/rowListItem_20211010122425.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListItem_20211011134635.xml b/.history/components/rowListItem_20211011134635.xml
new file mode 100644
index 0000000..897af09
--- /dev/null
+++ b/.history/components/rowListItem_20211011134635.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListItem_20211012145217.xml b/.history/components/rowListItem_20211012145217.xml
new file mode 100644
index 0000000..897af09
--- /dev/null
+++ b/.history/components/rowListItem_20211012145217.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008145905.brs b/.history/components/rowListScene_20211008145905.brs
new file mode 100644
index 0000000..22d7821
--- /dev/null
+++ b/.history/components/rowListScene_20211008145905.brs
@@ -0,0 +1,23 @@
+sub init()
+ m.global.addField("http", "node", FALSE)
+ m.global.addField("ratio", "float", FALSE)
+ m.global.http = createObject("roSGNode", "httpTask")
+ m.global.http.control = "RUN"
+ m.global.ratio = 1
+ m.rowList = m.top.findNode("mainRowList")
+ m.rowList.content = createObject("roSGNode", "RowListContent")
+ m.rowList.setFocus(true)
+ videoMode = createObject("roDeviceInfo")
+ if videoMode.GetVideoMode() = "720p"
+ m.global.ratio = 0.66
+ end if
+ if m.global.ratio = 0.66
+ m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
+ m.rowList.rowItemSpacing = [[5, 0]]
+ m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
+ m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
+ m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
+ m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
+ m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
+ end if
+end sub
diff --git a/.history/components/rowListScene_20211008145905.xml b/.history/components/rowListScene_20211008145905.xml
new file mode 100644
index 0000000..bc7e6b9
--- /dev/null
+++ b/.history/components/rowListScene_20211008145905.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008145927.xml b/.history/components/rowListScene_20211008145927.xml
new file mode 100644
index 0000000..92ca1be
--- /dev/null
+++ b/.history/components/rowListScene_20211008145927.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008150133.xml b/.history/components/rowListScene_20211008150133.xml
new file mode 100644
index 0000000..5587e5a
--- /dev/null
+++ b/.history/components/rowListScene_20211008150133.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ >
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008150134.xml b/.history/components/rowListScene_20211008150134.xml
new file mode 100644
index 0000000..5587e5a
--- /dev/null
+++ b/.history/components/rowListScene_20211008150134.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ >
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008150139.xml b/.history/components/rowListScene_20211008150139.xml
new file mode 100644
index 0000000..f7e0f6e
--- /dev/null
+++ b/.history/components/rowListScene_20211008150139.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008150146.xml b/.history/components/rowListScene_20211008150146.xml
new file mode 100644
index 0000000..b6c1d0d
--- /dev/null
+++ b/.history/components/rowListScene_20211008150146.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008150412.brs b/.history/components/rowListScene_20211008150412.brs
new file mode 100644
index 0000000..58ffd93
--- /dev/null
+++ b/.history/components/rowListScene_20211008150412.brs
@@ -0,0 +1,3 @@
+sub init()
+
+end sub
diff --git a/.history/components/rowListScene_20211008150439.brs b/.history/components/rowListScene_20211008150439.brs
new file mode 100644
index 0000000..3ce3870
--- /dev/null
+++ b/.history/components/rowListScene_20211008150439.brs
@@ -0,0 +1,7 @@
+sub init()
+ initGetNodes()
+end sub
+
+sub initGetNodes()
+
+end sub
diff --git a/.history/components/rowListScene_20211008150452.brs b/.history/components/rowListScene_20211008150452.brs
new file mode 100644
index 0000000..2175447
--- /dev/null
+++ b/.history/components/rowListScene_20211008150452.brs
@@ -0,0 +1,7 @@
+sub init()
+ initGetNodes()
+end sub
+
+sub initGetNodes()
+ m.start = m.top.findNode("start")
+end sub
diff --git a/.history/components/rowListScene_20211008150508.brs b/.history/components/rowListScene_20211008150508.brs
new file mode 100644
index 0000000..316d951
--- /dev/null
+++ b/.history/components/rowListScene_20211008150508.brs
@@ -0,0 +1,9 @@
+sub init()
+ initGetNodes()
+end sub
+
+sub initGetNodes()
+ m.start = m.top.findNode("start")
+ m.start = m.top.findNode("stop")
+ m.start = m.top.findNode("reset")
+end sub
diff --git a/.history/components/rowListScene_20211008150514.brs b/.history/components/rowListScene_20211008150514.brs
new file mode 100644
index 0000000..6b5aa6a
--- /dev/null
+++ b/.history/components/rowListScene_20211008150514.brs
@@ -0,0 +1,9 @@
+sub init()
+ initGetNodes()
+end sub
+
+sub initGetNodes()
+ m.start = m.top.findNode("start")
+ m.stop = m.top.findNode("stop")
+ m.reset = m.top.findNode("reset")
+end sub
diff --git a/.history/components/rowListScene_20211008150559.brs b/.history/components/rowListScene_20211008150559.brs
new file mode 100644
index 0000000..f043f51
--- /dev/null
+++ b/.history/components/rowListScene_20211008150559.brs
@@ -0,0 +1,11 @@
+sub init()
+ initGetNodes()
+ m.
+end sub
+
+sub initGetNodes()
+ m.start = m.top.findNode("start")
+ m.stop = m.top.findNode("stop")
+ m.reset = m.top.findNode("reset")
+ m.btnGroup = m.top.findNode("btnGroup")
+end sub
diff --git a/.history/components/rowListScene_20211008150612.brs b/.history/components/rowListScene_20211008150612.brs
new file mode 100644
index 0000000..22440c7
--- /dev/null
+++ b/.history/components/rowListScene_20211008150612.brs
@@ -0,0 +1,11 @@
+sub init()
+ initGetNodes()
+ m.
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+end sub
diff --git a/.history/components/rowListScene_20211008150619.brs b/.history/components/rowListScene_20211008150619.brs
new file mode 100644
index 0000000..ebeb038
--- /dev/null
+++ b/.history/components/rowListScene_20211008150619.brs
@@ -0,0 +1,11 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+end sub
diff --git a/.history/components/rowListScene_20211008150659.brs b/.history/components/rowListScene_20211008150659.brs
new file mode 100644
index 0000000..c90d8f5
--- /dev/null
+++ b/.history/components/rowListScene_20211008150659.brs
@@ -0,0 +1,16 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+end sub
+
+sub initObservers()
+
+end sub
diff --git a/.history/components/rowListScene_20211008150803.brs b/.history/components/rowListScene_20211008150803.brs
new file mode 100644
index 0000000..72935af
--- /dev/null
+++ b/.history/components/rowListScene_20211008150803.brs
@@ -0,0 +1,16 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+end sub
diff --git a/.history/components/rowListScene_20211008150813.brs b/.history/components/rowListScene_20211008150813.brs
new file mode 100644
index 0000000..ca8a3b6
--- /dev/null
+++ b/.history/components/rowListScene_20211008150813.brs
@@ -0,0 +1,18 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stop.observeField("buttonSelected", "stop")
+ m.reset.observeField("buttonSelected", "reset")
+end sub
diff --git a/.history/components/rowListScene_20211008150839.brs b/.history/components/rowListScene_20211008150839.brs
new file mode 100644
index 0000000..a2af0c2
--- /dev/null
+++ b/.history/components/rowListScene_20211008150839.brs
@@ -0,0 +1,20 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("reset")
+ m.reset = m.top.findNode("reset")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stop.observeField("buttonSelected", "stop")
+ m.reset.observeField("buttonSelected", "reset")
+end sub
diff --git a/.history/components/rowListScene_20211008150851.brs b/.history/components/rowListScene_20211008150851.brs
new file mode 100644
index 0000000..4132c66
--- /dev/null
+++ b/.history/components/rowListScene_20211008150851.brs
@@ -0,0 +1,20 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stop.observeField("buttonSelected", "stop")
+ m.reset.observeField("buttonSelected", "reset")
+end sub
diff --git a/.history/components/rowListScene_20211008150910.brs b/.history/components/rowListScene_20211008150910.brs
new file mode 100644
index 0000000..756e93f
--- /dev/null
+++ b/.history/components/rowListScene_20211008150910.brs
@@ -0,0 +1,23 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stop.observeField("buttonSelected", "stop")
+ m.reset.observeField("buttonSelected", "reset")
+end sub
+
+sub start()
+end sub
diff --git a/.history/components/rowListScene_20211008150944.brs b/.history/components/rowListScene_20211008150944.brs
new file mode 100644
index 0000000..6c7350a
--- /dev/null
+++ b/.history/components/rowListScene_20211008150944.brs
@@ -0,0 +1,28 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stop.observeField("buttonSelected", "stop")
+ m.reset.observeField("buttonSelected", "reset")
+end sub
+
+sub start()
+ m.timer.control = "start"
+end sub
+
+sub stop()
+ m.timer.control = "stop"
+end sub
diff --git a/.history/components/rowListScene_20211008151000.brs b/.history/components/rowListScene_20211008151000.brs
new file mode 100644
index 0000000..49c9dc8
--- /dev/null
+++ b/.history/components/rowListScene_20211008151000.brs
@@ -0,0 +1,32 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stop.observeField("buttonSelected", "stop")
+ m.reset.observeField("buttonSelected", "reset")
+end sub
+
+sub start()
+ m.timer.control = "start"
+end sub
+
+sub stop()
+ m.timer.control = "stop"
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151026.brs b/.history/components/rowListScene_20211008151026.brs
new file mode 100644
index 0000000..49c9dc8
--- /dev/null
+++ b/.history/components/rowListScene_20211008151026.brs
@@ -0,0 +1,32 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stop.observeField("buttonSelected", "stop")
+ m.reset.observeField("buttonSelected", "reset")
+end sub
+
+sub start()
+ m.timer.control = "start"
+end sub
+
+sub stop()
+ m.timer.control = "stop"
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151203.xml b/.history/components/rowListScene_20211008151203.xml
new file mode 100644
index 0000000..8eb1ba2
--- /dev/null
+++ b/.history/components/rowListScene_20211008151203.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151217.brs b/.history/components/rowListScene_20211008151217.brs
new file mode 100644
index 0000000..b17c6b4
--- /dev/null
+++ b/.history/components/rowListScene_20211008151217.brs
@@ -0,0 +1,33 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stop.observeField("buttonSelected", "stop")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer.observeField("fire", "reset")
+end sub
+
+sub start()
+ m.timer.control = "start"
+end sub
+
+sub stop()
+ m.timer.control = "stop"
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151221.xml b/.history/components/rowListScene_20211008151221.xml
new file mode 100644
index 0000000..0063b46
--- /dev/null
+++ b/.history/components/rowListScene_20211008151221.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151233.brs b/.history/components/rowListScene_20211008151233.brs
new file mode 100644
index 0000000..c33d013
--- /dev/null
+++ b/.history/components/rowListScene_20211008151233.brs
@@ -0,0 +1,33 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stop.observeField("buttonSelected", "stop")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer.control = "start"
+end sub
+
+sub stop()
+ m.timer.control = "stop"
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151244.brs b/.history/components/rowListScene_20211008151244.brs
new file mode 100644
index 0000000..25f4896
--- /dev/null
+++ b/.history/components/rowListScene_20211008151244.brs
@@ -0,0 +1,37 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stop.observeField("buttonSelected", "stop")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer.observeField("fire", "changeText")
+end sub
+
+sub changeText
+
+end sub
+
+sub start()
+ m.timer.control = "start"
+end sub
+
+sub stop()
+ m.timer.control = "stop"
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151305.brs b/.history/components/rowListScene_20211008151305.brs
new file mode 100644
index 0000000..9f8d9d9
--- /dev/null
+++ b/.history/components/rowListScene_20211008151305.brs
@@ -0,0 +1,37 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stop = m.btnGroup.findNode("stop")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stop.observeField("buttonSelected", "stop")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer.observeField("fire", "changeText")
+end sub
+
+sub changeText()
+ m.timeLabel.text = m.timer.duration
+end sub
+
+sub start()
+ m.timer.control = "start"
+end sub
+
+sub stop()
+ m.timer.control = "stop"
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151346.xml b/.history/components/rowListScene_20211008151346.xml
new file mode 100644
index 0000000..ea89a5c
--- /dev/null
+++ b/.history/components/rowListScene_20211008151346.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151554.brs b/.history/components/rowListScene_20211008151554.brs
new file mode 100644
index 0000000..3291af5
--- /dev/null
+++ b/.history/components/rowListScene_20211008151554.brs
@@ -0,0 +1,37 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer.observeField("fire", "changeText")
+end sub
+
+sub changeText()
+ m.timeLabel.text = m.timer.duration
+end sub
+
+sub start()
+ m.timer.control = "start"
+end sub
+
+sub stop()
+ m.timer.control = "stop"
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151601.xml b/.history/components/rowListScene_20211008151601.xml
new file mode 100644
index 0000000..c693006
--- /dev/null
+++ b/.history/components/rowListScene_20211008151601.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151608.brs b/.history/components/rowListScene_20211008151608.brs
new file mode 100644
index 0000000..35d9145
--- /dev/null
+++ b/.history/components/rowListScene_20211008151608.brs
@@ -0,0 +1,37 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer.observeField("fire", "changeText")
+end sub
+
+sub changeText()
+ m.timeLabel.text = m.timer.duration
+end sub
+
+sub start()
+ m.timer.control = "start"
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151648.brs b/.history/components/rowListScene_20211008151648.brs
new file mode 100644
index 0000000..0045f6f
--- /dev/null
+++ b/.history/components/rowListScene_20211008151648.brs
@@ -0,0 +1,38 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer.observeField("fire", "changeText")
+end sub
+
+sub changeText()
+ m.timeLabel.text = m.timer.duration
+end sub
+
+sub start()
+ m.timer.control = "start"
+ ?m.timer.duration
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151716.brs b/.history/components/rowListScene_20211008151716.brs
new file mode 100644
index 0000000..dd6e09d
--- /dev/null
+++ b/.history/components/rowListScene_20211008151716.brs
@@ -0,0 +1,38 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer.observeField("fire", "changeText")
+end sub
+
+sub changeText()
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
+
+sub start()
+ m.timer.control = "start"
+ ?m.timer.duration
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151748.brs b/.history/components/rowListScene_20211008151748.brs
new file mode 100644
index 0000000..e628dea
--- /dev/null
+++ b/.history/components/rowListScene_20211008151748.brs
@@ -0,0 +1,34 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer.control = "start"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151751.brs b/.history/components/rowListScene_20211008151751.brs
new file mode 100644
index 0000000..e628dea
--- /dev/null
+++ b/.history/components/rowListScene_20211008151751.brs
@@ -0,0 +1,34 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer.control = "start"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151753.brs b/.history/components/rowListScene_20211008151753.brs
new file mode 100644
index 0000000..f4b2fd0
--- /dev/null
+++ b/.history/components/rowListScene_20211008151753.brs
@@ -0,0 +1,34 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer.control = "start"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010122343.xml b/.history/components/rowListScene_20211010122343.xml
new file mode 100644
index 0000000..c693006
--- /dev/null
+++ b/.history/components/rowListScene_20211010122343.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010122348.xml b/.history/components/rowListScene_20211010122348.xml
new file mode 100644
index 0000000..b912f1c
--- /dev/null
+++ b/.history/components/rowListScene_20211010122348.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010122743.brs b/.history/components/rowListScene_20211010122743.brs
new file mode 100644
index 0000000..55d9f64
--- /dev/null
+++ b/.history/components/rowListScene_20211010122743.brs
@@ -0,0 +1,34 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer.control = "start"
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010122855.brs b/.history/components/rowListScene_20211010122855.brs
new file mode 100644
index 0000000..4db3c87
--- /dev/null
+++ b/.history/components/rowListScene_20211010122855.brs
@@ -0,0 +1,35 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer.control = "start"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010122902.brs b/.history/components/rowListScene_20211010122902.brs
new file mode 100644
index 0000000..7788025
--- /dev/null
+++ b/.history/components/rowListScene_20211010122902.brs
@@ -0,0 +1,36 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer.control = "start"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123116.xml b/.history/components/rowListScene_20211010123116.xml
new file mode 100644
index 0000000..5d2e84c
--- /dev/null
+++ b/.history/components/rowListScene_20211010123116.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123149.brs b/.history/components/rowListScene_20211010123149.brs
new file mode 100644
index 0000000..b0428e8
--- /dev/null
+++ b/.history/components/rowListScene_20211010123149.brs
@@ -0,0 +1,37 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+ m.timer = createObject("roTimeSpan")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer.control = "start"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123557.brs b/.history/components/rowListScene_20211010123557.brs
new file mode 100644
index 0000000..9be9bab
--- /dev/null
+++ b/.history/components/rowListScene_20211010123557.brs
@@ -0,0 +1,37 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer = createObject("roTimeSpan")
+ time = m.timer.totalSeconds()
+ m.timeLabel.text = Str(time / 60) + Str((time 60) * 60)
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123606.brs b/.history/components/rowListScene_20211010123606.brs
new file mode 100644
index 0000000..9be9bab
--- /dev/null
+++ b/.history/components/rowListScene_20211010123606.brs
@@ -0,0 +1,37 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer = createObject("roTimeSpan")
+ time = m.timer.totalSeconds()
+ m.timeLabel.text = Str(time / 60) + Str((time 60) * 60)
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123612.brs b/.history/components/rowListScene_20211010123612.brs
new file mode 100644
index 0000000..672143d
--- /dev/null
+++ b/.history/components/rowListScene_20211010123612.brs
@@ -0,0 +1,37 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer = createObject("roTimeSpan")
+ time = m.timer.totalSeconds()
+ m.timeLabel.text = Str(time / 60) + Str((time mod 60) * 60)
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123656.brs b/.history/components/rowListScene_20211010123656.brs
new file mode 100644
index 0000000..825eaca
--- /dev/null
+++ b/.history/components/rowListScene_20211010123656.brs
@@ -0,0 +1,38 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer = createObject("roTimeSpan")
+ time = m.timer.totalSeconds()
+ m.timeLabel.text = Str(time / 60) + Str((time mod 60) * 60)
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ time = m.timer.totalSeconds()
+ m.timeLabel.text = Str(time / 60) + Str((time mod 60) * 60)
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123711.brs b/.history/components/rowListScene_20211010123711.brs
new file mode 100644
index 0000000..3a300e4
--- /dev/null
+++ b/.history/components/rowListScene_20211010123711.brs
@@ -0,0 +1,39 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer = createObject("roTimeSpan")
+ time = m.timer.totalSeconds()
+ m.timeLabel.text = Str(time / 60) + Str((time mod 60) * 60)
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ time = m.timer.totalSeconds()
+ m.timeLabel.text = Str(time / 60) + Str((time mod 60) * 60)
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123739.brs b/.history/components/rowListScene_20211010123739.brs
new file mode 100644
index 0000000..d2c4540
--- /dev/null
+++ b/.history/components/rowListScene_20211010123739.brs
@@ -0,0 +1,38 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer = createObject("roTimeSpan")
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ time = m.timer.totalSeconds()
+ m.timeLabel.text = Str(time / 60) + Str((time mod 60) * 60)
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123753.brs b/.history/components/rowListScene_20211010123753.brs
new file mode 100644
index 0000000..95683f7
--- /dev/null
+++ b/.history/components/rowListScene_20211010123753.brs
@@ -0,0 +1,38 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer = createObject("roTimeSpan")
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ time = m.timer.totalSeconds()
+ m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123754.brs b/.history/components/rowListScene_20211010123754.brs
new file mode 100644
index 0000000..95683f7
--- /dev/null
+++ b/.history/components/rowListScene_20211010123754.brs
@@ -0,0 +1,38 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer = createObject("roTimeSpan")
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ time = m.timer.totalSeconds()
+ m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
+end sub
+
+sub reset()
+ m.timer.control = "reset"
+ m.timeLabel.text = Str(m.timer.duration)
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123821.brs b/.history/components/rowListScene_20211010123821.brs
new file mode 100644
index 0000000..bd46a35
--- /dev/null
+++ b/.history/components/rowListScene_20211010123821.brs
@@ -0,0 +1,37 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer = createObject("roTimeSpan")
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ time = m.timer.totalSeconds()
+ m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123912.brs b/.history/components/rowListScene_20211010123912.brs
new file mode 100644
index 0000000..e9239ee
--- /dev/null
+++ b/.history/components/rowListScene_20211010123912.brs
@@ -0,0 +1,37 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer = createObject("roTimespan")
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ time = m.timer.totalSeconds()
+ m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123926.brs b/.history/components/rowListScene_20211010123926.brs
new file mode 100644
index 0000000..75ec373
--- /dev/null
+++ b/.history/components/rowListScene_20211010123926.brs
@@ -0,0 +1,37 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer = createObject("roTimespan")
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ m.timer.control = "stop"
+ time = m.timer.TotalSeconds()
+ m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124004.brs b/.history/components/rowListScene_20211010124004.brs
new file mode 100644
index 0000000..908aa4c
--- /dev/null
+++ b/.history/components/rowListScene_20211010124004.brs
@@ -0,0 +1,36 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timer = createObject("roTimespan")
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124048.brs b/.history/components/rowListScene_20211010124048.brs
new file mode 100644
index 0000000..1e5116c
--- /dev/null
+++ b/.history/components/rowListScene_20211010124048.brs
@@ -0,0 +1,36 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124059.brs b/.history/components/rowListScene_20211010124059.brs
new file mode 100644
index 0000000..1e5116c
--- /dev/null
+++ b/.history/components/rowListScene_20211010124059.brs
@@ -0,0 +1,36 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124155.brs b/.history/components/rowListScene_20211010124155.brs
new file mode 100644
index 0000000..2d80754
--- /dev/null
+++ b/.history/components/rowListScene_20211010124155.brs
@@ -0,0 +1,36 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ m.timeLabel.text = Str(time / 60) + ":" + Str((time MOD 60) * 60)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124210.brs b/.history/components/rowListScene_20211010124210.brs
new file mode 100644
index 0000000..f6a59a7
--- /dev/null
+++ b/.history/components/rowListScene_20211010124210.brs
@@ -0,0 +1,36 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ m.timeLabel.text = Str(Int(time / 60)) + ":" + Str((Int(time MOD 60)) * 60)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124225.brs b/.history/components/rowListScene_20211010124225.brs
new file mode 100644
index 0000000..ad873ab
--- /dev/null
+++ b/.history/components/rowListScene_20211010124225.brs
@@ -0,0 +1,36 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT(time MOD 60)) * 60)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124416.brs b/.history/components/rowListScene_20211010124416.brs
new file mode 100644
index 0000000..58f930a
--- /dev/null
+++ b/.history/components/rowListScene_20211010124416.brs
@@ -0,0 +1,36 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124457.brs b/.history/components/rowListScene_20211010124457.brs
new file mode 100644
index 0000000..3594e63
--- /dev/null
+++ b/.history/components/rowListScene_20211010124457.brs
@@ -0,0 +1,36 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124504.brs b/.history/components/rowListScene_20211010124504.brs
new file mode 100644
index 0000000..58f930a
--- /dev/null
+++ b/.history/components/rowListScene_20211010124504.brs
@@ -0,0 +1,36 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124545.brs b/.history/components/rowListScene_20211010124545.brs
new file mode 100644
index 0000000..093d510
--- /dev/null
+++ b/.history/components/rowListScene_20211010124545.brs
@@ -0,0 +1,38 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time > 59
+ seconds = "00"
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124549.brs b/.history/components/rowListScene_20211010124549.brs
new file mode 100644
index 0000000..4cf4286
--- /dev/null
+++ b/.history/components/rowListScene_20211010124549.brs
@@ -0,0 +1,39 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time > 59
+ seconds = "00"
+ end if
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124817.brs b/.history/components/rowListScene_20211010124817.brs
new file mode 100644
index 0000000..4699e70
--- /dev/null
+++ b/.history/components/rowListScene_20211010124817.brs
@@ -0,0 +1,42 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = "00"
+ end if
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124832.brs b/.history/components/rowListScene_20211010124832.brs
new file mode 100644
index 0000000..13ad598
--- /dev/null
+++ b/.history/components/rowListScene_20211010124832.brs
@@ -0,0 +1,42 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = = 0
+ seconds = "00"
+ minutes = time / 60
+ else
+ minutes = "00"
+ end if
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124834.brs b/.history/components/rowListScene_20211010124834.brs
new file mode 100644
index 0000000..13ad598
--- /dev/null
+++ b/.history/components/rowListScene_20211010124834.brs
@@ -0,0 +1,42 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = = 0
+ seconds = "00"
+ minutes = time / 60
+ else
+ minutes = "00"
+ end if
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124838.brs b/.history/components/rowListScene_20211010124838.brs
new file mode 100644
index 0000000..3e31de6
--- /dev/null
+++ b/.history/components/rowListScene_20211010124838.brs
@@ -0,0 +1,41 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = = 0
+ seconds = "00"
+ minutes = time / 60
+ else
+ end if
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124840.brs b/.history/components/rowListScene_20211010124840.brs
new file mode 100644
index 0000000..0d67eda
--- /dev/null
+++ b/.history/components/rowListScene_20211010124840.brs
@@ -0,0 +1,40 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = = 0
+ seconds = "00"
+ minutes = time / 60
+ end if
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124841.brs b/.history/components/rowListScene_20211010124841.brs
new file mode 100644
index 0000000..0d67eda
--- /dev/null
+++ b/.history/components/rowListScene_20211010124841.brs
@@ -0,0 +1,40 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = = 0
+ seconds = "00"
+ minutes = time / 60
+ end if
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124855.brs b/.history/components/rowListScene_20211010124855.brs
new file mode 100644
index 0000000..5779dde
--- /dev/null
+++ b/.history/components/rowListScene_20211010124855.brs
@@ -0,0 +1,40 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if (time MOD 60) = = 0
+ seconds = "00"
+ minutes = time / 60
+ end if
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124857.brs b/.history/components/rowListScene_20211010124857.brs
new file mode 100644
index 0000000..5779dde
--- /dev/null
+++ b/.history/components/rowListScene_20211010124857.brs
@@ -0,0 +1,40 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if (time MOD 60) = = 0
+ seconds = "00"
+ minutes = time / 60
+ end if
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124910.brs b/.history/components/rowListScene_20211010124910.brs
new file mode 100644
index 0000000..74f9346
--- /dev/null
+++ b/.history/components/rowListScene_20211010124910.brs
@@ -0,0 +1,40 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = time / 60
+ end if
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124917.brs b/.history/components/rowListScene_20211010124917.brs
new file mode 100644
index 0000000..a3d5539
--- /dev/null
+++ b/.history/components/rowListScene_20211010124917.brs
@@ -0,0 +1,41 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = time / 60
+ else
+ end if
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125016.brs b/.history/components/rowListScene_20211010125016.brs
new file mode 100644
index 0000000..5c59ca9
--- /dev/null
+++ b/.history/components/rowListScene_20211010125016.brs
@@ -0,0 +1,43 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = time / 60
+ else
+ minutes = INT(time / 60)
+ seconds = INT((time MOD 60) * 60)
+ end if
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125023.brs b/.history/components/rowListScene_20211010125023.brs
new file mode 100644
index 0000000..52b93df
--- /dev/null
+++ b/.history/components/rowListScene_20211010125023.brs
@@ -0,0 +1,43 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = time / 60
+ else
+ minutes = INT(time / 60)
+ seconds = Str(INT((time MOD 60) * 60))
+ end if
+ m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125035.brs b/.history/components/rowListScene_20211010125035.brs
new file mode 100644
index 0000000..608ae7f
--- /dev/null
+++ b/.history/components/rowListScene_20211010125035.brs
@@ -0,0 +1,43 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = time / 60
+ else
+ minutes = INT(time / 60)
+ seconds = Str(INT((time MOD 60) * 60))
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125125.brs b/.history/components/rowListScene_20211010125125.brs
new file mode 100644
index 0000000..2ee8a7e
--- /dev/null
+++ b/.history/components/rowListScene_20211010125125.brs
@@ -0,0 +1,43 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT((time MOD 60) * 60))
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125153.brs b/.history/components/rowListScene_20211010125153.brs
new file mode 100644
index 0000000..421b178
--- /dev/null
+++ b/.history/components/rowListScene_20211010125153.brs
@@ -0,0 +1,43 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125251.brs b/.history/components/rowListScene_20211010125251.brs
new file mode 100644
index 0000000..441c075
--- /dev/null
+++ b/.history/components/rowListScene_20211010125251.brs
@@ -0,0 +1,44 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ if Len(minutes)
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125317.brs b/.history/components/rowListScene_20211010125317.brs
new file mode 100644
index 0000000..0155232
--- /dev/null
+++ b/.history/components/rowListScene_20211010125317.brs
@@ -0,0 +1,46 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ if Len(minutes) = 1
+
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125328.brs b/.history/components/rowListScene_20211010125328.brs
new file mode 100644
index 0000000..ad1fd38
--- /dev/null
+++ b/.history/components/rowListScene_20211010125328.brs
@@ -0,0 +1,46 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125350.brs b/.history/components/rowListScene_20211010125350.brs
new file mode 100644
index 0000000..c45205a
--- /dev/null
+++ b/.history/components/rowListScene_20211010125350.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125431.brs b/.history/components/rowListScene_20211010125431.brs
new file mode 100644
index 0000000..f5a70be
--- /dev/null
+++ b/.history/components/rowListScene_20211010125431.brs
@@ -0,0 +1,50 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ ?Len(minutes)
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125509.brs b/.history/components/rowListScene_20211010125509.brs
new file mode 100644
index 0000000..a16401c
--- /dev/null
+++ b/.history/components/rowListScene_20211010125509.brs
@@ -0,0 +1,50 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ ?Len(seconds)
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125709.brs b/.history/components/rowListScene_20211010125709.brs
new file mode 100644
index 0000000..c45205a
--- /dev/null
+++ b/.history/components/rowListScene_20211010125709.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125712.brs b/.history/components/rowListScene_20211010125712.brs
new file mode 100644
index 0000000..15d31ee
--- /dev/null
+++ b/.history/components/rowListScene_20211010125712.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ if Len(minutes) = 2
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 2
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125717.brs b/.history/components/rowListScene_20211010125717.brs
new file mode 100644
index 0000000..c4d5f54
--- /dev/null
+++ b/.history/components/rowListScene_20211010125717.brs
@@ -0,0 +1,50 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ if Len(minutes) = 2
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 2
+ seconds = "0" + seconds
+ end if
+ ?minutes
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125756.brs b/.history/components/rowListScene_20211010125756.brs
new file mode 100644
index 0000000..c4d5f54
--- /dev/null
+++ b/.history/components/rowListScene_20211010125756.brs
@@ -0,0 +1,50 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ if Len(minutes) = 2
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 2
+ seconds = "0" + seconds
+ end if
+ ?minutes
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125848.brs b/.history/components/rowListScene_20211010125848.brs
new file mode 100644
index 0000000..15d31ee
--- /dev/null
+++ b/.history/components/rowListScene_20211010125848.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ if Len(minutes) = 2
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 2
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125855.brs b/.history/components/rowListScene_20211010125855.brs
new file mode 100644
index 0000000..c45205a
--- /dev/null
+++ b/.history/components/rowListScene_20211010125855.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125904.brs b/.history/components/rowListScene_20211010125904.brs
new file mode 100644
index 0000000..1f962f5
--- /dev/null
+++ b/.history/components/rowListScene_20211010125904.brs
@@ -0,0 +1,50 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ ?minutes;seconds
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130310.brs b/.history/components/rowListScene_20211010130310.brs
new file mode 100644
index 0000000..cce4ff7
--- /dev/null
+++ b/.history/components/rowListScene_20211010130310.brs
@@ -0,0 +1,50 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ ?minutes.Len();LEN(seconds)
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130315.brs b/.history/components/rowListScene_20211010130315.brs
new file mode 100644
index 0000000..1f516bb
--- /dev/null
+++ b/.history/components/rowListScene_20211010130315.brs
@@ -0,0 +1,50 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ ?minutes.Len();Len(seconds)
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130435.brs b/.history/components/rowListScene_20211010130435.brs
new file mode 100644
index 0000000..cef2242
--- /dev/null
+++ b/.history/components/rowListScene_20211010130435.brs
@@ -0,0 +1,50 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ ?minutes.Len();Len(Right(seconds, 1))
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130553.brs b/.history/components/rowListScene_20211010130553.brs
new file mode 100644
index 0000000..d23ca05
--- /dev/null
+++ b/.history/components/rowListScene_20211010130553.brs
@@ -0,0 +1,50 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ ?seconds.Len()
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130642.brs b/.history/components/rowListScene_20211010130642.brs
new file mode 100644
index 0000000..c45205a
--- /dev/null
+++ b/.history/components/rowListScene_20211010130642.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130800.brs b/.history/components/rowListScene_20211010130800.brs
new file mode 100644
index 0000000..7531e7c
--- /dev/null
+++ b/.history/components/rowListScene_20211010130800.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ end if
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130847.brs b/.history/components/rowListScene_20211010130847.brs
new file mode 100644
index 0000000..57d5dfc
--- /dev/null
+++ b/.history/components/rowListScene_20211010130847.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ end if
+ if Len(minutes > 10)
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130910.brs b/.history/components/rowListScene_20211010130910.brs
new file mode 100644
index 0000000..d75f871
--- /dev/null
+++ b/.history/components/rowListScene_20211010130910.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ end if
+ if minutes > 10
+ minutes = "0" + minutes
+ end if
+ if seconds > 10
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130927.brs b/.history/components/rowListScene_20211010130927.brs
new file mode 100644
index 0000000..25e89dc
--- /dev/null
+++ b/.history/components/rowListScene_20211010130927.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ end if
+ if minutes > 10
+ minutes = "0" + Str(minutes)
+ end if
+ if seconds > 10
+ seconds = "0" + Str(seconds)
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131020.brs b/.history/components/rowListScene_20211010131020.brs
new file mode 100644
index 0000000..e38ad66
--- /dev/null
+++ b/.history/components/rowListScene_20211010131020.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ end if
+ if minutes > 10
+ minutes = "0" + Str(minutes)
+ end if
+ if seconds > 10
+ seconds = "0" + Str(seconds)
+ end if
+ m.timeLabel.text = String(minutes + ":" + seconds)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131021.brs b/.history/components/rowListScene_20211010131021.brs
new file mode 100644
index 0000000..e38ad66
--- /dev/null
+++ b/.history/components/rowListScene_20211010131021.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ end if
+ if minutes > 10
+ minutes = "0" + Str(minutes)
+ end if
+ if seconds > 10
+ seconds = "0" + Str(seconds)
+ end if
+ m.timeLabel.text = String(minutes + ":" + seconds)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131044.brs b/.history/components/rowListScene_20211010131044.brs
new file mode 100644
index 0000000..41b34ac
--- /dev/null
+++ b/.history/components/rowListScene_20211010131044.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ end if
+ if minutes > 10
+ minutes = "0" + Str(minutes)
+ end if
+ if seconds > 10
+ seconds = "0" + Str(seconds)
+ end if
+ m.timeLabel.text = Str(minutes + ":" + seconds)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131134.brs b/.history/components/rowListScene_20211010131134.brs
new file mode 100644
index 0000000..25e89dc
--- /dev/null
+++ b/.history/components/rowListScene_20211010131134.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ end if
+ if minutes > 10
+ minutes = "0" + Str(minutes)
+ end if
+ if seconds > 10
+ seconds = "0" + Str(seconds)
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131150.brs b/.history/components/rowListScene_20211010131150.brs
new file mode 100644
index 0000000..0688b9e
--- /dev/null
+++ b/.history/components/rowListScene_20211010131150.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ end if
+ if minutes > 10
+ minutes = "0" + Str(minutes)
+ end if
+ if seconds > 10
+ seconds = "0" + Str(seconds)
+ end if
+ m.timeLabel.text = Str(minutes) + ":" + Str(seconds)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131237.brs b/.history/components/rowListScene_20211010131237.brs
new file mode 100644
index 0000000..29242d8
--- /dev/null
+++ b/.history/components/rowListScene_20211010131237.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ end if
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ end if
+ m.timeLabel.text = Str(minutes) + ":" + Str(seconds)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131430.brs b/.history/components/rowListScene_20211010131430.brs
new file mode 100644
index 0000000..ab60956
--- /dev/null
+++ b/.history/components/rowListScene_20211010131430.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ end if
+ m.timeLabel.text = Str(minutes) + ":" + Str(seconds)
+ end if
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131442.brs b/.history/components/rowListScene_20211010131442.brs
new file mode 100644
index 0000000..dd532ac
--- /dev/null
+++ b/.history/components/rowListScene_20211010131442.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ end if
+ end if
+ m.timeLabel.text = Str(minutes) + ":" + Str(seconds)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131514.brs b/.history/components/rowListScene_20211010131514.brs
new file mode 100644
index 0000000..3bb158a
--- /dev/null
+++ b/.history/components/rowListScene_20211010131514.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + minutes
+ end if
+ if seconds < 10
+ seconds = "0" + seconds
+ end if
+ end if
+ m.timeLabel.text = Str(minutes) + ":" + Str(seconds)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131649.brs b/.history/components/rowListScene_20211010131649.brs
new file mode 100644
index 0000000..dd532ac
--- /dev/null
+++ b/.history/components/rowListScene_20211010131649.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ end if
+ end if
+ m.timeLabel.text = Str(minutes) + ":" + Str(seconds)
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131725.brs b/.history/components/rowListScene_20211010131725.brs
new file mode 100644
index 0000000..a0334d5
--- /dev/null
+++ b/.history/components/rowListScene_20211010131725.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ end if
+ end if
+ m.timeLabel.text = minutes) + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131734.brs b/.history/components/rowListScene_20211010131734.brs
new file mode 100644
index 0000000..ba60973
--- /dev/null
+++ b/.history/components/rowListScene_20211010131734.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ end if
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132014.brs b/.history/components/rowListScene_20211010132014.brs
new file mode 100644
index 0000000..cb62839
--- /dev/null
+++ b/.history/components/rowListScene_20211010132014.brs
@@ -0,0 +1,53 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ else
+ minutes = INT(time / 60)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ else
+ seconds = INT(time / 60)
+ end if
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132049.brs b/.history/components/rowListScene_20211010132049.brs
new file mode 100644
index 0000000..3de214e
--- /dev/null
+++ b/.history/components/rowListScene_20211010132049.brs
@@ -0,0 +1,53 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ else
+ minutes = Str(time / 60)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ else
+ seconds = Str(time / 60)
+ end if
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132232.brs b/.history/components/rowListScene_20211010132232.brs
new file mode 100644
index 0000000..a15f78a
--- /dev/null
+++ b/.history/components/rowListScene_20211010132232.brs
@@ -0,0 +1,53 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ else
+ minutes = Str(time / 60)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ else
+ seconds = Str(seconds)
+ end if
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132443.brs b/.history/components/rowListScene_20211010132443.brs
new file mode 100644
index 0000000..27b8e2e
--- /dev/null
+++ b/.history/components/rowListScene_20211010132443.brs
@@ -0,0 +1,55 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ minutes = Right(minutes, 1)
+ else
+ minutes = Str(time / 60)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ seconds = Right(seconds, 1)
+ else
+ seconds = Str(seconds)
+ end if
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132532.brs b/.history/components/rowListScene_20211010132532.brs
new file mode 100644
index 0000000..17bbae4
--- /dev/null
+++ b/.history/components/rowListScene_20211010132532.brs
@@ -0,0 +1,57 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ minutes = "0" + minutes
+ minutes = Right(minutes, 1)
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ minutes = Right(minutes, 1)
+ else
+ minutes = Str(time / 60)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ seconds = Right(seconds, 1)
+ else
+ seconds = Str(seconds)
+ end if
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132545.brs b/.history/components/rowListScene_20211010132545.brs
new file mode 100644
index 0000000..a6818b4
--- /dev/null
+++ b/.history/components/rowListScene_20211010132545.brs
@@ -0,0 +1,56 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ minutes = "0" + minutes
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ minutes = Right(minutes, 1)
+ else
+ minutes = Str(time / 60)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ seconds = Right(seconds, 1)
+ else
+ seconds = Str(seconds)
+ end if
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132642.brs b/.history/components/rowListScene_20211010132642.brs
new file mode 100644
index 0000000..b4b5b84
--- /dev/null
+++ b/.history/components/rowListScene_20211010132642.brs
@@ -0,0 +1,56 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ minutes = "0" + minutes
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ minutes = Right(minutes, 1) + Left(minutes, 1)
+ else
+ minutes = Str(time / 60)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ seconds = Right(seconds, 1) + Left(seconds, 1)
+ else
+ seconds = Str(seconds)
+ end if
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132714.brs b/.history/components/rowListScene_20211010132714.brs
new file mode 100644
index 0000000..b2e0f9f
--- /dev/null
+++ b/.history/components/rowListScene_20211010132714.brs
@@ -0,0 +1,56 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ minutes = "0" + minutes
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ minutes = Right(minutes, 1) + Left(minutes, 1)
+ else
+ minutes = Str(time / 60)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ seconds = Left(seconds, 1) + Right(seconds, 1)
+ else
+ seconds = Str(seconds)
+ end if
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132739.brs b/.history/components/rowListScene_20211010132739.brs
new file mode 100644
index 0000000..4199bbd
--- /dev/null
+++ b/.history/components/rowListScene_20211010132739.brs
@@ -0,0 +1,56 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ minutes = "0" + minutes
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ minutes = + Left(minutes, 1) + Right(minutes, 1)
+ else
+ minutes = Str(time / 60)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ seconds = Left(seconds, 1) + Right(seconds, 1)
+ else
+ seconds = Str(seconds)
+ end if
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132742.brs b/.history/components/rowListScene_20211010132742.brs
new file mode 100644
index 0000000..4199bbd
--- /dev/null
+++ b/.history/components/rowListScene_20211010132742.brs
@@ -0,0 +1,56 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ minutes = "0" + minutes
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ minutes = + Left(minutes, 1) + Right(minutes, 1)
+ else
+ minutes = Str(time / 60)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ seconds = Left(seconds, 1) + Right(seconds, 1)
+ else
+ seconds = Str(seconds)
+ end if
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132749.brs b/.history/components/rowListScene_20211010132749.brs
new file mode 100644
index 0000000..c674851
--- /dev/null
+++ b/.history/components/rowListScene_20211010132749.brs
@@ -0,0 +1,56 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ minutes = "0" + minutes
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ minutes = Left(minutes, 1) + Right(minutes, 1)
+ else
+ minutes = Str(time / 60)
+ end if
+ if seconds < 10
+ seconds = "0" + Str(seconds)
+ seconds = Left(seconds, 1) + Right(seconds, 1)
+ else
+ seconds = Str(seconds)
+ end if
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132943.brs b/.history/components/rowListScene_20211010132943.brs
new file mode 100644
index 0000000..33e4950
--- /dev/null
+++ b/.history/components/rowListScene_20211010132943.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ minutes = "0" + minutes
+else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ minutes = Left(minutes, 1) + Right(minutes, 1)
+ else
+ minutes = Str(time / 60)
+ end if
+
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132944.brs b/.history/components/rowListScene_20211010132944.brs
new file mode 100644
index 0000000..ac5da14
--- /dev/null
+++ b/.history/components/rowListScene_20211010132944.brs
@@ -0,0 +1,48 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ minutes = "0" + minutes
+else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ minutes = Left(minutes, 1) + Right(minutes, 1)
+ else
+ minutes = Str(time / 60)
+ end if
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132947.brs b/.history/components/rowListScene_20211010132947.brs
new file mode 100644
index 0000000..4111f03
--- /dev/null
+++ b/.history/components/rowListScene_20211010132947.brs
@@ -0,0 +1,49 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ minutes = "0" + minutes
+ else
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutes = "0" + Str(minutes)
+ minutes = Left(minutes, 1) + Right(minutes, 1)
+ else
+ minutes = Str(time / 60)
+ end if
+ end if
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133121.brs b/.history/components/rowListScene_20211010133121.brs
new file mode 100644
index 0000000..706e1c1
--- /dev/null
+++ b/.history/components/rowListScene_20211010133121.brs
@@ -0,0 +1,51 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ minutes = trim(minutes)
+ seconds = trim(seoncds)
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133129.brs b/.history/components/rowListScene_20211010133129.brs
new file mode 100644
index 0000000..9b9b750
--- /dev/null
+++ b/.history/components/rowListScene_20211010133129.brs
@@ -0,0 +1,51 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ minutes = trim(minutes)
+ seconds = trim(seconds)
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133140.brs b/.history/components/rowListScene_20211010133140.brs
new file mode 100644
index 0000000..8f3497e
--- /dev/null
+++ b/.history/components/rowListScene_20211010133140.brs
@@ -0,0 +1,51 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ minutes = T(minutes)
+ seconds = T(seconds)
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133142.brs b/.history/components/rowListScene_20211010133142.brs
new file mode 100644
index 0000000..a515cd8
--- /dev/null
+++ b/.history/components/rowListScene_20211010133142.brs
@@ -0,0 +1,51 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ minutes = Trim(minutes)
+ seconds = Trim(seconds)
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133202.brs b/.history/components/rowListScene_20211010133202.brs
new file mode 100644
index 0000000..85b4e1d
--- /dev/null
+++ b/.history/components/rowListScene_20211010133202.brs
@@ -0,0 +1,51 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ m.reset = m.btnGroup.findNode("reset")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ minutes = minutes.trim()
+ seconds = seconds.trim()
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133442.xml b/.history/components/rowListScene_20211010133442.xml
new file mode 100644
index 0000000..e9f270e
--- /dev/null
+++ b/.history/components/rowListScene_20211010133442.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133449.brs b/.history/components/rowListScene_20211010133449.brs
new file mode 100644
index 0000000..0613459
--- /dev/null
+++ b/.history/components/rowListScene_20211010133449.brs
@@ -0,0 +1,50 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.reset.observeField("buttonSelected", "reset")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ minutes = minutes.trim()
+ seconds = seconds.trim()
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
+
+sub reset()
+ m.timer = createObject("roTimeSpan")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133458.brs b/.history/components/rowListScene_20211010133458.brs
new file mode 100644
index 0000000..ac6aaf5
--- /dev/null
+++ b/.history/components/rowListScene_20211010133458.brs
@@ -0,0 +1,45 @@
+sub init()
+ initGetNodes()
+ m.btnGroup.setFocus(true)
+ initObservers()
+end sub
+
+sub initGetNodes()
+ m.btnGroup = m.top.findNode("btnGroup")
+ m.start = m.btnGroup.findNode("start")
+ m.stopTimer = m.btnGroup.findNode("stopTimer")
+ ' m.timer = m.top.findNode("timer")
+ m.timeLabel = m.top.findNode("timeLabel")
+end sub
+
+sub initObservers()
+ m.start.observeField("buttonSelected", "start")
+ m.stopTimer.observeField("buttonSelected", "stopTimer")
+ m.timer = createObject("roTimespan")
+ ' m.timer.observeField("fire", "changeText")
+end sub
+
+sub start()
+ m.timeLabel.text = "00:00"
+ m.timer.Mark()
+end sub
+
+sub stopTimer()
+ time = m.timer.TotalSeconds()
+ if time MOD 60 = 0
+ seconds = "00"
+ minutes = Str(time / 60)
+ else
+ minutes = Str(INT(time / 60))
+ seconds = Str(INT(time MOD 60))
+ end if
+ minutes = minutes.trim()
+ seconds = seconds.trim()
+ if Len(minutes) = 1
+ minutes = "0" + minutes
+ end if
+ if Len(seconds) = 1
+ seconds = "0" + seconds
+ end if
+ m.timeLabel.text = minutes + ":" + seconds
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011134546.xml b/.history/components/rowListScene_20211011134546.xml
new file mode 100644
index 0000000..23c8ae2
--- /dev/null
+++ b/.history/components/rowListScene_20211011134546.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011134642.xml b/.history/components/rowListScene_20211011134642.xml
new file mode 100644
index 0000000..0453b19
--- /dev/null
+++ b/.history/components/rowListScene_20211011134642.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011134809.xml b/.history/components/rowListScene_20211011134809.xml
new file mode 100644
index 0000000..8202175
--- /dev/null
+++ b/.history/components/rowListScene_20211011134809.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011134907.xml b/.history/components/rowListScene_20211011134907.xml
new file mode 100644
index 0000000..b45c796
--- /dev/null
+++ b/.history/components/rowListScene_20211011134907.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011134920.xml b/.history/components/rowListScene_20211011134920.xml
new file mode 100644
index 0000000..01afb73
--- /dev/null
+++ b/.history/components/rowListScene_20211011134920.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135127.xml b/.history/components/rowListScene_20211011135127.xml
new file mode 100644
index 0000000..529cc99
--- /dev/null
+++ b/.history/components/rowListScene_20211011135127.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135145.brs b/.history/components/rowListScene_20211011135145.brs
new file mode 100644
index 0000000..720721c
--- /dev/null
+++ b/.history/components/rowListScene_20211011135145.brs
@@ -0,0 +1,20 @@
+sub init()
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+end sub
diff --git a/.history/components/rowListScene_20211011135201.brs b/.history/components/rowListScene_20211011135201.brs
new file mode 100644
index 0000000..fd3595f
--- /dev/null
+++ b/.history/components/rowListScene_20211011135201.brs
@@ -0,0 +1,21 @@
+sub init()
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+end sub
diff --git a/.history/components/rowListScene_20211011135220.xml b/.history/components/rowListScene_20211011135220.xml
new file mode 100644
index 0000000..228fc4c
--- /dev/null
+++ b/.history/components/rowListScene_20211011135220.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135315.xml b/.history/components/rowListScene_20211011135315.xml
new file mode 100644
index 0000000..261038d
--- /dev/null
+++ b/.history/components/rowListScene_20211011135315.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135328.xml b/.history/components/rowListScene_20211011135328.xml
new file mode 100644
index 0000000..ca9b317
--- /dev/null
+++ b/.history/components/rowListScene_20211011135328.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135342.xml b/.history/components/rowListScene_20211011135342.xml
new file mode 100644
index 0000000..c86dfe8
--- /dev/null
+++ b/.history/components/rowListScene_20211011135342.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135727.xml b/.history/components/rowListScene_20211011135727.xml
new file mode 100644
index 0000000..7c75e5f
--- /dev/null
+++ b/.history/components/rowListScene_20211011135727.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135742.xml b/.history/components/rowListScene_20211011135742.xml
new file mode 100644
index 0000000..fba5faf
--- /dev/null
+++ b/.history/components/rowListScene_20211011135742.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135756.xml b/.history/components/rowListScene_20211011135756.xml
new file mode 100644
index 0000000..1d590b5
--- /dev/null
+++ b/.history/components/rowListScene_20211011135756.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135757.xml b/.history/components/rowListScene_20211011135757.xml
new file mode 100644
index 0000000..ac9daba
--- /dev/null
+++ b/.history/components/rowListScene_20211011135757.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011140317.xml b/.history/components/rowListScene_20211011140317.xml
new file mode 100644
index 0000000..6f6de83
--- /dev/null
+++ b/.history/components/rowListScene_20211011140317.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011140321.xml b/.history/components/rowListScene_20211011140321.xml
new file mode 100644
index 0000000..6f6de83
--- /dev/null
+++ b/.history/components/rowListScene_20211011140321.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011142206.xml b/.history/components/rowListScene_20211011142206.xml
new file mode 100644
index 0000000..a011be6
--- /dev/null
+++ b/.history/components/rowListScene_20211011142206.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011142420.xml b/.history/components/rowListScene_20211011142420.xml
new file mode 100644
index 0000000..305b1e5
--- /dev/null
+++ b/.history/components/rowListScene_20211011142420.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011142458.xml b/.history/components/rowListScene_20211011142458.xml
new file mode 100644
index 0000000..3429aac
--- /dev/null
+++ b/.history/components/rowListScene_20211011142458.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011142525.brs b/.history/components/rowListScene_20211011142525.brs
new file mode 100644
index 0000000..fb7975a
--- /dev/null
+++ b/.history/components/rowListScene_20211011142525.brs
@@ -0,0 +1,22 @@
+sub init()
+ m.SampleComponentLib = m.findNode("SampleComponentLib")
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+end sub
diff --git a/.history/components/rowListScene_20211011142610.brs b/.history/components/rowListScene_20211011142610.brs
new file mode 100644
index 0000000..0dec3b2
--- /dev/null
+++ b/.history/components/rowListScene_20211011142610.brs
@@ -0,0 +1,23 @@
+sub init()
+ m.SampleComponentLib = m.findNode("SampleComponentLib")
+ m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+end sub
diff --git a/.history/components/rowListScene_20211011142646.brs b/.history/components/rowListScene_20211011142646.brs
new file mode 100644
index 0000000..009bbee
--- /dev/null
+++ b/.history/components/rowListScene_20211011142646.brs
@@ -0,0 +1,27 @@
+sub init()
+ m.SampleComponentLib = m.findNode("SampleComponentLib")
+ m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+end sub
+
+sub libraryLoaded()
+
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011142657.brs b/.history/components/rowListScene_20211011142657.brs
new file mode 100644
index 0000000..24fe681
--- /dev/null
+++ b/.history/components/rowListScene_20211011142657.brs
@@ -0,0 +1,27 @@
+sub init()
+ m.SampleComponentLib = m.findNode("SampleComponentLib")
+ m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+end sub
+
+sub libraryLoaded()
+ if (m.SampleComponentLib.loadStatus = "ready")
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011142700.brs b/.history/components/rowListScene_20211011142700.brs
new file mode 100644
index 0000000..b113633
--- /dev/null
+++ b/.history/components/rowListScene_20211011142700.brs
@@ -0,0 +1,29 @@
+sub init()
+ m.SampleComponentLib = m.findNode("SampleComponentLib")
+ m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+end sub
+
+sub libraryLoaded()
+ if (m.SampleComponentLib.loadStatus = "ready")
+
+ end if
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011143048.brs b/.history/components/rowListScene_20211011143048.brs
new file mode 100644
index 0000000..80896b5
--- /dev/null
+++ b/.history/components/rowListScene_20211011143048.brs
@@ -0,0 +1,30 @@
+sub init()
+ m.parent = m.findNode("mainParent")
+ m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
+ m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+end sub
+
+sub libraryLoaded()
+ if (m.SampleComponentLib.loadStatus = "ready")
+
+ end if
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011143119.brs b/.history/components/rowListScene_20211011143119.brs
new file mode 100644
index 0000000..d6761a8
--- /dev/null
+++ b/.history/components/rowListScene_20211011143119.brs
@@ -0,0 +1,30 @@
+sub init()
+ m.parent = m.findNode("mainParent")
+ m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
+ m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+end sub
+
+sub libraryLoaded()
+ if (m.SampleComponentLib.loadStatus = "ready")
+ loadingNode = createObject("roSGNode", "MainScreen")
+ end if
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011143203.brs b/.history/components/rowListScene_20211011143203.brs
new file mode 100644
index 0000000..b840d5f
--- /dev/null
+++ b/.history/components/rowListScene_20211011143203.brs
@@ -0,0 +1,31 @@
+sub init()
+ m.parent = m.findNode("mainParent")
+ m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
+ m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+end sub
+
+sub libraryLoaded()
+ if (m.SampleComponentLib.loadStatus = "ready")
+ loadingNode = createObject("roSGNode", "LoadingScreen")
+ m.parent.appendChild(loadingNode)
+ end if
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011143204.brs b/.history/components/rowListScene_20211011143204.brs
new file mode 100644
index 0000000..b840d5f
--- /dev/null
+++ b/.history/components/rowListScene_20211011143204.brs
@@ -0,0 +1,31 @@
+sub init()
+ m.parent = m.findNode("mainParent")
+ m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
+ m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+end sub
+
+sub libraryLoaded()
+ if (m.SampleComponentLib.loadStatus = "ready")
+ loadingNode = createObject("roSGNode", "LoadingScreen")
+ m.parent.appendChild(loadingNode)
+ end if
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011143521.brs b/.history/components/rowListScene_20211011143521.brs
new file mode 100644
index 0000000..46e40b0
--- /dev/null
+++ b/.history/components/rowListScene_20211011143521.brs
@@ -0,0 +1,35 @@
+sub init()
+ m.parent = m.findNode("mainParent")
+ m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
+ m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+ store = CreateObject("roSGNode", "ChannelStore")
+ ' Request several properties for sign-up
+ store.requestedUserData = "email, phone, firstname, lastname"
+ store.command = "getUserData"
+end sub
+
+sub libraryLoaded()
+ if (m.SampleComponentLib.loadStatus = "ready")
+ loadingNode = createObject("roSGNode", "LoadingScreen")
+ m.parent.appendChild(loadingNode)
+ end if
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011143557.brs b/.history/components/rowListScene_20211011143557.brs
new file mode 100644
index 0000000..b42b3ad
--- /dev/null
+++ b/.history/components/rowListScene_20211011143557.brs
@@ -0,0 +1,36 @@
+sub init()
+ m.parent = m.findNode("mainParent")
+ m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
+ m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+ store = CreateObject("roSGNode", "ChannelStore")
+ ' Request several properties for sign-up
+ store.requestedUserData = "email, phone, firstname, lastname"
+ store.command = "getUserData"
+ ?store.userData.firstName
+end sub
+
+sub libraryLoaded()
+ if (m.SampleComponentLib.loadStatus = "ready")
+ loadingNode = createObject("roSGNode", "LoadingScreen")
+ m.parent.appendChild(loadingNode)
+ end if
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144019.xml b/.history/components/rowListScene_20211011144019.xml
new file mode 100644
index 0000000..3429aac
--- /dev/null
+++ b/.history/components/rowListScene_20211011144019.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144025.xml b/.history/components/rowListScene_20211011144025.xml
new file mode 100644
index 0000000..3429aac
--- /dev/null
+++ b/.history/components/rowListScene_20211011144025.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144115.xml b/.history/components/rowListScene_20211011144115.xml
new file mode 100644
index 0000000..cdd7e9d
--- /dev/null
+++ b/.history/components/rowListScene_20211011144115.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144141.xml b/.history/components/rowListScene_20211011144141.xml
new file mode 100644
index 0000000..f99d4ae
--- /dev/null
+++ b/.history/components/rowListScene_20211011144141.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144330.xml b/.history/components/rowListScene_20211011144330.xml
new file mode 100644
index 0000000..2af1ee5
--- /dev/null
+++ b/.history/components/rowListScene_20211011144330.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144343.brs b/.history/components/rowListScene_20211011144343.brs
new file mode 100644
index 0000000..635bf9b
--- /dev/null
+++ b/.history/components/rowListScene_20211011144343.brs
@@ -0,0 +1,36 @@
+sub init()
+ m.parent = m.findNode("mainParent")
+ ' m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
+ ' m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+ store = CreateObject("roSGNode", "ChannelStore")
+ ' Request several properties for sign-up
+ store.requestedUserData = "email, phone, firstname, lastname"
+ store.command = "getUserData"
+ ?store.userData.firstName
+end sub
+
+sub libraryLoaded()
+ if (m.SampleComponentLib.loadStatus = "ready")
+ loadingNode = createObject("roSGNode", "LoadingScreen")
+ m.parent.appendChild(loadingNode)
+ end if
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144638.brs b/.history/components/rowListScene_20211011144638.brs
new file mode 100644
index 0000000..b42b3ad
--- /dev/null
+++ b/.history/components/rowListScene_20211011144638.brs
@@ -0,0 +1,36 @@
+sub init()
+ m.parent = m.findNode("mainParent")
+ m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
+ m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+ store = CreateObject("roSGNode", "ChannelStore")
+ ' Request several properties for sign-up
+ store.requestedUserData = "email, phone, firstname, lastname"
+ store.command = "getUserData"
+ ?store.userData.firstName
+end sub
+
+sub libraryLoaded()
+ if (m.SampleComponentLib.loadStatus = "ready")
+ loadingNode = createObject("roSGNode", "LoadingScreen")
+ m.parent.appendChild(loadingNode)
+ end if
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144659.brs b/.history/components/rowListScene_20211011144659.brs
new file mode 100644
index 0000000..0b64153
--- /dev/null
+++ b/.history/components/rowListScene_20211011144659.brs
@@ -0,0 +1,34 @@
+sub init()
+ m.parent = m.findNode("mainParent")
+ m.MultiStyleLabel.drawingStyles = {
+
+ "HandprintedRed": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#FF0000FF"
+ }
+ "HandprintedGreen": {
+ "fontSize": 36
+ "fontUri": "pkg:/fonts/vSHandprinted.otf"
+ "color": "#00FF00FF"
+ }
+ "default": {
+ "fontSize": 36
+ "fontUri": "font:LargeSystemFont"
+ "color": "#000000FF"
+ }
+ }
+ m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
+ store = CreateObject("roSGNode", "ChannelStore")
+ ' Request several properties for sign-up
+ store.requestedUserData = "email, phone, firstname, lastname"
+ store.command = "getUserData"
+ ?store.userData.firstName
+end sub
+
+sub libraryLoaded()
+ if (m.SampleComponentLib.loadStatus = "ready")
+ loadingNode = createObject("roSGNode", "LoadingScreen")
+ m.parent.appendChild(loadingNode)
+ end if
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144718.brs b/.history/components/rowListScene_20211011144718.brs
new file mode 100644
index 0000000..10b5815
--- /dev/null
+++ b/.history/components/rowListScene_20211011144718.brs
@@ -0,0 +1,14 @@
+sub init()
+ m.parent = m.findNode("mainParent")
+ store = CreateObject("roSGNode", "ChannelStore")
+ store.requestedUserData = "email, phone, firstname, lastname"
+ store.command = "getUserData"
+ ?store.userData.firstName
+end sub
+
+sub libraryLoaded()
+ if (m.SampleComponentLib.loadStatus = "ready")
+ loadingNode = createObject("roSGNode", "LoadingScreen")
+ m.parent.appendChild(loadingNode)
+ end if
+end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011151753.xml b/.history/components/rowListScene_20211011151753.xml
new file mode 100644
index 0000000..220c1a1
--- /dev/null
+++ b/.history/components/rowListScene_20211011151753.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011151755.xml b/.history/components/rowListScene_20211011151755.xml
new file mode 100644
index 0000000..220c1a1
--- /dev/null
+++ b/.history/components/rowListScene_20211011151755.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011151829.brs b/.history/components/rowListScene_20211011151829.brs
new file mode 100644
index 0000000..5d4ab88
--- /dev/null
+++ b/.history/components/rowListScene_20211011151829.brs
@@ -0,0 +1,8 @@
+sub init()
+ m.parent = m.findNode("mainParent")
+ store = CreateObject("roSGNode", "ChannelStore")
+ store.requestedUserData = "email, phone, firstname, lastname"
+ store.command = "getUserData"
+ ?store.userData.firstName
+end sub
+
diff --git a/.history/components/rowListScene_20211011151922.xml b/.history/components/rowListScene_20211011151922.xml
new file mode 100644
index 0000000..92419da
--- /dev/null
+++ b/.history/components/rowListScene_20211011151922.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011152047.xml b/.history/components/rowListScene_20211011152047.xml
new file mode 100644
index 0000000..57e58b4
--- /dev/null
+++ b/.history/components/rowListScene_20211011152047.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011152054.xml b/.history/components/rowListScene_20211011152054.xml
new file mode 100644
index 0000000..5c1d28d
--- /dev/null
+++ b/.history/components/rowListScene_20211011152054.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011152249.xml b/.history/components/rowListScene_20211011152249.xml
new file mode 100644
index 0000000..6b36ffd
--- /dev/null
+++ b/.history/components/rowListScene_20211011152249.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011152637.xml b/.history/components/rowListScene_20211011152637.xml
new file mode 100644
index 0000000..df51351
--- /dev/null
+++ b/.history/components/rowListScene_20211011152637.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011152704.xml b/.history/components/rowListScene_20211011152704.xml
new file mode 100644
index 0000000..5ac204f
--- /dev/null
+++ b/.history/components/rowListScene_20211011152704.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011152741.brs b/.history/components/rowListScene_20211011152741.brs
new file mode 100644
index 0000000..5d4ab88
--- /dev/null
+++ b/.history/components/rowListScene_20211011152741.brs
@@ -0,0 +1,8 @@
+sub init()
+ m.parent = m.findNode("mainParent")
+ store = CreateObject("roSGNode", "ChannelStore")
+ store.requestedUserData = "email, phone, firstname, lastname"
+ store.command = "getUserData"
+ ?store.userData.firstName
+end sub
+
diff --git a/.history/components/rowListScene_20211011152745.brs b/.history/components/rowListScene_20211011152745.brs
new file mode 100644
index 0000000..cfb30e7
--- /dev/null
+++ b/.history/components/rowListScene_20211011152745.brs
@@ -0,0 +1,8 @@
+sub init()
+ m.parent = m.top.findNode("mainParent")
+ store = CreateObject("roSGNode", "ChannelStore")
+ store.requestedUserData = "email, phone, firstname, lastname"
+ store.command = "getUserData"
+ ?store.userData.firstName
+end sub
+
diff --git a/.history/components/rowListScene_20211011152820.brs b/.history/components/rowListScene_20211011152820.brs
new file mode 100644
index 0000000..9c16237
--- /dev/null
+++ b/.history/components/rowListScene_20211011152820.brs
@@ -0,0 +1,7 @@
+sub init()
+ m.parent = m.top.findNode("mainParent")
+ store = CreateObject("roSGNode", "ChannelStore")
+ store.requestedUserData = "email, phone, firstname, lastname"
+ store.command = "getUserData"
+end sub
+
diff --git a/.history/components/rowListScene_20211011154834.xml b/.history/components/rowListScene_20211011154834.xml
new file mode 100644
index 0000000..b33916d
--- /dev/null
+++ b/.history/components/rowListScene_20211011154834.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011154858.xml b/.history/components/rowListScene_20211011154858.xml
new file mode 100644
index 0000000..81faa1e
--- /dev/null
+++ b/.history/components/rowListScene_20211011154858.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011160212.xml b/.history/components/rowListScene_20211011160212.xml
new file mode 100644
index 0000000..83524bf
--- /dev/null
+++ b/.history/components/rowListScene_20211011160212.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011160214.xml b/.history/components/rowListScene_20211011160214.xml
new file mode 100644
index 0000000..81faa1e
--- /dev/null
+++ b/.history/components/rowListScene_20211011160214.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011160217.xml b/.history/components/rowListScene_20211011160217.xml
new file mode 100644
index 0000000..81faa1e
--- /dev/null
+++ b/.history/components/rowListScene_20211011160217.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011160729.xml b/.history/components/rowListScene_20211011160729.xml
new file mode 100644
index 0000000..81faa1e
--- /dev/null
+++ b/.history/components/rowListScene_20211011160729.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011160824.xml b/.history/components/rowListScene_20211011160824.xml
new file mode 100644
index 0000000..496e85b
--- /dev/null
+++ b/.history/components/rowListScene_20211011160824.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161430.xml b/.history/components/rowListScene_20211011161430.xml
new file mode 100644
index 0000000..68e9101
--- /dev/null
+++ b/.history/components/rowListScene_20211011161430.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161441.brs b/.history/components/rowListScene_20211011161441.brs
new file mode 100644
index 0000000..3e621a4
--- /dev/null
+++ b/.history/components/rowListScene_20211011161441.brs
@@ -0,0 +1,5 @@
+sub init()
+ m.parent = m.top.findNode("mainParent")
+
+end sub
+
diff --git a/.history/components/rowListScene_20211011161505.xml b/.history/components/rowListScene_20211011161505.xml
new file mode 100644
index 0000000..c3c00f4
--- /dev/null
+++ b/.history/components/rowListScene_20211011161505.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161514.xml b/.history/components/rowListScene_20211011161514.xml
new file mode 100644
index 0000000..9fc012f
--- /dev/null
+++ b/.history/components/rowListScene_20211011161514.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161556.xml b/.history/components/rowListScene_20211011161556.xml
new file mode 100644
index 0000000..c3c00f4
--- /dev/null
+++ b/.history/components/rowListScene_20211011161556.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161820.brs b/.history/components/rowListScene_20211011161820.brs
new file mode 100644
index 0000000..3e621a4
--- /dev/null
+++ b/.history/components/rowListScene_20211011161820.brs
@@ -0,0 +1,5 @@
+sub init()
+ m.parent = m.top.findNode("mainParent")
+
+end sub
+
diff --git a/.history/components/rowListScene_20211011161851.xml b/.history/components/rowListScene_20211011161851.xml
new file mode 100644
index 0000000..0589501
--- /dev/null
+++ b/.history/components/rowListScene_20211011161851.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161853.xml b/.history/components/rowListScene_20211011161853.xml
new file mode 100644
index 0000000..76eba79
--- /dev/null
+++ b/.history/components/rowListScene_20211011161853.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161900.xml b/.history/components/rowListScene_20211011161900.xml
new file mode 100644
index 0000000..ffd6080
--- /dev/null
+++ b/.history/components/rowListScene_20211011161900.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161906.xml b/.history/components/rowListScene_20211011161906.xml
new file mode 100644
index 0000000..def8674
--- /dev/null
+++ b/.history/components/rowListScene_20211011161906.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161926.xml b/.history/components/rowListScene_20211011161926.xml
new file mode 100644
index 0000000..b263adc
--- /dev/null
+++ b/.history/components/rowListScene_20211011161926.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011163824.xml b/.history/components/rowListScene_20211011163824.xml
new file mode 100644
index 0000000..f39fe0c
--- /dev/null
+++ b/.history/components/rowListScene_20211011163824.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011163856.xml b/.history/components/rowListScene_20211011163856.xml
new file mode 100644
index 0000000..ed5fc50
--- /dev/null
+++ b/.history/components/rowListScene_20211011163856.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011163858.xml b/.history/components/rowListScene_20211011163858.xml
new file mode 100644
index 0000000..0a43fbf
--- /dev/null
+++ b/.history/components/rowListScene_20211011163858.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011163948.xml b/.history/components/rowListScene_20211011163948.xml
new file mode 100644
index 0000000..0a43fbf
--- /dev/null
+++ b/.history/components/rowListScene_20211011163948.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011163950.xml b/.history/components/rowListScene_20211011163950.xml
new file mode 100644
index 0000000..8d8fce4
--- /dev/null
+++ b/.history/components/rowListScene_20211011163950.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030439.xml b/.history/components/rowListScene_20211012030439.xml
new file mode 100644
index 0000000..6a0c426
--- /dev/null
+++ b/.history/components/rowListScene_20211012030439.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030442.xml b/.history/components/rowListScene_20211012030442.xml
new file mode 100644
index 0000000..d824ea1
--- /dev/null
+++ b/.history/components/rowListScene_20211012030442.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030443.xml b/.history/components/rowListScene_20211012030443.xml
new file mode 100644
index 0000000..6a0c426
--- /dev/null
+++ b/.history/components/rowListScene_20211012030443.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030617.xml b/.history/components/rowListScene_20211012030617.xml
new file mode 100644
index 0000000..4385cd5
--- /dev/null
+++ b/.history/components/rowListScene_20211012030617.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030618.xml b/.history/components/rowListScene_20211012030618.xml
new file mode 100644
index 0000000..4385cd5
--- /dev/null
+++ b/.history/components/rowListScene_20211012030618.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030641.xml b/.history/components/rowListScene_20211012030641.xml
new file mode 100644
index 0000000..699d1fa
--- /dev/null
+++ b/.history/components/rowListScene_20211012030641.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030736.xml b/.history/components/rowListScene_20211012030736.xml
new file mode 100644
index 0000000..86a6e2f
--- /dev/null
+++ b/.history/components/rowListScene_20211012030736.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030753.xml b/.history/components/rowListScene_20211012030753.xml
new file mode 100644
index 0000000..1b7fed2
--- /dev/null
+++ b/.history/components/rowListScene_20211012030753.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030805.brs b/.history/components/rowListScene_20211012030805.brs
new file mode 100644
index 0000000..6705e78
--- /dev/null
+++ b/.history/components/rowListScene_20211012030805.brs
@@ -0,0 +1,5 @@
+sub init()
+ m.parent = m.top.findNode("mainParent")
+ m.panel = m.top.findNode("mainPanel")
+end sub
+
diff --git a/.history/components/rowListScene_20211012030811.brs b/.history/components/rowListScene_20211012030811.brs
new file mode 100644
index 0000000..222d149
--- /dev/null
+++ b/.history/components/rowListScene_20211012030811.brs
@@ -0,0 +1,6 @@
+sub init()
+ m.parent = m.top.findNode("mainParent")
+ m.panel = m.top.findNode("mainPanel")
+ m.panel.setFocus(true)
+end sub
+
diff --git a/.history/components/rowListScene_20211012031004.xml b/.history/components/rowListScene_20211012031004.xml
new file mode 100644
index 0000000..d64b778
--- /dev/null
+++ b/.history/components/rowListScene_20211012031004.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012031006.xml b/.history/components/rowListScene_20211012031006.xml
new file mode 100644
index 0000000..d4c0078
--- /dev/null
+++ b/.history/components/rowListScene_20211012031006.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012031011.xml b/.history/components/rowListScene_20211012031011.xml
new file mode 100644
index 0000000..ba5b065
--- /dev/null
+++ b/.history/components/rowListScene_20211012031011.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012031223.brs b/.history/components/rowListScene_20211012031223.brs
new file mode 100644
index 0000000..8b4f6d8
--- /dev/null
+++ b/.history/components/rowListScene_20211012031223.brs
@@ -0,0 +1,4 @@
+sub init()
+ m.parent = m.top.findNode("mainParent")
+end sub
+
diff --git a/.history/components/rowListScene_20211012031226.brs b/.history/components/rowListScene_20211012031226.brs
new file mode 100644
index 0000000..5824ab1
--- /dev/null
+++ b/.history/components/rowListScene_20211012031226.brs
@@ -0,0 +1,5 @@
+sub init()
+ m.parent = m.top.findNode("mainParent")
+ end su
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012031230.brs b/.history/components/rowListScene_20211012031230.brs
new file mode 100644
index 0000000..5824ab1
--- /dev/null
+++ b/.history/components/rowListScene_20211012031230.brs
@@ -0,0 +1,5 @@
+sub init()
+ m.parent = m.top.findNode("mainParent")
+ end su
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012031231.brs b/.history/components/rowListScene_20211012031231.brs
new file mode 100644
index 0000000..8b4f6d8
--- /dev/null
+++ b/.history/components/rowListScene_20211012031231.brs
@@ -0,0 +1,4 @@
+sub init()
+ m.parent = m.top.findNode("mainParent")
+end sub
+
diff --git a/.history/components/rowListScene_20211012031235.brs b/.history/components/rowListScene_20211012031235.brs
new file mode 100644
index 0000000..8b4f6d8
--- /dev/null
+++ b/.history/components/rowListScene_20211012031235.brs
@@ -0,0 +1,4 @@
+sub init()
+ m.parent = m.top.findNode("mainParent")
+end sub
+
diff --git a/.history/components/rowListScene_20211012031408.xml b/.history/components/rowListScene_20211012031408.xml
new file mode 100644
index 0000000..81da3d0
--- /dev/null
+++ b/.history/components/rowListScene_20211012031408.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012032157.xml b/.history/components/rowListScene_20211012032157.xml
new file mode 100644
index 0000000..6f44653
--- /dev/null
+++ b/.history/components/rowListScene_20211012032157.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012122112.xml b/.history/components/rowListScene_20211012122112.xml
new file mode 100644
index 0000000..25a90c1
--- /dev/null
+++ b/.history/components/rowListScene_20211012122112.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012122632.xml b/.history/components/rowListScene_20211012122632.xml
new file mode 100644
index 0000000..9001369
--- /dev/null
+++ b/.history/components/rowListScene_20211012122632.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012122658.xml b/.history/components/rowListScene_20211012122658.xml
new file mode 100644
index 0000000..2e35df3
--- /dev/null
+++ b/.history/components/rowListScene_20211012122658.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012122713.xml b/.history/components/rowListScene_20211012122713.xml
new file mode 100644
index 0000000..54a1aaf
--- /dev/null
+++ b/.history/components/rowListScene_20211012122713.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012122732.xml b/.history/components/rowListScene_20211012122732.xml
new file mode 100644
index 0000000..2d5647c
--- /dev/null
+++ b/.history/components/rowListScene_20211012122732.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105704.xml b/.history/components/trickplay/trickplay_20211013105704.xml
new file mode 100644
index 0000000..e69de29
diff --git a/.history/components/trickplay/trickplay_20211013105742.xml b/.history/components/trickplay/trickplay_20211013105742.xml
new file mode 100644
index 0000000..3891769
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013105742.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105805.xml b/.history/components/trickplay/trickplay_20211013105805.xml
new file mode 100644
index 0000000..5f27bbc
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013105805.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105810.xml b/.history/components/trickplay/trickplay_20211013105810.xml
new file mode 100644
index 0000000..1ac4fde
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013105810.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105834.xml b/.history/components/trickplay/trickplay_20211013105834.xml
new file mode 100644
index 0000000..8d55c64
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013105834.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105854.xml b/.history/components/trickplay/trickplay_20211013105854.xml
new file mode 100644
index 0000000..38bd81b
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013105854.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105904.xml b/.history/components/trickplay/trickplay_20211013105904.xml
new file mode 100644
index 0000000..71d624c
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013105904.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105925.xml b/.history/components/trickplay/trickplay_20211013105925.xml
new file mode 100644
index 0000000..3557c27
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013105925.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105928.xml b/.history/components/trickplay/trickplay_20211013105928.xml
new file mode 100644
index 0000000..69a80a1
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013105928.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105940.xml b/.history/components/trickplay/trickplay_20211013105940.xml
new file mode 100644
index 0000000..f4fa32c
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013105940.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105959.xml b/.history/components/trickplay/trickplay_20211013105959.xml
new file mode 100644
index 0000000..afb601d
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013105959.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110019.xml b/.history/components/trickplay/trickplay_20211013110019.xml
new file mode 100644
index 0000000..37c4db2
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013110019.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110037.xml b/.history/components/trickplay/trickplay_20211013110037.xml
new file mode 100644
index 0000000..7d639ab
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013110037.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110049.xml b/.history/components/trickplay/trickplay_20211013110049.xml
new file mode 100644
index 0000000..382cfa6
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013110049.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110104.xml b/.history/components/trickplay/trickplay_20211013110104.xml
new file mode 100644
index 0000000..adcba51
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013110104.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110225.xml b/.history/components/trickplay/trickplay_20211013110225.xml
new file mode 100644
index 0000000..30f06c1
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013110225.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110317.xml b/.history/components/trickplay/trickplay_20211013110317.xml
new file mode 100644
index 0000000..8d9236e
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013110317.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110331.xml b/.history/components/trickplay/trickplay_20211013110331.xml
new file mode 100644
index 0000000..f97b4ee
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013110331.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110335.xml b/.history/components/trickplay/trickplay_20211013110335.xml
new file mode 100644
index 0000000..b7264a9
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013110335.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110343.xml b/.history/components/trickplay/trickplay_20211013110343.xml
new file mode 100644
index 0000000..7415aba
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013110343.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110709.xml b/.history/components/trickplay/trickplay_20211013110709.xml
new file mode 100644
index 0000000..542e079
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013110709.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110830.xml b/.history/components/trickplay/trickplay_20211013110830.xml
new file mode 100644
index 0000000..4cdd261
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013110830.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110853.xml b/.history/components/trickplay/trickplay_20211013110853.xml
new file mode 100644
index 0000000..a7bd992
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013110853.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110857.xml b/.history/components/trickplay/trickplay_20211013110857.xml
new file mode 100644
index 0000000..a7bd992
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013110857.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110936.xml b/.history/components/trickplay/trickplay_20211013110936.xml
new file mode 100644
index 0000000..2ffb00d
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013110936.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111004.xml b/.history/components/trickplay/trickplay_20211013111004.xml
new file mode 100644
index 0000000..d82a426
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013111004.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111014.xml b/.history/components/trickplay/trickplay_20211013111014.xml
new file mode 100644
index 0000000..168065e
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013111014.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111030.xml b/.history/components/trickplay/trickplay_20211013111030.xml
new file mode 100644
index 0000000..0ed0e4d
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013111030.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111143.xml b/.history/components/trickplay/trickplay_20211013111143.xml
new file mode 100644
index 0000000..509771e
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013111143.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111202.xml b/.history/components/trickplay/trickplay_20211013111202.xml
new file mode 100644
index 0000000..3b1a34e
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013111202.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111214.xml b/.history/components/trickplay/trickplay_20211013111214.xml
new file mode 100644
index 0000000..29373b7
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013111214.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111237.xml b/.history/components/trickplay/trickplay_20211013111237.xml
new file mode 100644
index 0000000..b3939d0
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013111237.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111254.xml b/.history/components/trickplay/trickplay_20211013111254.xml
new file mode 100644
index 0000000..d3f6d70
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013111254.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111726.xml b/.history/components/trickplay/trickplay_20211013111726.xml
new file mode 100644
index 0000000..d3f6d70
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013111726.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111834.xml b/.history/components/trickplay/trickplay_20211013111834.xml
new file mode 100644
index 0000000..a7c3ae1
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013111834.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111845.xml b/.history/components/trickplay/trickplay_20211013111845.xml
new file mode 100644
index 0000000..39e985e
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013111845.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111942.xml b/.history/components/trickplay/trickplay_20211013111942.xml
new file mode 100644
index 0000000..6081f94
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013111942.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013112043.xml b/.history/components/trickplay/trickplay_20211013112043.xml
new file mode 100644
index 0000000..4bd0a4d
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013112043.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013113737.xml b/.history/components/trickplay/trickplay_20211013113737.xml
new file mode 100644
index 0000000..1f15d3f
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013113737.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013113755.xml b/.history/components/trickplay/trickplay_20211013113755.xml
new file mode 100644
index 0000000..76c03ae
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013113755.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013113757.xml b/.history/components/trickplay/trickplay_20211013113757.xml
new file mode 100644
index 0000000..1f15d3f
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013113757.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013114712.xml b/.history/components/trickplay/trickplay_20211013114712.xml
new file mode 100644
index 0000000..a1100dc
--- /dev/null
+++ b/.history/components/trickplay/trickplay_20211013114712.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/keyboardScene.brs b/components/keyboardScene.brs
index ff84590..4e3a8bc 100644
--- a/components/keyboardScene.brs
+++ b/components/keyboardScene.brs
@@ -17,11 +17,13 @@ sub handleText()
end sub
sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
+ handleVideoPlaybackResponse()
+
+ ' m.http.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
+ ' m.http.control = "RUN"
end sub
sub useResponse()
@@ -55,7 +57,8 @@ sub handleHeading()
end sub
sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
+ ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
+ ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
end sub
function onKeyEvent(key as String, press as Boolean) as Boolean
@@ -71,23 +74,54 @@ function onKeyEvent(key as String, press as Boolean) as Boolean
end function
sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
+ ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
+ ' m.videoPlaybackTask.request = { payload: {
+ ' userId: 1,
+ ' title: "WOW, IT WORKED ^_^",
+ ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
+ ' m.videoPlaybackTask.control = "RUN"
+ ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
end sub
sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
+ ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
+ ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ ' YouTube API Limit Exceeded
+ ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
+ videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
videoContent.streamformat = "mp4"
m.video.content = videoContent
m.video.visible = true
+ m.video.seekMode = "accurate"
+ m.video.trickPlayBar.textColor = "0xFFFFFFFF"
+ m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.trickPlayBar.trackBlendColor = "0x333333FF"
+ m.video.trickPlayBar.thumbBlendColor = "0x00000000"
+ ' Hides the black background in the scrubber
+ m.video.trickPlayBar.getParent().getChild(1).opacity = 0
+ ' Update percentage on loading bar
+ m.video.bufferingBar.observeField("percentage", "updatePercentage")
+ m.video.trickPlayBar.getParent().getChild(2).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(3).opacity = 0
+ m.video.trickPlayBar.getParent().getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(0).height = 8
+ m.video.trickPlayBar.getChild(1).height = 8
+ m.video.trickPlayBar.getChild(2).opacity = 0
+ m.video.trickPlayBar.getChild(3).opacity = 0
+ m.video.trickPlayBar.getChild(4).opacity = 0
+ m.video.trickPlayBar.getChild(5).opacity = 0
+ m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
+ m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
+ m.video.bufferingBar.trackBlendColor = "0x333333FF"
+ m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
+ m.video.setFocus(true)
m.video.control = "play"
end sub
+sub updatePercentage()
+ m.video.bufferingBar.height = 8
+ ?m.video.position
+ m.video.trickPlayBar.getParent().getChild(8).text = m.video.bufferingBar.percentage.toStr() + "%"
+end sub
\ No newline at end of file
diff --git a/components/rowListContent.xml b/components/rowListContent.xml
index 28e7d8e..f70ce16 100644
--- a/components/rowListContent.xml
+++ b/components/rowListContent.xml
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/components/rowListItem.xml b/components/rowListItem.xml
index 65e51b9..897af09 100644
--- a/components/rowListItem.xml
+++ b/components/rowListItem.xml
@@ -5,7 +5,7 @@
-
+
diff --git a/images/white.jpg b/images/white.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..746d65d2a809b9a637827a9f0a67f75d1278b441
GIT binary patch
literal 14488
zcmeHOYg7~07M__TkOYwsFd(Iv@G?T6L4m6@AOuq>SPfPM1U13dQlwWcRkX!xfM}41
zMr9$br~xbTl7d)#Axj=As1RDLMQv>WAGJO}uqtZhPJo1v3}L4CF6$3sSUG2(@7w#^
zd*+-u@vQW<_9*~L;Ct`C2Y?_51i=4*zUzQLV1OqW5by>D1Or1u10tD1CX+~H^YJF*
zC>G|HmKNqTn$_D5ldRsdv!>DLEV`ZJa_T;DZd91a8^3XTE*
z;2$DQ-dKCA0%H{ztH4+V#wzd+RX_?H#Txm2V$sJUtSpi#P|l5FVvI$yKa!V0z(@ii
z2UJNB$r_G9FxWOxG`c=}z(s=vBmz*1W*@Ol0?5O1Kt;+V+Z*|++(Eu@z0uIby%BZFgH?+0>l$izIY
z0QknmzK;E^K=ZMSdm}H+>lX!rzJDhuSA>#9F&_ZJpVazXv@ErAh=plyGQgu_=YRlq
z4*m#$ln@EjTb#uHJ(oJc!G=AccOOe+AngdWHmF)Y;WeKr)3U)`Df~BVUppLv=VkI`
z!%c9HV#_3RX?#7r9Zm_pIy5Or28pbSFmAKXkjg*;hPJ*cn>_&WUB13D@tBuOCV%8_
zAN@OJ6=(311pmjIQ{?SCi<@$q$s2`;G9n^+B
zsXJYxn*Ll--oh&r1mOcBT0*=IqW=bF>MGphk$oq4+GhdBysg3lWpu~2UoV<}wFq(P
zLe6Vv5XpnpSaIp-ZZF3SS}==R6PR|_?^D%27MY}JCDCmQ7bfRAU6uh`nIe#jzJ5{w
zQm#etR+)ghYO2V@Bj%7u)j|1*hY+6wYPJKymqic|6B1jQGBrrM5$FIQ(C|kn0EFdM
zQo6<4vVbtmTX}pg5h%>i(tv}{KFle@4?X}u0Uvx2;o}gH0BvNz2rE+n!VNnf0R@n$
zlyRmX2an7IA4@a%$&_ttudz(+>bz=yQ=X}qf&gw<89;$_fC4Eg*QQrniS))dm^l#N
z2380u6{v-R0L64QT~Nwy7OAw(WW03m@ZVpZCvkVX+q>VgXYT%#!l>E)Cnu&cn?Ey;
za&!-tW!1o+Y_YqUWeufyPSgQE&kg>!KS_|qPMa1cX2>kI65|8k-D5+b9N6`1_$qUX
zq+SyHY4IGs?=#N$2U}C>+%q|jeSqp%s6RVOkDN319;?7u1@u**$z9(l(hTaZ#XhY}
zFjF2Og~lp%4F85zfc+Zul)ssG&Lz8LScN6r$4cog-~AQFC|z#eSTD-AGkzJJ(&VX$
z`F4B7i&2G%e%7QM=%{KLjiO-xs!1vDtkUcvwxQ~mD*JR3Ij3WE3cKA_Z0|Vs$^n
zT!fxggOm=`)#zR|5YhF;U}H$YNP@2pB5huDjt*8jIbT^YfV|+-3wKexyX7VDWbEfw
z-9v#_BEPFtEnHQq#%QtTsQ^u*E);{v11QD3CYZ-4#Z)J#)^kynvf47dQLRH6b!K(z
zP)1QD=isnYOtDi=$VW+5S7*^{p`g8`HN+rOF6m1!R)ao}DZDH^!eja#!77(?%1rb{
z(Wqg+=O*PMuR!}u?5EVjyGNW+zOyLMo-iPLj|)3cq^Gs|2Lc-YYS_`xnEe#<$#B-%1`J;V+8IUnDxeCAGX8}S@CQ6d|SxJz5BXd#0#bVhsX@w${R{FrtL%nhIUCAqO_eKYLBEu%MPKK@>-PU*;u16
zbM&M+!VnJG&Q6P~>_L1AjI%-B1&LZGl~NrR6tbwul<^sYEqXE#RPe0MA{VfSTsbIh-8W05H;opP|zCgf~FQCvFZoaEUvQqVN
z2;~($&X^?GXq+IcG!WmEUk9I0S?^UPM?=KtOz}ud?s|k9WUa3nZOnE-S7x==$RbnJTUeLE{Dqq)w?tkF&~
zV=m*ixX0x>xmMb8mg{A?ZkzdS3iEd!%?d{>d&!+~Ll6|y2QX)JWp0n`{;P9*YV##A
z(e#Pfi|Ehh8Xs&wh0EWvMC{Q1B!TN5NRb~sTJiCpKl~BI|6%+)a4zq_2VwvY{s9r3
zj;hEMQvt)xj~~36&h`~1tP$-f>ypZHs!PxOpg#P8^YW**EEBdG2|Y|Zgs1T?;__u(
z$uIAFzGd=zw9A%WTFoaR1-QlIolV+0%^H@9A@LL2o1D%D^f;&5|uOd&FdSoN-;LPNbhM!IT
z4C=6Up-oL}Skt!PSXQ)M@Y-F8H+@)B;;khc1mcso8fp_4oUcp&$RYo<*ReAvQg%O2
zT%2<6~Fz%&ZN1TyaczrS@KFiP1gbQlHugTJ1VlpRX6n^Rm}0e6rXz{fT1X
z%EY^Fijbd*xmRy3c;#wHxa@SOzAE?mCua(aBhPLMN(+h3`{XZ+(8B%u4tEe1C{|v1
z|EHBt!T8-a>u5j3cuT%JF~@t$6K~JAmPq)|TEk+z_Ltr&GZI!lwAh&PGMr>*cCPyQ
z?C;~YPp($L-A7^Z-QP>(PHiF1yPp+aKk;kP{-s~sv#9^`wjhpH^Ze|h&b`Sw|E|vQ
zZ_nOnchl#SWT)TSoijF@q}(#v^%TD{La@Q@)|bf@ry>f73$MYo*k;2k&CjYZw&Z<&
zDr8f*Nx`<74QUroi+j`3JdI~ZT>a6=^DsomBdZ=OoLxR$l3~RAF)JT0&`7^EAa?
z!p8*R)Mzsc^M>2c{ERr+j-GR}_ICB)H>7|4+s$*~`zk!=eB&s+W=6}cix{^by7Vfx
zH!Wu00cqryWmDHZH(tN_%(IZ_rsd1y(%3c2chK@SF)0V8g?>QH+MFJ#`1O|Js;A?-
zw+;c^RQ6kr4-%F@#g^wvV+=Yke}0tLw)7f@*Cudlcc+M#hel3ny}CY@N=ukBmr7zp
zIn#4Q55
Gd-cCKYH*PN
literal 0
HcmV?d00001
From a4fdac405e9ff29bb65909e1a54b545125635858 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Wed, 13 Oct 2021 15:15:03 +0200
Subject: [PATCH 19/22] trying to handle the text for the elapsed and remaining
times
---
.gitignore | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.gitignore b/.gitignore
index fa001aa..f86df33 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
out/
out/roku-deploy.zip
+.history/
+.vscode/
\ No newline at end of file
From e51fe78844b401159595072d21baa2ec8bcf898c Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Sat, 16 Oct 2021 22:49:06 +0200
Subject: [PATCH 20/22] still in progress
---
components/keyboardScene.brs | 77 +++++++++------
components/trickplay/TrickPlay.brs | 146 +++++++++++++++++++++++++++++
components/trickplay/TrickPlay.xml | 45 +++++++++
images/blackback.png | Bin 0 -> 617 bytes
images/blackpause.png | Bin 0 -> 562 bytes
images/blackquote.png | Bin 0 -> 2276 bytes
images/blackright.png | Bin 0 -> 310 bytes
images/buttonbg.png | Bin 0 -> 2397 bytes
images/gradient.png | Bin 0 -> 14507 bytes
images/white2.jpg | Bin 0 -> 14488 bytes
images/whiteback.png | Bin 0 -> 732 bytes
images/whitepause.png | Bin 0 -> 592 bytes
images/whitequote.png | Bin 0 -> 3047 bytes
images/whiteright.png | Bin 0 -> 298 bytes
14 files changed, 241 insertions(+), 27 deletions(-)
create mode 100644 components/trickplay/TrickPlay.brs
create mode 100644 components/trickplay/TrickPlay.xml
create mode 100644 images/blackback.png
create mode 100644 images/blackpause.png
create mode 100644 images/blackquote.png
create mode 100644 images/blackright.png
create mode 100644 images/buttonbg.png
create mode 100644 images/gradient.png
create mode 100644 images/white2.jpg
create mode 100644 images/whiteback.png
create mode 100644 images/whitepause.png
create mode 100644 images/whitequote.png
create mode 100644 images/whiteright.png
diff --git a/components/keyboardScene.brs b/components/keyboardScene.brs
index 4e3a8bc..de23d61 100644
--- a/components/keyboardScene.brs
+++ b/components/keyboardScene.brs
@@ -62,7 +62,7 @@ sub handleItemSelected()
end sub
function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
+ if press and m.keyboard.visible = true
if key = "right" and not m.itemsList.hasFocus()
m.itemsList.setFocus(true)
return true
@@ -93,35 +93,58 @@ sub handleVideoPlaybackResponse()
videoContent.streamformat = "mp4"
m.video.content = videoContent
m.video.visible = true
+ m.video.enableUI = false
+ m.video.enableTrickPlay = false
+ m.video.createChild("TrickPlay")
+ m.keyboard.visible = false
m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
m.video.setFocus(true)
m.video.control = "play"
+ m.video.getChild(2).setFocus(true)
+ m.video.getChild(2).observeField("play", "handlePlay")
+ m.video.getChild(2).observeField("forward", "handleForward")
+ m.video.getChild(2).observeField("back", "handleBack")
+ m.video.getChild(2).observeField("cc", "handleCC")
+ m.video.observeField("state", "videoStarted")
+ m.video.observeField("position", "updatePosition")
+ m.video.observeField("bufferingStatus", "updateBuffering")
end sub
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.position
- m.video.trickPlayBar.getParent().getChild(8).text = m.video.bufferingBar.percentage.toStr() + "%"
+sub updateBuffering()
+ if m.video.bufferingStatus <> invalid
+ m.video.getChild(2).loadingData = { percentage: m.video.bufferingStatus.percentage, done: m.video.bufferingStatus.prebufferDone }
+ end if
+end sub
+
+sub updatePosition()
+ m.video.getChild(2).position = m.video.position
+end sub
+
+sub videoStarted()
+ m.video.getChild(2).duration = m.video.duration
+end sub
+
+sub handlePlay()
+ if m.video.control = "play" or m.video.control = "resume"
+ m.video.control = "pause"
+ else
+ m.video.control = "resume"
+ end if
+ if m.video.state = "finished"
+ m.video.control = "play"
+ end if
+end sub
+
+sub handleForward()
+ m.video.seek = m.video.position + 15
+ m.video.control = "resume"
+end sub
+
+sub handleBack()
+ m.video.seek = m.video.position - 15
+ m.video.control = "resume"
+end sub
+
+sub handleCC()
+
end sub
\ No newline at end of file
diff --git a/components/trickplay/TrickPlay.brs b/components/trickplay/TrickPlay.brs
new file mode 100644
index 0000000..f83a19e
--- /dev/null
+++ b/components/trickplay/TrickPlay.brs
@@ -0,0 +1,146 @@
+sub init()
+ initItems()
+ initObservers()
+end sub
+
+sub initItems()
+ m.main = m.top.findNode("main")
+ m.timer = m.top.findNode("animTimer")
+ m.mainParent = m.main.findNode("mainParent")
+ m.UIShow = m.main.findNode("UIShow")
+ m.UIHide = m.main.findNode("UIHide")
+ m.elapsedTime = m.mainParent.findNode("elapsedTime")
+ m.ScrubberFilled = m.mainParent.findNode("ScrubberFilled")
+ m.LoadingGroup = m.top.findNode("LoadingGroup")
+ m.loadingFilled = m.LoadingGroup.findNode("loadingFilled")
+ m.loadingPercent = m.LoadingGroup.findNode("loadingPercent")
+ m.totalTime = m.mainParent.findNode("totalTime")
+ m.bottomButtons = m.top.findNode("bottomButtons")
+ m.back15 = m.bottomButtons.findNode("back15")
+ m.playPause = m.bottomButtons.findNode("playPause")
+ m.forward15 = m.bottomButtons.findNode("forward15")
+ m.CC = m.bottomButtons.findNode("CC")
+end sub
+
+sub initObservers()
+ m.playPause.observeField("buttonSelected", "fireEvent")
+ m.back15.observeField("buttonSelected", "fireEvent")
+ m.forward15.observeField("buttonSelected", "fireEvent")
+ m.CC.observeField("buttonSelected", "fireEvent")
+ m.top.observeField("duration", "updateDuration")
+ m.top.observeField("position", "updatePosition")
+ m.top.observeField("loadingData", "updateLoading")
+ hideLoading()
+ focusOnFirstBtn()
+end sub
+
+sub hideLoading()
+ m.LoadingGroup.opacity = 0
+end sub
+
+sub updateDuration()
+ m.totalTime.text = handleTimeDisplay(m.top.duration)
+ m.fillingRatio = 700 / m.top.duration
+end sub
+
+sub focusOnFirstBtn()
+ m.back15.setFocus(true)
+end sub
+
+sub updateLoading()
+ m.loadingPercent.text = (m.top.loadingData.percentage).toStr() + "%"
+ m.loadingFilled.width = INT((m.top.loadingData.percentage) * 1.5)
+ m.LoadingGroup.opacity = 1
+ if (m.top.loadingData.percentage) = 100
+ m.LoadingGroup.opacity = 0
+ end if
+end sub
+
+sub updatePosition()
+ m.ScrubberFilled.width = m.top.position * m.fillingRatio
+ m.elapsedTime.text = handleTimeDisplay(m.top.position)
+end sub
+
+sub handleTimeDisplay(time as Integer) as String
+ minutes = INT(time / 60)
+ seconds = INT(time MOD 60)
+ if minutes < 10
+ minutesStr = "0"
+ else
+ secondsStr = ""
+ end if
+ if seconds < 10
+ secondsStr = "0"
+ else
+ secondsStr = ""
+ end if
+ return minutesStr + minutes.toStr() + ":" + secondsStr + seconds.toStr()
+end sub
+
+sub fireEvent(event)
+ if event.getNode() = "playPause"
+ m.top.play = not m.top.play
+ else if event.getNode() = "back15"
+ m.top.back = not m.top.back
+ else if event.getNode() = "forward15"
+ m.top.forward = not m.top.forward
+ else if event.getNode() = "CC"
+ m.top.CC = not m.top.CC
+ end if
+end sub
+
+sub showNav()
+ if m.main.opacity = 0
+ m.UIShow.control = "start"
+ else
+ m.timer.control = "start"
+ m.timer.observeField("fire", "hideUI")
+ end if
+end sub
+
+sub hideUI()
+ m.UIHide.control = "start"
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ showNav()
+ if key = "right" and m.back15.hasFocus()
+ m.playPause.setFocus(true)
+ m.back15.setFocus(false)
+ return true
+ else if key = "right" and m.playPause.hasFocus()
+ m.forward15.setFocus(true)
+ return true
+ else if key = "right" and m.forward15.hasFocus()
+ m.CC.setFocus(true)
+ return true
+ else if key = "right" and m.CC.hasFocus()
+ return false
+ else if key = "left" and m.CC.hasFocus()
+ m.forward15.setFocus(true)
+ return true
+ else if key = "left" and m.forward15.hasFocus()
+ m.playPause.setFocus(true)
+ return true
+ else if key = "left" and m.playPause.hasFocus()
+ m.back15.setFocus(true)
+ return true
+ else if key = "left" and m.back15.hasFocus()
+ return false
+ else if key = "left" and m.ScrubberFilled.hasFocus()
+ m.top.back = not m.top.back
+ return true
+ else if key = "right" and m.ScrubberFilled.hasFocus()
+ m.top.forward = not m.top.forward
+ return true
+ else if key = "up"
+ m.ScrubberFilled.setFocus(true)
+ return true
+ else if key = "down" and m.ScrubberFilled.hasFocus()
+ m.back15.setFocus(true)
+ return true
+ end if
+ end if
+ return false
+end function
\ No newline at end of file
diff --git a/components/trickplay/TrickPlay.xml b/components/trickplay/TrickPlay.xml
new file mode 100644
index 0000000..c5a431e
--- /dev/null
+++ b/components/trickplay/TrickPlay.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/images/blackback.png b/images/blackback.png
new file mode 100644
index 0000000000000000000000000000000000000000..d76671537e7b35853f2e1a747c483748238891c0
GIT binary patch
literal 617
zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGoY)RhkE)4%caKYZ?lNlJ8Bm^PCp+Eo64wdcGPUDcRubC#SPy7Tkz^jR}EZgJ4DKk=!V
zTw;GhVEg{R%`=O%tM;$I&UBk^&(d%DGnm|r3~!q`{SExWc4J!S&24iJSie%vIeR4M
zw%!BVt%7mP(Lnia(mxz>Tfz@K^EtEa?Lxal-U-2KX}7;I$*=7Fz;t5{yM9b)Ob&}n>y?FHlZ233$|
z@7k6^nT5j7f%=3a<^UbQeZ^gZJ2mH?>NEZSRXTSk>^QUk^nS53rXlMReinw$)cv1i
mar(k8#yS4&@c3i;!CFz%QPIILy%Lyq7(8A5T-G@yGywos+#Oc{
literal 0
HcmV?d00001
diff --git a/images/blackpause.png b/images/blackpause.png
new file mode 100644
index 0000000000000000000000000000000000000000..122ed5b6b77a5988a65f042df01cde419531772f
GIT binary patch
literal 562
zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGoY)RhkE)4%caKYZ?lNlHopL@DE
zhE&XXd&|%-+EJwSVSMH!Bd^R(UY8_Jkw^!xZ4;*H25f5GqSMf3sxYl#%9e>4i%S9$
zxUyBgB>g^nX7e~e>4BFZ3OBo{~rC0MFICbm9B!)F>c(-sIIJL`RHIO;=nber!33=DS6_BVC5ns8`qpJw*(YuMd${kEC&{Y~4r
zfHsCku}z4G@F{HE^zK6x;{oY4YYx{wdR@PdmG!f;#SBxEh<=7Y
z&TAY_GwkVFaY2hg|FM=X?}M|YzrUw>GK8IG%VOFPWfmgTaCKAj9fmd2=AO|#pLO%*
z9ihM1kDSYzwmW~#wALuyds&eykA7M^jaw&j&(%$hx1L7pN^gu}(~kUiVf(bb5xUKh
lsHieq6BZXLo>m^`y|>KPK7Ghq5|{`WJYD@<);T3K0RY5>_oDy+
literal 0
HcmV?d00001
diff --git a/images/blackquote.png b/images/blackquote.png
new file mode 100644
index 0000000000000000000000000000000000000000..88a9f82b3fdd92134af383dae02b394da03fab89
GIT binary patch
literal 2276
zcmVWpzIWlhZ)Wf9+nwFn_ilg5
zN0o%`D{P-vU3RsC&g^twK5j2LT5I2NY62$9XIVJ_0@jJ}9JS$9YsWTL9yM
zhk>O)Ys%?w;CbLYHa}?{lKp^bNE4HGB?P5)z+=F^36{HE(r&W40OtT#AQcjZHNa=U
zV&EsFFZdN{de$RGTvPaNPoz)jhBS2p+1&RG0Y(%4DVPUL1)c?(Lf%s~)B}?cgO>Z1
zE(ab5E&)as?scihDBx1y31CGCeSQQc0-YS{;gyqtg|uJj-++68F}SUOa?}Gy0QVJi
zXivulz=U8WjzT*4jRfmG6WGa#rrXkIzkWOEhy9H?xyl|sMp^d;~UkZ6(GWH?z^=T_I
z0rSb&fXpd68Ydwx9Q~x6o0bBHS`=6Z9GjK`8RR(3&VB>p1xS=#ft4!bCgA9#Gp+*0
zVooGiAkNK1Xh0TobbEPuQW;hu7h&3GE(s0$Z?$B0dlDH{Id@>%=_c2i?1%X{zD^bR
zay-xpcoVZ(AMGlGI>hx+oWb8zna49_cEDU~`4~q(;IlCw!Bboau5nJowA-0+g?2&0
zW{QQ*h%2-MF`H7`{e*-rMdlhMuo;Pw$_d9X%)a;PsKV-iMM~KH@pbHQOvQB9M_Qjh
zUI}Ufc66ho728@vdns*sQ5k^Pt~jr;Q3UCgzh@jN7(}gB2*7hHuZsKOzL;LjgB&Vo
zqn0b=5S7*k)_R51W4cp@>o3_1Jwjd2Lsr0Y;;{({B`QYS
z+FBtx#^@_o8s!+aG~&6!JRxa}usRC!)pe)}8KABgIa4P`+fv)wS|MAh>s8Lw$!S#A
z+SZ{eWVJJOap`9iv@MPKkF7%1tLv?u
zsZ%-I1$?gCVqfwqrEGU#tB|$o+UJIpQ30PX$%wp4iButfs_Q<^)Tx|f0zUsdBl0Rm
z+cH#z{GqNB3xzC0H-e*EKFNT*DD1ATwXLlcq9-rDPBpj?dz;^k?CtX{FABQJ)H8Q0
z7f|Yve9y5`Vc3@7b5CYvKweZ{S9yopzA-}Gw3c-D2zCbM5bP#D&a=Fz)MM@(2o+LQ
zhv~OJG#MQY8jy|qLB@OEv%EMQrt)4+1wZr`)Xh^9P*AfAVxS=7ZKSf5OV{$^a<|I=
z$x3cMSKYjn0MIo8E+1iFC)8_7l$z_|0W_#
zxTh;2GaV{uBglB~06j7wFAn+;o)@DCITEulVGkXPg3Wj{kRt%IATKIAV+LGD-VFL7
zW`UBTIG_K38;IAexRw`{N0crLiQz#XtAw=x`^VSON}K$dxY_dHT3!@JVTR;h7FXz8
zCGbmRBadsI$L)zhuH{AH4N7hI9Wqgk#ZgLVD{xy}p&fukw*o$+1UDmRNafhs5!o19
zY_oS=X0Q#iPNF*}V@)`Rdc^p}wpvdDhn$^^`3TM-8wXfs3GE_jCBY+`9=BxnKvJ1i
zA(Juf^A-sXx3@qJve%j3kW_|M#EF5MbXIAro!Y>$7Dw>zZ5
z9+;bYS`jyW%^b-ck~1-P*>1waX%~khQH{D%o}#wTTP$V@<^iBB$XS$L*cVy((v|WJ
zmdz+NL=WVx3A)@Zz*Qdg0%Tj(ADGIm0nYNMS5gea{&In4Qaop|9D^~p{kEmYsEr9^
zXW(Ycg}YWH;BCA=)$DXf-pOIBlwUmR<$?o{?P#{LEdX}&r&@U~LWX?BO0V;(QFMj_
zFJnI}x)oVfO?&k*5(iVN_%grhRLlq@DkSKw2+OFl{!s_pE%d8SD7qkX3hfxQ4eR@Q
z(lIiVC@sWnzv=|i6^UF7^UA(YkT`>?A{qh|IcE*-4f}CUwZ!f&+^_I|fu=2zwoLPkP+BHI$e@HXo8NW|qo6p3o@k8Hx}Sx9Yt
z;eUm+3UP7#iuw9(y@#@9=?45x>96tDfbR}M0@!T7;2G3l)8T_Dlp1z5=C0Enkk_1Q
z*GgNum)dxvn|JzQ?z+0O@V^FRiE}!3PiZUC#7sA3TEkT|3l_91I~=~Lih90VQbm`o#FCH#p@zV`8>X7v!Kxi}Tss?|ml
yvJkZr8UO!)JPjWq6TH?KdFABf?T#`O;`GN-vXLZfk__WmzyOY2n?U>@)_;48pVT&)hxAaE3T8#n@7YBxc&jkVsTF9PlZRslD~
zwP*svz%gJSuvbJbM7F0c3M~L%(`N%4a0NdvracWX4D`v#S%!e$06!CvbFqzyDgfWc_W@ghWif4uz*XRB;3*Ng63d8a0#ManU>oo)Ac=_@ETV5^>R1xH&yM+`$4&S09Bm@ybP?&
z^En;N5by+U5Gj`jh=J>
zr}+xz`issG@C6b1dp$pH!~@)o%iJ}J%~aqyRjtcQ*ChZ|oeAuy_xDD076IR_=Z7_$
z0N?9>rrsMGh2awL=~`Z#F-fk!ei$q30zU|X#LqDeh~@A$n9EYHp^BOoKd=SAd1
zwI9^-04snyvb4wu$`s(q$-F>S58!M6UvQf*812g_aJz`SU+IsNd4T0u;dcTF@Y8Bu
zprQc$k2mFKlM$HZxX^F{)jYrgtnKe465RTNihroYqm%s2Xix4{)f>vcoKVQBIvuz_
zh)G6Brcz-%r&29nizRn_)au0AFZcf?gT-KF-C>Ovg
zEZL*eSzS6+TrPk$fsHZ3GYeRfei##gs!qdV|8C)~^i8P;SW33LYa7L7WjZumDu6G?
zvBikMLj2whr2?=y|L!5dZ_Js%*hWqjCku>@JWK#xPJ%@MT}^`9W6tPO65Q%hqf4>nUtLZD
zL_4F+%fa
z7(W?QaW7e;BN@RRFf~p9Z^g02h`<2uK#6ezI0|HPB)L&|-W72h#g7TVj|jdO%OWEv
zhtoIZ2_bI=HpB?edEi+3p8Qu)Es69gb4SAmy8S!4ub1bCtR%W7%i&-e?B&fy(ku>8wv
z0vNlU6OR3qx
z6Oog^(-|6Ngy9OXX|lqH`g{0WfzvG-WQ1jlh)jt4%cJDp#cH-IP!7eOp}HgVfY0NB>2|d1f;0yS8r2thw^PZos_8G3*e
zRb2`E9y^I74-VqOz04NzWau$pNzruC+
z8XD!Rhuo%iMPvZD9ovAa6^4Ny0#CHs+pk9EeSmUQbvm#Eco54aXoL&EI^amHte#fL
zy+Hg@vxoiba^BDD5Do#K6OmjC9|CxQQdIRO-1@Y>kk4%+t^k{Wos(tqW=T*10H|sY
z@Eu?aHhf&lQQVmR$&e2XE`StOoegXUR@2>mgR{6=zdKZ|FD04)08}*rRsh?8g)wc3
zz%}64xa{3%eWR!XNKw@(zy{z+pf|2HxibXp0=A0C>BzPeLjWnNIt_RP7yEYFvGzm2
zZd}0^CXuF40!Z;GXRConf!k>BKEioi(#EqQQn-^@3MqgTRRx$2d>go*_Q^aN0p10E
z3+&Hh2sbMVEr3#dKcNp;1FWKWeT5O+YU)>UnL6k49>mFl;#*h&FNQ_92;xh?GU6nn
zoX73Ga~PMTaj_i=y_EK{whF$_uml%M-U8f=YdW%A(tZJ#1$_ee5V!HdnP!tQi$X^T
zpc39o^x~q4IsV`4f$6wpl^H+}&UL2)FxPN-3>Sg_;cECP;8e_5Jx~4*xyde+iE=e%
P00000NkvXXu0mjfuzWXs}wxFZO~dpYa&s3DO%;0fW;m`0l}ik%YdRnOaMWzTn9?k
z)FR>G3u!HaAmt^Rz_FU5rl2SRc_g>IqzF-{1Pp|;)=olVvNt>9^xqwf??)UE_Ik~4
z&iQ?7dt$Tu#+fGbO!V~hX1Z=#@2RI}K+)5i^4Iif;3o}JGrPdYlqk=Q>-6$}x9rx_
zTcGEUwI@uxXPck-
zcFM~opWSQS{JHmnhCso^!e7^$)iE-P#v0$WeAqR7dynLSo8t(#cLzg!r)w3L(HeMk
zZ2Ig4&PVj7Of^vcqhl)X!3|-DnZ}O|rWqz}c=wwI)1R6yr2J`pX};!n%`NNI9|@nm
z+4iF7r}$&Ecg6z0*c|DtKR&knAI^7JIMx>+5%IZj2?Ildl7E$(IE*ttIIVtxB=kO1&)05taVhfxs4PGjj
z73}nv!z+jHjoPQs16t?-Uq`-RY8G2lPfcA!ap%6coP0bizdVQ&$EAA{T9ZOt6f@G7
zR;{fZpV6R;@aVyK!j{O4#|@9lf|PSn?tSGarxV*Ab@Tpb?hcACqqn#yMTebo5xZz?
z`0QZwO;!8q4d?nU^NnsfIPgZwzkB$VqucyMTi%FnrFYG=YmU6jwAS(TO3N?p
z>(zP~m{VVQ*DSl%n6~Tq;6&y$@Rz;TW8jl%DHF
z$9-t!yLForFYyZMHi6YWT_5@}`AiS(V+ZRRUV8%)-aA+V0BUEe(?;zHR|cF-QcT~V
zZ%#yHXWE`wrLBj1bUUyV!;PqWvxw3f`7NdGw2Hl3agz;D#{6#dy=fi#tIork
z#vL6Tb{y%1u~vm%IL$ZrrDyH+K?YJS2pkCeKZg|q(h2PEG+pmPlai+
z8X%&WE!1qHr&)O)@yWnzrdtXXi4HQI3Qq_g6lFCbTU6#1pwFZxROC-w-dFf<3QhugpgAA}9pL~YBiQ0ZEeNzo@
zVEL+*NcyQHlzbV24(pJ`-an8ZoaTtMwYFtWdY8v7(WH;piWbU
z;s6wx${wh^EUJ}ivW~$#po+Kia<*>Cz4q+sO1t9v8*jo!SJOr92`r=j>-LM~U;q>B
zotOThz)e#u&KrOOcB{ME{l%~<&dO1z0ADavWDK2o{fgz`NH3H2Rdn@8bOS+?-O3gD
zX_|Yu%=mMYSuA611^AIL<^=K}#weDc)J)}LE^Y&7yoPOXUM(me
zs(Bq{Cip&Yt}Q#HCB2tL!L(4)DfX8=g7(LX_*$8LkS0ev0Tqa|F{oeCO+cjI9rVN%V
z0^*mpaNS-G=VuTOe%Y*WU>CrANni3BT>f&xM;CC&T?NJQr4Bl&>;Z;
z*pjleGvIUZAO{^X0N6?_613HU#@3-R(Wa``o2c>(*h>q|^Y0P7J=kAat#3nU-$vgm
zKg58~DeU?41n!#f2Y=hjUP?`^Rtt5D-0vJ^1-|2W*h&*J&P8BPgCTcrr|yl~5;nS>
zTYrOP8<;Z>3uyXeKlW0Vttyn{E;k~b_8<{ZjN_Le@vIO0
zal&Snq?I9Nj_PI{heVh}YkgS<-QQ4kNun+LCfTB)&Gkfq7BDb(fyf>c_D)Ohsh4Au<;b4@Yl9brxVzKQ=!1
zFWP-m6&+Hs)K=xNd>-g8qBwFe1~0tY`K8&l6Tf6piONt{^#%_}F2-o&0-)mYG(4
z+{E6?ABDM4nk%Qs;vO#9r)L+QMu(U>!QNm4|%_v(W#7GXA#gz9|ET2cw#uX
zf3ovN$v#B2;EZv`RGd+86=rQND&D=#Eqy|1Bv3;3H12w$2v04p^S^?Yc0kd$^C8zj
zwiEx@I0(1~vYm}jM);Yrj(E86Z>>JS>>}9Hb>X_9)fnDgprH7YAchma1fh5dXHDZD
zyOKw2$AE>ev>2GcyD#zyr@0YT!4zhEqo~@Dj{qkqZXIY@4g@Ab2eQK!7(1FS0wcsK
znSTB|0+Us8uk-${f2l&kcQsTesX-R>1b%2>0}T`W^9DfYqXHekoEjoPq=awF0P5l=y6AdMNO+L%3QaQ=@IF983x1}-8-iFZ4-0Py
zvT_k81#C_4D5(iLDVXTHl37doxg*d_`aA;Mm?gj@c2YUpmzqzEPNwF&UUj`HPFDu&
zD}*A$k-i9rqg^+^!rYL3z1MCV(MuH^2}h#FtsRhC8K{B|xs|q`bdLSsJx%RT6!8wX
z_QKAHFc%GRAXyx#B}5-qUUmJhh|=o8I0pBQurDabhM7Zs9HRN!G?qJ`?A=6V9QHeGr`DU+lRemNM|E}0R_$DPqe#%Kv3&F
z-x0O@3srPT`=m=%zL5cowYZ;Ai#2mgFSi-Il#k~3amQqe3!EyM#*vfzcm{%PUMXiQv?Dt~#jc>}u6#WnGfE*aaQ>2*b3Ckvp@A`o4ixk1-sa5I4t6
zQoJzkKI8oHK#pCfj3m5UTcg#}BbU$wMYp!EQz!Rld;4EKdth^F~$wkVchSq
zOgdik0Pwdf27k-G(cv~tsC|mPE9(>COy%+vM#bE64CCdAvM=$lHUX36>cC{_XiNs&j}W=A%gZS#
zzXo4-=n=qs!VLS2T{~hYD<9#lhPMP$l`)Jn%lkb}qaZ1@9!-FRoG8S@1qfA=bE8@VuD0
zr5&n7>NajU#<-<;=L;)*?d~b8@M-eZPWT>8b3JN(?@OC`H?jf`()$wwmtx({MeA@4
z-4~9j8f9PM3D&Br<#Vw*D;2m2Wo{`Up>}mreRy*%C+3jOgbY!c7m8Y104?&zb%5W)
pLQ9xhSpKutON5m)L)qM(D!*+XJX{jwAr`Rf7_{|!tXx?BJN
literal 0
HcmV?d00001
diff --git a/images/white2.jpg b/images/white2.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..746d65d2a809b9a637827a9f0a67f75d1278b441
GIT binary patch
literal 14488
zcmeHOYg7~07M__TkOYwsFd(Iv@G?T6L4m6@AOuq>SPfPM1U13dQlwWcRkX!xfM}41
zMr9$br~xbTl7d)#Axj=As1RDLMQv>WAGJO}uqtZhPJo1v3}L4CF6$3sSUG2(@7w#^
zd*+-u@vQW<_9*~L;Ct`C2Y?_51i=4*zUzQLV1OqW5by>D1Or1u10tD1CX+~H^YJF*
zC>G|HmKNqTn$_D5ldRsdv!>DLEV`ZJa_T;DZd91a8^3XTE*
z;2$DQ-dKCA0%H{ztH4+V#wzd+RX_?H#Txm2V$sJUtSpi#P|l5FVvI$yKa!V0z(@ii
z2UJNB$r_G9FxWOxG`c=}z(s=vBmz*1W*@Ol0?5O1Kt;+V+Z*|++(Eu@z0uIby%BZFgH?+0>l$izIY
z0QknmzK;E^K=ZMSdm}H+>lX!rzJDhuSA>#9F&_ZJpVazXv@ErAh=plyGQgu_=YRlq
z4*m#$ln@EjTb#uHJ(oJc!G=AccOOe+AngdWHmF)Y;WeKr)3U)`Df~BVUppLv=VkI`
z!%c9HV#_3RX?#7r9Zm_pIy5Or28pbSFmAKXkjg*;hPJ*cn>_&WUB13D@tBuOCV%8_
zAN@OJ6=(311pmjIQ{?SCi<@$q$s2`;G9n^+B
zsXJYxn*Ll--oh&r1mOcBT0*=IqW=bF>MGphk$oq4+GhdBysg3lWpu~2UoV<}wFq(P
zLe6Vv5XpnpSaIp-ZZF3SS}==R6PR|_?^D%27MY}JCDCmQ7bfRAU6uh`nIe#jzJ5{w
zQm#etR+)ghYO2V@Bj%7u)j|1*hY+6wYPJKymqic|6B1jQGBrrM5$FIQ(C|kn0EFdM
zQo6<4vVbtmTX}pg5h%>i(tv}{KFle@4?X}u0Uvx2;o}gH0BvNz2rE+n!VNnf0R@n$
zlyRmX2an7IA4@a%$&_ttudz(+>bz=yQ=X}qf&gw<89;$_fC4Eg*QQrniS))dm^l#N
z2380u6{v-R0L64QT~Nwy7OAw(WW03m@ZVpZCvkVX+q>VgXYT%#!l>E)Cnu&cn?Ey;
za&!-tW!1o+Y_YqUWeufyPSgQE&kg>!KS_|qPMa1cX2>kI65|8k-D5+b9N6`1_$qUX
zq+SyHY4IGs?=#N$2U}C>+%q|jeSqp%s6RVOkDN319;?7u1@u**$z9(l(hTaZ#XhY}
zFjF2Og~lp%4F85zfc+Zul)ssG&Lz8LScN6r$4cog-~AQFC|z#eSTD-AGkzJJ(&VX$
z`F4B7i&2G%e%7QM=%{KLjiO-xs!1vDtkUcvwxQ~mD*JR3Ij3WE3cKA_Z0|Vs$^n
zT!fxggOm=`)#zR|5YhF;U}H$YNP@2pB5huDjt*8jIbT^YfV|+-3wKexyX7VDWbEfw
z-9v#_BEPFtEnHQq#%QtTsQ^u*E);{v11QD3CYZ-4#Z)J#)^kynvf47dQLRH6b!K(z
zP)1QD=isnYOtDi=$VW+5S7*^{p`g8`HN+rOF6m1!R)ao}DZDH^!eja#!77(?%1rb{
z(Wqg+=O*PMuR!}u?5EVjyGNW+zOyLMo-iPLj|)3cq^Gs|2Lc-YYS_`xnEe#<$#B-%1`J;V+8IUnDxeCAGX8}S@CQ6d|SxJz5BXd#0#bVhsX@w${R{FrtL%nhIUCAqO_eKYLBEu%MPKK@>-PU*;u16
zbM&M+!VnJG&Q6P~>_L1AjI%-B1&LZGl~NrR6tbwul<^sYEqXE#RPe0MA{VfSTsbIh-8W05H;opP|zCgf~FQCvFZoaEUvQqVN
z2;~($&X^?GXq+IcG!WmEUk9I0S?^UPM?=KtOz}ud?s|k9WUa3nZOnE-S7x==$RbnJTUeLE{Dqq)w?tkF&~
zV=m*ixX0x>xmMb8mg{A?ZkzdS3iEd!%?d{>d&!+~Ll6|y2QX)JWp0n`{;P9*YV##A
z(e#Pfi|Ehh8Xs&wh0EWvMC{Q1B!TN5NRb~sTJiCpKl~BI|6%+)a4zq_2VwvY{s9r3
zj;hEMQvt)xj~~36&h`~1tP$-f>ypZHs!PxOpg#P8^YW**EEBdG2|Y|Zgs1T?;__u(
z$uIAFzGd=zw9A%WTFoaR1-QlIolV+0%^H@9A@LL2o1D%D^f;&5|uOd&FdSoN-;LPNbhM!IT
z4C=6Up-oL}Skt!PSXQ)M@Y-F8H+@)B;;khc1mcso8fp_4oUcp&$RYo<*ReAvQg%O2
zT%2<6~Fz%&ZN1TyaczrS@KFiP1gbQlHugTJ1VlpRX6n^Rm}0e6rXz{fT1X
z%EY^Fijbd*xmRy3c;#wHxa@SOzAE?mCua(aBhPLMN(+h3`{XZ+(8B%u4tEe1C{|v1
z|EHBt!T8-a>u5j3cuT%JF~@t$6K~JAmPq)|TEk+z_Ltr&GZI!lwAh&PGMr>*cCPyQ
z?C;~YPp($L-A7^Z-QP>(PHiF1yPp+aKk;kP{-s~sv#9^`wjhpH^Ze|h&b`Sw|E|vQ
zZ_nOnchl#SWT)TSoijF@q}(#v^%TD{La@Q@)|bf@ry>f73$MYo*k;2k&CjYZw&Z<&
zDr8f*Nx`<74QUroi+j`3JdI~ZT>a6=^DsomBdZ=OoLxR$l3~RAF)JT0&`7^EAa?
z!p8*R)Mzsc^M>2c{ERr+j-GR}_ICB)H>7|4+s$*~`zk!=eB&s+W=6}cix{^by7Vfx
zH!Wu00cqryWmDHZH(tN_%(IZ_rsd1y(%3c2chK@SF)0V8g?>QH+MFJ#`1O|Js;A?-
zw+;c^RQ6kr4-%F@#g^wvV+=Yke}0tLw)7f@*Cudlcc+M#hel3ny}CY@N=ukBmr7zp
zIn#4Q55
Gd-cCKYH*PN
literal 0
HcmV?d00001
diff --git a/images/whiteback.png b/images/whiteback.png
new file mode 100644
index 0000000000000000000000000000000000000000..a49e04a66ff48670cb0bfbfb2f4a42703a84d75e
GIT binary patch
literal 732
zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1SE5RJ;(=AY)RhkE)4%caKYZ?lNlJ8CVIL!
zhE&XXdwZjIRw2XDj}_Ub5xi5oZv}ZaTXif=mh2PV);4kTP79VUj|D%%J8y-(Tyk@g
z*%ZelG0CZS&3{w`tUo6$)%U*A?(@@oho|3<)w?rM5C$e5d|0%z>*%8|Uree`I27%S
zSsQlRpvPn<;Mdtb9+F_4II@2xA`efMqI@5@%TKWpagoyb0C?!L0!Z_9Sy
zH1-T(50rH&6}ak1664={EBk%*-Er&FCD?WxFzAU}|NSrf-@`I|$KSrywQvDCmxLS9fE2P^Hbh-Mg*toXFe0IXy^MU%%W+_QHyrIeL0}K&5Nfthsal
zezV*4>({xtx!=qTiCZsjzH8U6S@Y+opI`FnXAM6;|ALE8pFX{FN2Xfs>Z@0;9zRyj
zxRPO#VOFV<{Mj_)
zYPC=Wfdjo+TW`I2qXX1=?AWo-pN%t0%F4{%^qQHQ$H&DvEY8|$Wo&$Sp6AxBTU(`H
zrZ-PaFzAq;div?gm73ptR=s`u_WJek3oAmjeEs}@Zh!mc%@=#ux~E^hlq4lJ*-q9H
z;d`o!LwupqHwvtMl{o7hD8_A3rRB4zZ9q)(ecl4dz`gN(vJa
zC0d;lb8>oYCuh~y%bTBi{`v4d4XNHoZaZW0N=l~KPJZ>^0fRYLtJ9m_oKBZVtF31G
zwC&9^P?>zv{`Hc}ncvnqPV!nB@?4*fpZ|C1qmLHVrx%<`+q^NNXRnhB6to@l-*9+l
Vp>o5NKfvV5;OXk;vd$@?2>@9hUkCsI
literal 0
HcmV?d00001
diff --git a/images/whitepause.png b/images/whitepause.png
new file mode 100644
index 0000000000000000000000000000000000000000..98d08d9c97703882f91dca9f2364638c0b0d30ac
GIT binary patch
literal 592
zcmV-W0L
z`8=D=k|c?JmPVq7&1Tc@_hTQYdFaXQc3UhKtyU}cp_+tV91e%kXcYTgjqw_Yi1IvN
ztybM`H}>fo;B6r9bUIBYlh_B0tsszReGgy*k?}o1638>U2gn1F%{`!0AkWqwP$3YR
z+5@Tu@=WXjq08_0dts(5%hEKBeUCpAx^}zWp3mpk>s8W7^Bxeovww9k7;Lv&;af@P
z9#9;}IhQ2KbUM9UE|NwH_W(AKm!@f!Wx}_Tsy#p$$QzHx$Kz4bNY5TnDv)!o)9Eai
z%RJ8|nKbMHWdnJ`;c&OxNgC0&{~k~+kaNz;9#A=ur+*LlFpyKf2YepLQ@aP$706S#
z2hj}@;W-FI7^a7
z^Au;Xb-w#q{Bs3qOiXds+cbuzIP0~JttrlWPGfP3vwrIso#HI(Q=FyzSsVZW00000
e00000pf-0wGSQ0pqRU$V0000;Sq3iUTz6)78Vv>OA8nh%$|SWV{Bmj
z6U%l4OdKB8<}j8&f1jss%7`p1JY-9lv3)psmHdy*HQSS&&eyG~VyRD)_Fnp;UD3#s
z!m>EXGcf^Ser=Zkt}|C`Cp|oFHTp
zTVMFUxOVNDsi~=yl$0o;q_WbEf_Rvi$c#MP+tW$yTwYr8`AzER=olV$L~7EMoyNz<
zmq#k6U%DU3>-DM`17B)F-+v3dps4tX*5ZG{wGhK^bZc6m5;?@
zu@w~+ahxaMJDm;5d3nx(f$D{Q3bN+a8_fOUVmTBF#kd}SsP3sMMxjv3;Q4_;LBwnR
z;o*C8ovBbLbai#r-`^h`(nT3{njh?$opt96FPfJUK!{M3|{=-+v`T40b
zh6TB~<0B*5t`&84bsHN2;GeJjVeM;QnXGWl^~EOtG0`ai^auU;68Q+ip)K##Llk2C!FLFRYKHC+`heVce=&B*xtc`e&fyc
zFUZo{y}1{^eEA}l2G9Vs=SSByXb?PD%>Oa+d|J@ZcR$`Zp
zjZJ)}wOo33wiuP++8E5mr=_MQAR=OBuj-MMocwPORN3Wqtbt8Hfa+vfM`vdo4%eS}
zrogo+lzIUu1j_N5*;!W3nJwl-oxiELQSBa+*=7og@HL5aQetFyc=+JpptTkO
znQRQXATcsOyS&U}=koj4FC{26GsLQF5Y*lbVSm1h2pLN61F4w}eG~KN#@O?|THg^&
zs`i~pBRL1?>-$^hCL6m+Dt%L=ygbQC6d^g;qN!e%0}7?1DsQx%O(77v{Z3tdK2%<=
zIOC1M#O_Omv7zhy#G4^Iv+apv!AVCr`C45yRaKv`JojmvdJ{35^)Nmj;?;*yz3%Lc
zjk<9|T21#$0!hUU*HKqrzx?9|1QWS7c?qK=h+kP*IX3uQbaY~(y=ZH!=JtQrk>yCWEj^Ycf`cXoDUBX=&N(#?tnW}0L;IXU+#V@lcw1_Ux_
z<>hjMT#5og>{VzNS65zxf4L}_baq1ojZT-pp7VfB`_xwaz43yC4Y%1z>WdeA8Q_nA-ib#yFVDgBJ^oWrV<`IE_>yu7>uQ0vQBNo5r$
z4i1i|`wM+C)LYLL!insLQ$|gb@B_&)TS`$;5p47mToH29DbD9-92^}5{Rza(3n&~oA@@0_jmVVOMcn3(
zPqn4!$)^1P%?X=e9Bt{D9n;ThPdpJPxmJI7TGpNg-5g%Ea;5->W25^2cg^1ZD7kyW
z@!O9d$Ce(Yq@12UTTZ9DqS271R>s1D`7>y=x28n%EsH4)BgIVa%J1Rf;ird;%LZ$z
zt3926uYJ`s@fYzJEVXUDMC#6`H0ekE5+3>pFev&lM)r>@Y&toeyVFJ8^L`uorbCu^r1mE2EWbB%!vD_pkJ~~3E+K*(;0NA
zlG3}HKza(@B>cexwm&8m{*hPu8X7{Q^9u`S2hL24Yu}yvvA8JUPvhUXM_*a-bJ23H
z^TTF#8Q#PT+4yd4ZU%>hIA92cF^5dfDM@N;*5u}9Aey|1jI9R*LpZ6T7|eeDCZRC#
zgbdCITr;;)9+WIT*!^I1_niBL^uY@%br}-fvcY=1;z6P8G
znXqqL49H}ip0p@I9#vREB9WNX-Sug63NeyOrOt%Di9V2MD~6#^^;9a`PQ-r!JC$EnjTQId~*)i-u`Wh5n!_=`(P-KrUb92p%OYx_M}j69#%
zesz#U`XDbScXTRKNtD2KNx%C3)^|YHtxPLByFww(V%C9yfsKE{@vy*O+y78;4ULU~
z4K6xBkD}kN>>=&8x3{GYqmN%8S;*b~L_VWc9v5eN`?kWV5KupV4iDa4ao~%Hi0H9S
z0GiDx8W?oHb&LHjwm|Ouc}w213ZV6<7cN+mMhSAUzaL>_6uSg_iLMwLvbSl8-ru9>
zvg=@K#z2O}(tiH@dBL&bv~e$BUJzJ5gF-u8(({0Tfbg9a@$XSm$mg0G8pI@d$7a9L
zm#h|xtE=+1oo{t?bxTW1x>}~6)z_2uu_DpR6aD>0S;slz1Ox@yrbXI|%gQ9h#nVbw
z|G;1{7F$4C_VTkFV3eT3E=8>Oi!!q~VCv}1E~^9(eH
zyA7i{>K7Uu92^>|<&}PXu)m*QOe`t<4;9&A?-LQx^w%|*%g7Wm7>q?lP%kKZ`|Rv&
zo9GM+x!&GhfDMd5JoEGOFJHbK6%{o%H)ldY0Ph403orw%e*?4mCJ#tFNC3LlM}*jw
zQB)2bje)@-b8Eq)3Y{~2rsMs4_Wg8yX}eFC{Dg#vz%?yCU=T(>E>pKc-+|7D6JnpGdEW>e^$i9y$Zdd9KTq1sH3CvsX|
zXnC7bIXcY4gNQ3vIvRo&0OL9|Y^wdf$S_Uh!~V`|X=wq%)-{YzN}37KQ4-~eBm&_R
z7M2slqm{CVL?S>&r_+G~K_+6L%IrxV6B&(9RxVYKbSx?$IuAT?&Uz@^sxVaxbd{}xa
z#oEeBNlEELmW^ORK|yuc*0s+-D1?Q#Wg@<1v5AR^VZO6oL%O;~t&FNA)T8!0E#UAh
zV$s^#8s`b=3fHDAzZ@8)^vml(yQEvnSook>z3V%>BX7kyCZ``9DMjyJvH-OJfqvH7
zt=IO|b_Z^~cCGa8_u5&@^6#hGT({c${oZc3?|H8?O5ShmbNfH<>cto5H|d;z6_b1W
z+vWeaY|bAqywY3uS2lABe#m?2#h+`JE2lfoJHOz{$`!$Z%NO~%&h4@iE!BDzf-b<)
xX2G0%V5Z}zGg?k*GgUY9O^sZ^40h&&&3a;ME=O5aO}_);d%F6$taD0e0sv12h3)_V
literal 0
HcmV?d00001
From a25c2c976ecdae24a7384f01976af4504bf4d9dc Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Sun, 17 Oct 2021 09:22:24 +0200
Subject: [PATCH 21/22] centering buttons remaining
---
.clj-kondo/.cache/2021.09.25/lock | 0
.history/.gitignore_20211008145905 | 2 -
.history/.gitignore_20211010133726 | 4 -
.history/.gitignore_20211011133958 | 4 -
.history/.gitignore_20211011134525 | 4 -
.../components/MainScreen_20161215154627.xml | 32 ----
.../components/MainScreen_20211011143248.xml | 14 --
.history/components/Play_20211012131737.brs | 27 ----
.history/components/Play_20211012131808.brs | 28 ----
.history/components/Play_20211012131900.brs | 27 ----
.../keyboardScene_20211012131932.brs | 93 -----------
.../keyboardScene_20211012132158.brs | 94 -----------
.../keyboardScene_20211012133530.brs | 95 -----------
.../keyboardScene_20211012133904.brs | 95 -----------
.../keyboardScene_20211012134451.brs | 96 -----------
.../keyboardScene_20211012134544.brs | 96 -----------
.../keyboardScene_20211012134647.brs | 97 ------------
.../keyboardScene_20211012134937.brs | 98 ------------
.../keyboardScene_20211012135037.brs | 98 ------------
.../keyboardScene_20211012135227.brs | 99 ------------
.../keyboardScene_20211012135232.brs | 99 ------------
.../keyboardScene_20211012135345.brs | 100 ------------
.../keyboardScene_20211012135459.brs | 100 ------------
.../keyboardScene_20211012135654.brs | 100 ------------
.../keyboardScene_20211012135833.brs | 100 ------------
.../keyboardScene_20211012135835.brs | 100 ------------
.../keyboardScene_20211012135845.brs | 100 ------------
.../keyboardScene_20211012135848.brs | 100 ------------
.../keyboardScene_20211012135849.brs | 100 ------------
.../keyboardScene_20211012140044.brs | 100 ------------
.../keyboardScene_20211012140310.brs | 100 ------------
.../keyboardScene_20211012140322.brs | 97 ------------
.../keyboardScene_20211012140753.brs | 101 ------------
.../keyboardScene_20211012140755.brs | 100 ------------
.../keyboardScene_20211012140756.brs | 100 ------------
.../keyboardScene_20211012140816.brs | 101 ------------
.../keyboardScene_20211012140911.brs | 101 ------------
.../keyboardScene_20211012140929.brs | 101 ------------
.../keyboardScene_20211012140932.brs | 100 ------------
.../keyboardScene_20211012140933.brs | 100 ------------
.../keyboardScene_20211012140937.brs | 99 ------------
.../keyboardScene_20211012141120.brs | 99 ------------
.../keyboardScene_20211012141140.brs | 100 ------------
.../keyboardScene_20211012141147.brs | 100 ------------
.../keyboardScene_20211012141326.brs | 100 ------------
.../keyboardScene_20211012141443.brs | 100 ------------
.../keyboardScene_20211012141637.brs | 101 ------------
.../keyboardScene_20211012141641.brs | 100 ------------
.../keyboardScene_20211012141813.brs | 101 ------------
.../keyboardScene_20211012141843.brs | 101 ------------
.../keyboardScene_20211012141913.brs | 101 ------------
.../keyboardScene_20211012141947.brs | 101 ------------
.../keyboardScene_20211012142027.brs | 101 ------------
.../keyboardScene_20211012142112.brs | 102 ------------
.../keyboardScene_20211012142206.brs | 102 ------------
.../keyboardScene_20211012142301.brs | 102 ------------
.../keyboardScene_20211012142428.brs | 103 ------------
.../keyboardScene_20211012142431.brs | 103 ------------
.../keyboardScene_20211012142554.brs | 104 ------------
.../keyboardScene_20211012142834.brs | 104 ------------
.../keyboardScene_20211012142946.brs | 104 ------------
.../keyboardScene_20211012143030.brs | 104 ------------
.../keyboardScene_20211012143106.brs | 104 ------------
.../keyboardScene_20211012143144.brs | 105 ------------
.../keyboardScene_20211012143255.brs | 105 ------------
.../keyboardScene_20211012143425.brs | 104 ------------
.../keyboardScene_20211012143432.brs | 104 ------------
.../keyboardScene_20211012143506.brs | 104 ------------
.../keyboardScene_20211012143547.brs | 104 ------------
.../keyboardScene_20211012143803.brs | 105 ------------
.../keyboardScene_20211012143849.brs | 105 ------------
.../keyboardScene_20211012144059.brs | 105 ------------
.../keyboardScene_20211012144148.brs | 105 ------------
.../keyboardScene_20211012144149.brs | 105 ------------
.../keyboardScene_20211012144401.brs | 105 ------------
.../keyboardScene_20211012144506.brs | 106 -------------
.../keyboardScene_20211012144537.brs | 107 -------------
.../keyboardScene_20211012144610.brs | 108 -------------
.../keyboardScene_20211012144744.brs | 109 -------------
.../keyboardScene_20211012144754.brs | 109 -------------
.../keyboardScene_20211012144806.brs | 110 -------------
.../keyboardScene_20211012144812.brs | 110 -------------
.../keyboardScene_20211012144825.brs | 110 -------------
.../keyboardScene_20211012145038.brs | 109 -------------
.../keyboardScene_20211012145051.brs | 110 -------------
.../keyboardScene_20211012145100.brs | 110 -------------
.../keyboardScene_20211012145914.brs | 110 -------------
.../keyboardScene_20211012145926.brs | 110 -------------
.../keyboardScene_20211012150040.brs | 109 -------------
.../keyboardScene_20211012150053.brs | 109 -------------
.../keyboardScene_20211012150212.brs | 109 -------------
.../keyboardScene_20211012150318.brs | 113 -------------
.../keyboardScene_20211012150319.brs | 112 -------------
.../keyboardScene_20211012150416.brs | 113 -------------
.../keyboardScene_20211012150424.brs | 113 -------------
.../keyboardScene_20211012150555.brs | 113 -------------
.../keyboardScene_20211012150601.brs | 114 --------------
.../keyboardScene_20211012150644.brs | 115 --------------
.../keyboardScene_20211012150915.brs | 111 -------------
.../keyboardScene_20211012150920.brs | 111 -------------
.../keyboardScene_20211012151005.brs | 111 -------------
.../keyboardScene_20211012151105.brs | 112 -------------
.../keyboardScene_20211012151115.brs | 115 --------------
.../keyboardScene_20211012151125.brs | 115 --------------
.../keyboardScene_20211012151129.brs | 114 --------------
.../keyboardScene_20211012151328.brs | 114 --------------
.../keyboardScene_20211012151452.brs | 115 --------------
.../keyboardScene_20211012151718.brs | 116 --------------
.../keyboardScene_20211012151724.brs | 120 --------------
.../keyboardScene_20211012151741.brs | 120 --------------
.../keyboardScene_20211012151753.brs | 120 --------------
.../keyboardScene_20211012151815.brs | 121 --------------
.../keyboardScene_20211012151941.brs | 121 --------------
.../keyboardScene_20211012151947.brs | 121 --------------
.../keyboardScene_20211012152121.brs | 121 --------------
.../keyboardScene_20211012152125.brs | 120 --------------
.../keyboardScene_20211012152229.brs | 120 --------------
.../keyboardScene_20211012152237.brs | 120 --------------
.../keyboardScene_20211012152352.brs | 122 --------------
.../keyboardScene_20211012152354.brs | 122 --------------
.../keyboardScene_20211012152507.brs | 120 --------------
.../keyboardScene_20211012152518.brs | 115 --------------
.../keyboardScene_20211012152520.brs | 115 --------------
.../keyboardScene_20211013084544.brs | 115 --------------
.../keyboardScene_20211013084609.brs | 115 --------------
.../keyboardScene_20211013084830.brs | 116 --------------
.../keyboardScene_20211013084919.brs | 117 --------------
.../keyboardScene_20211013084931.brs | 117 --------------
.../keyboardScene_20211013084953.brs | 117 --------------
.../keyboardScene_20211013085016.brs | 117 --------------
.../keyboardScene_20211013085019.brs | 116 --------------
.../keyboardScene_20211013085029.brs | 117 --------------
.../keyboardScene_20211013085134.brs | 117 --------------
.../keyboardScene_20211013085212.brs | 117 --------------
.../keyboardScene_20211013085303.brs | 122 --------------
.../keyboardScene_20211013085427.brs | 120 --------------
.../keyboardScene_20211013085504.brs | 120 --------------
.../keyboardScene_20211013085622.brs | 121 --------------
.../keyboardScene_20211013085645.brs | 120 --------------
.../keyboardScene_20211013085719.brs | 126 ---------------
.../keyboardScene_20211013085937.brs | 129 ---------------
.../keyboardScene_20211013085941.brs | 129 ---------------
.../keyboardScene_20211013090029.brs | 136 ----------------
.../keyboardScene_20211013090032.brs | 135 ----------------
.../keyboardScene_20211013090124.brs | 135 ----------------
.../keyboardScene_20211013090236.brs | 137 ----------------
.../keyboardScene_20211013090237.brs | 136 ----------------
.../keyboardScene_20211013090246.brs | 129 ---------------
.../keyboardScene_20211013090357.brs | 129 ---------------
.../keyboardScene_20211013090424.brs | 130 ---------------
.../keyboardScene_20211013090428.brs | 130 ---------------
.../keyboardScene_20211013090430.brs | 130 ---------------
.../keyboardScene_20211013090606.brs | 130 ---------------
.../keyboardScene_20211013090650.brs | 130 ---------------
.../keyboardScene_20211013091239.brs | 130 ---------------
.../keyboardScene_20211013091250.brs | 131 ---------------
.../keyboardScene_20211013091409.brs | 131 ---------------
.../keyboardScene_20211013091433.brs | 132 ----------------
.../keyboardScene_20211013091435.brs | 131 ---------------
.../keyboardScene_20211013091614.brs | 126 ---------------
.../keyboardScene_20211013091744.brs | 125 ---------------
.../keyboardScene_20211013091801.brs | 125 ---------------
.../keyboardScene_20211013091824.brs | 126 ---------------
.../keyboardScene_20211013091843.brs | 126 ---------------
.../keyboardScene_20211013092139.brs | 127 ---------------
.../keyboardScene_20211013092550.brs | 126 ---------------
.../keyboardScene_20211013092609.brs | 127 ---------------
.../keyboardScene_20211013092733.brs | 127 ---------------
.../keyboardScene_20211013092747.brs | 128 ---------------
.../keyboardScene_20211013093145.brs | 127 ---------------
.../keyboardScene_20211013093216.brs | 128 ---------------
.../keyboardScene_20211013093416.brs | 129 ---------------
.../keyboardScene_20211013093425.brs | 129 ---------------
.../keyboardScene_20211013093427.brs | 129 ---------------
.../keyboardScene_20211013093435.brs | 128 ---------------
.../keyboardScene_20211013093609.brs | 131 ---------------
.../keyboardScene_20211013093716.brs | 131 ---------------
.../keyboardScene_20211013093742.brs | 131 ---------------
.../keyboardScene_20211013093901.brs | 131 ---------------
.../keyboardScene_20211013094038.brs | 131 ---------------
.../keyboardScene_20211013094149.brs | 131 ---------------
.../keyboardScene_20211013094200.brs | 131 ---------------
.../keyboardScene_20211013094215.brs | 131 ---------------
.../keyboardScene_20211013094311.brs | 131 ---------------
.../keyboardScene_20211013094327.brs | 132 ----------------
.../keyboardScene_20211013094446.brs | 132 ----------------
.../keyboardScene_20211013094518.brs | 137 ----------------
.../keyboardScene_20211013094725.brs | 140 ----------------
.../keyboardScene_20211013094755.brs | 138 ----------------
.../keyboardScene_20211013094801.brs | 138 ----------------
.../keyboardScene_20211013094955.brs | 136 ----------------
.../keyboardScene_20211013095125.brs | 137 ----------------
.../keyboardScene_20211013095129.brs | 133 ----------------
.../keyboardScene_20211013095302.brs | 135 ----------------
.../keyboardScene_20211013095309.brs | 135 ----------------
.../keyboardScene_20211013095313.brs | 139 ----------------
.../keyboardScene_20211013095352.brs | 138 ----------------
.../keyboardScene_20211013095507.brs | 134 ----------------
.../keyboardScene_20211013095619.brs | 133 ----------------
.../keyboardScene_20211013095915.brs | 133 ----------------
.../keyboardScene_20211013100109.brs | 130 ---------------
.../keyboardScene_20211013100114.brs | 130 ---------------
.../keyboardScene_20211013100321.brs | 131 ---------------
.../keyboardScene_20211013100413.brs | 131 ---------------
.../keyboardScene_20211013100611.brs | 130 ---------------
.../keyboardScene_20211013100704.brs | 130 ---------------
.../keyboardScene_20211013100732.brs | 130 ---------------
.../keyboardScene_20211013100741.brs | 130 ---------------
.../keyboardScene_20211013101010.brs | 130 ---------------
.../keyboardScene_20211013101053.brs | 130 ---------------
.../keyboardScene_20211013101209.brs | 136 ----------------
.../keyboardScene_20211013101219.brs | 138 ----------------
.../keyboardScene_20211013101612.brs | 139 ----------------
.../keyboardScene_20211013101628.brs | 139 ----------------
.../keyboardScene_20211013101701.brs | 129 ---------------
.../keyboardScene_20211013101702.brs | 130 ---------------
.../keyboardScene_20211013101804.brs | 130 ---------------
.../keyboardScene_20211013101906.brs | 131 ---------------
.../keyboardScene_20211013102044.brs | 130 ---------------
.../keyboardScene_20211013102050.brs | 131 ---------------
.../keyboardScene_20211013102112.brs | 130 ---------------
.../keyboardScene_20211013102231.brs | 129 ---------------
.../keyboardScene_20211013102345.brs | 130 ---------------
.../keyboardScene_20211013102451.brs | 130 ---------------
.../keyboardScene_20211013102459.brs | 129 ---------------
.../keyboardScene_20211013102726.brs | 129 ---------------
.../keyboardScene_20211013102731.brs | 129 ---------------
.../keyboardScene_20211013102735.brs | 128 ---------------
.../keyboardScene_20211013102942.brs | 128 ---------------
.../keyboardScene_20211013103048.brs | 126 ---------------
.../keyboardScene_20211013103053.brs | 124 ---------------
.../keyboardScene_20211013103117.brs | 124 ---------------
.../keyboardScene_20211013103253.brs | 125 ---------------
.../keyboardScene_20211013103329.brs | 126 ---------------
.../keyboardScene_20211013103340.brs | 129 ---------------
.../keyboardScene_20211013103508.brs | 124 ---------------
.../keyboardScene_20211013103610.brs | 129 ---------------
.../keyboardScene_20211013103822.brs | 129 ---------------
.../keyboardScene_20211013104007.brs | 129 ---------------
.../keyboardScene_20211013104125.brs | 132 ----------------
.../keyboardScene_20211013104129.brs | 132 ----------------
.../keyboardScene_20211013104607.brs | 128 ---------------
.../keyboardScene_20211013111804.brs | 129 ---------------
.../keyboardScene_20211013112056.brs | 129 ---------------
.../keyboardScene_20211013112130.brs | 129 ---------------
.../keyboardScene_20211013112734.brs | 130 ---------------
.../keyboardScene_20211013112809.brs | 149 ------------------
.../keyboardScene_20211013112832.brs | 131 ---------------
.../keyboardScene_20211013112904.brs | 131 ---------------
.../keyboardScene_20211013112911.brs | 132 ----------------
.../keyboardScene_20211013112916.brs | 132 ----------------
.../keyboardScene_20211013112931.brs | 132 ----------------
.../keyboardScene_20211013112957.brs | 134 ----------------
.../keyboardScene_20211013113346.brs | 134 ----------------
.../keyboardScene_20211013113353.brs | 134 ----------------
.../keyboardScene_20211013113420.brs | 135 ----------------
.../keyboardScene_20211013113430.brs | 135 ----------------
.../keyboardScene_20211013113434.brs | 135 ----------------
.../keyboardScene_20211013113448.brs | 135 ----------------
.../keyboardScene_20211013113930.brs | 136 ----------------
.../keyboardScene_20211013114149.brs | 135 ----------------
.../keyboardScene_20211013114208.brs | 136 ----------------
.../keyboardScene_20211013114259.brs | 136 ----------------
.../keyboardScene_20211013114359.brs | 136 ----------------
.../keyboardScene_20211013114558.brs | 136 ----------------
.../keyboardScene_20211013114601.brs | 136 ----------------
.../keyboardScene_20211013114638.brs | 137 ----------------
.../keyboardScene_20211013114900.brs | 137 ----------------
.../keyboardScene_20211013114903.brs | 137 ----------------
.../keyboardScene_20211013114922.brs | 134 ----------------
.../keyboardScene_20211013114926.brs | 135 ----------------
.../keyboardScene_20211013115137.brs | 135 ----------------
.../keyboardScene_20211013115148.brs | 135 ----------------
.../keyboardScene_20211013115449.brs | 115 --------------
.../keyboardScene_20211013115508.brs | 115 --------------
.../keyboardScene_20211013115641.brs | 113 -------------
.../keyboardScene_20211013115642.brs | 112 -------------
.../keyboardScene_20211013120029.brs | 128 ---------------
.../keyboardScene_20211013120221.brs | 128 ---------------
.../keyboardScene_20211013120222.brs | 128 ---------------
.../keyboardScene_20211013120224.brs | 128 ---------------
.../keyboardScene_20211013120310.brs | 128 ---------------
.../keyboardScene_20211013120433.brs | 128 ---------------
.../keyboardScene_20211013120455.brs | 128 ---------------
.../keyboardScene_20211013120556.brs | 128 ---------------
.../keyboardScene_20211013120716.brs | 128 ---------------
.../keyboardScene_20211013120749.brs | 128 ---------------
.../keyboardScene_20211013120941.brs | 128 ---------------
.../keyboardScene_20211013120950.brs | 128 ---------------
.../keyboardScene_20211013121009.brs | 129 ---------------
.../keyboardScene_20211013121301.brs | 129 ---------------
.../keyboardScene_20211013121308.brs | 128 ---------------
.../keyboardScene_20211013121430.brs | 128 ---------------
.../keyboardScene_20211013121510.brs | 130 ---------------
.../keyboardScene_20211013121513.brs | 129 ---------------
.../keyboardScene_20211013121642.brs | 129 ---------------
.../keyboardScene_20211013121733.brs | 130 ---------------
.../keyboardScene_20211013121813.brs | 130 ---------------
.../keyboardScene_20211013121920.brs | 130 ---------------
.../keyboardScene_20211013122052.brs | 130 ---------------
.../keyboardScene_20211013122203.brs | 130 ---------------
.../keyboardScene_20211013122255.brs | 130 ---------------
.../keyboardScene_20211013122346.brs | 138 ----------------
.../keyboardScene_20211013122751.brs | 137 ----------------
.../keyboardScene_20211013122827.brs | 128 ---------------
.../keyboardScene_20211013122956.brs | 137 ----------------
.../keyboardScene_20211013123106.brs | 137 ----------------
.../keyboardScene_20211013123338.brs | 137 ----------------
.../keyboardScene_20211013123348.brs | 137 ----------------
.../keyboardScene_20211013123553.brs | 137 ----------------
.../keyboardScene_20211013123635.brs | 125 ---------------
.../keyboardScene_20211013123640.brs | 124 ---------------
.../keyboardScene_20211013123711.brs | 124 ---------------
.../keyboardScene_20211013123930.brs | 125 ---------------
.../keyboardScene_20211013123941.brs | 125 ---------------
.../keyboardScene_20211013124048.brs | 124 ---------------
.../keyboardScene_20211013124103.brs | 125 ---------------
.../keyboardScene_20211013124315.brs | 124 ---------------
.../keyboardScene_20211013124342.brs | 125 ---------------
.../keyboardScene_20211013124356.brs | 125 ---------------
.../keyboardScene_20211013124407.brs | 125 ---------------
.../keyboardScene_20211013124600.brs | 122 --------------
.../keyboardScene_20211013124601.brs | 121 --------------
.../keyboardScene_20211013124605.brs | 119 --------------
.../keyboardScene_20211013124801.brs | 121 --------------
.../keyboardScene_20211013124803.brs | 121 --------------
.../keyboardScene_20211013124813.brs | 121 --------------
.../keyboardScene_20211013124917.brs | 121 --------------
.../keyboardScene_20211013125042.brs | 121 --------------
.../keyboardScene_20211013125125.brs | 121 --------------
.../keyboardScene_20211013125245.brs | 121 --------------
.../keyboardScene_20211013125422.brs | 123 ---------------
.../keyboardScene_20211013125550.brs | 123 ---------------
.../keyboardScene_20211013125740.brs | 123 ---------------
.../keyboardScene_20211013125813.brs | 123 ---------------
.../keyboardScene_20211013130232.brs | 123 ---------------
.../keyboardScene_20211013130255.brs | 123 ---------------
.../keyboardScene_20211013130450.brs | 123 ---------------
.../keyboardScene_20211013130504.brs | 123 ---------------
.../keyboardScene_20211013130610.brs | 123 ---------------
.../keyboardScene_20211013130615.brs | 122 --------------
.../keyboardScene_20211013130800.brs | 122 --------------
.../keyboardScene_20211013130841.brs | 122 --------------
.../keyboardScene_20211013130923.brs | 122 --------------
.../keyboardScene_20211013131007.brs | 129 ---------------
.../keyboardScene_20211013131022.brs | 128 ---------------
.../keyboardScene_20211013131110.brs | 128 ---------------
.../keyboardScene_20211013131111.brs | 128 ---------------
.../keyboardScene_20211013131430.brs | 128 ---------------
.../keyboardScene_20211013131507.brs | 129 ---------------
.../keyboardScene_20211013131514.brs | 129 ---------------
.../keyboardScene_20211013131516.brs | 129 ---------------
.../keyboardScene_20211013131537.brs | 129 ---------------
.../keyboardScene_20211013131756.brs | 131 ---------------
.../keyboardScene_20211013131908.brs | 132 ----------------
.../keyboardScene_20211013131909.brs | 132 ----------------
.../keyboardScene_20211013131944.brs | 132 ----------------
.../keyboardScene_20211013132015.brs | 132 ----------------
.../keyboardScene_20211013132042.brs | 132 ----------------
.../keyboardScene_20211013132113.brs | 132 ----------------
.../keyboardScene_20211013132154.brs | 132 ----------------
.../keyboardScene_20211013132231.brs | 125 ---------------
.../keyboardScene_20211013132325.brs | 132 ----------------
.../keyboardScene_20211013132328.brs | 132 ----------------
.../keyboardScene_20211013132822.brs | 125 ---------------
.../keyboardScene_20211013132836.brs | 125 ---------------
.../keyboardScene_20211013132919.brs | 125 ---------------
.../keyboardScene_20211013132923.brs | 125 ---------------
.../keyboardScene_20211013133140.brs | 115 --------------
.../keyboardScene_20211013133235.brs | 116 --------------
.../keyboardScene_20211013133307.brs | 118 --------------
.../keyboardScene_20211013133351.brs | 120 --------------
.../keyboardScene_20211013133354.brs | 120 --------------
.../keyboardScene_20211013133416.brs | 120 --------------
.../keyboardScene_20211013133531.brs | 121 --------------
.../keyboardScene_20211013133535.brs | 120 --------------
.../keyboardScene_20211013133645.brs | 120 --------------
.../keyboardScene_20211013133851.brs | 121 --------------
.../keyboardScene_20211013133853.brs | 121 --------------
.../keyboardScene_20211013133936.brs | 122 --------------
.../keyboardScene_20211013134505.brs | 122 --------------
.../keyboardScene_20211013134544.brs | 122 --------------
.../keyboardScene_20211013134546.brs | 122 --------------
.../keyboardScene_20211013134551.brs | 122 --------------
.../keyboardScene_20211013134614.brs | 122 --------------
.../keyboardScene_20211013134659.brs | 122 --------------
.../keyboardScene_20211013134857.brs | 121 --------------
.../keyboardScene_20211013134858.brs | 120 --------------
.../keyboardScene_20211013134903.brs | 120 --------------
.../keyboardScene_20211013134949.brs | 121 --------------
.../keyboardScene_20211013135052.brs | 122 --------------
.../keyboardScene_20211013135201.brs | 121 --------------
.../keyboardScene_20211013135245.brs | 122 --------------
.../keyboardScene_20211013135311.brs | 122 --------------
.../keyboardScene_20211013135323.brs | 122 --------------
.../keyboardScene_20211013135421.brs | 125 ---------------
.../keyboardScene_20211013135423.brs | 125 ---------------
.../keyboardScene_20211013135438.brs | 124 ---------------
.../keyboardScene_20211013135941.brs | 124 ---------------
.../keyboardScene_20211013140045.brs | 126 ---------------
.../keyboardScene_20211013140050.brs | 126 ---------------
.../keyboardScene_20211013140143.brs | 126 ---------------
.../keyboardScene_20211013140205.brs | 126 ---------------
.../keyboardScene_20211013140225.brs | 126 ---------------
.../keyboardScene_20211013140252.brs | 128 ---------------
.../keyboardScene_20211013140501.brs | 127 ---------------
.../keyboardScene_20211013140635.brs | 126 ---------------
.../keyboardScene_20211013140749.brs | 128 ---------------
.../keyboardScene_20211013140847.brs | 128 ---------------
.../keyboardScene_20211013141218.brs | 126 ---------------
.../keyboardScene_20211013142600.brs | 131 ---------------
.../keyboardScene_20211013142605.brs | 131 ---------------
.../keyboardScene_20211013143004.brs | 131 ---------------
.../keyboardScene_20211013143124.brs | 135 ----------------
.../keyboardScene_20211013143327.brs | 135 ----------------
.../keyboardScene_20211013143425.brs | 138 ----------------
.../keyboardScene_20211013143546.brs | 145 -----------------
.../keyboardScene_20211013144033.brs | 145 -----------------
.../keyboardScene_20211013144219.brs | 136 ----------------
.../keyboardScene_20211013144311.brs | 136 ----------------
.../keyboardScene_20211013144317.brs | 136 ----------------
.../keyboardScene_20211013144410.brs | 136 ----------------
.../keyboardScene_20211013144558.brs | 136 ----------------
.../keyboardScene_20211013144626.brs | 136 ----------------
.../keyboardScene_20211013144935.brs | 136 ----------------
.../keyboardScene_20211013144950.brs | 136 ----------------
.../keyboardScene_20211013145019.brs | 136 ----------------
.../keyboardScene_20211013145139.brs | 127 ---------------
.../keyboardScene_20211013145506.brs | 127 ---------------
.../keyboardScene_20211013145513.brs | 128 ---------------
.../keyboardScene_20211013145610.brs | 127 ---------------
.../keyboardScene_20211013145626.brs | 129 ---------------
.../keyboardScene_20211013145743.brs | 130 ---------------
.../keyboardScene_20211013145848.brs | 128 ---------------
.../keyboardScene_20211013145849.brs | 127 ---------------
.../keyboardScene_20211013145926.brs | 127 ---------------
.../keyboardScene_20211013150159.brs | 138 ----------------
.../keyboardScene_20211013150327.brs | 138 ----------------
.../keyboardScene_20211013150822.brs | 127 ---------------
.../keyboardScene_20211013151157.brs | 127 ---------------
.history/components/play_20211012131733.xml | 7 -
.history/components/play_20211012131742.xml | 7 -
.../rowListContent_20211008145905.brs | 11 --
.../rowListContent_20211010122436.xml | 5 -
.../rowListContent_20211010122446.brs | 11 --
.../rowListContent_20211010122452.xml | 5 -
.../rowListContent_20211011134627.xml | 5 -
.../rowListContent_20211012145223.xml | 5 -
.../components/rowListItem_20211010122403.xml | 16 --
.../components/rowListItem_20211010122413.xml | 16 --
.../components/rowListItem_20211010122425.xml | 16 --
.../components/rowListItem_20211011134635.xml | 16 --
.../components/rowListItem_20211012145217.xml | 16 --
.../rowListScene_20211008145905.brs | 23 ---
.../rowListScene_20211008145905.xml | 7 -
.../rowListScene_20211008145927.xml | 7 -
.../rowListScene_20211008150133.xml | 14 --
.../rowListScene_20211008150134.xml | 14 --
.../rowListScene_20211008150139.xml | 14 --
.../rowListScene_20211008150146.xml | 13 --
.../rowListScene_20211008150412.brs | 3 -
.../rowListScene_20211008150439.brs | 7 -
.../rowListScene_20211008150452.brs | 7 -
.../rowListScene_20211008150508.brs | 9 --
.../rowListScene_20211008150514.brs | 9 --
.../rowListScene_20211008150559.brs | 11 --
.../rowListScene_20211008150612.brs | 11 --
.../rowListScene_20211008150619.brs | 11 --
.../rowListScene_20211008150659.brs | 16 --
.../rowListScene_20211008150803.brs | 16 --
.../rowListScene_20211008150813.brs | 18 ---
.../rowListScene_20211008150839.brs | 20 ---
.../rowListScene_20211008150851.brs | 20 ---
.../rowListScene_20211008150910.brs | 23 ---
.../rowListScene_20211008150944.brs | 28 ----
.../rowListScene_20211008151000.brs | 32 ----
.../rowListScene_20211008151026.brs | 32 ----
.../rowListScene_20211008151203.xml | 13 --
.../rowListScene_20211008151217.brs | 33 ----
.../rowListScene_20211008151221.xml | 13 --
.../rowListScene_20211008151233.brs | 33 ----
.../rowListScene_20211008151244.brs | 37 -----
.../rowListScene_20211008151305.brs | 37 -----
.../rowListScene_20211008151346.xml | 13 --
.../rowListScene_20211008151554.brs | 37 -----
.../rowListScene_20211008151601.xml | 13 --
.../rowListScene_20211008151608.brs | 37 -----
.../rowListScene_20211008151648.brs | 38 -----
.../rowListScene_20211008151716.brs | 38 -----
.../rowListScene_20211008151748.brs | 34 ----
.../rowListScene_20211008151751.brs | 34 ----
.../rowListScene_20211008151753.brs | 34 ----
.../rowListScene_20211010122343.xml | 13 --
.../rowListScene_20211010122348.xml | 13 --
.../rowListScene_20211010122743.brs | 34 ----
.../rowListScene_20211010122855.brs | 35 ----
.../rowListScene_20211010122902.brs | 36 -----
.../rowListScene_20211010123116.xml | 13 --
.../rowListScene_20211010123149.brs | 37 -----
.../rowListScene_20211010123557.brs | 37 -----
.../rowListScene_20211010123606.brs | 37 -----
.../rowListScene_20211010123612.brs | 37 -----
.../rowListScene_20211010123656.brs | 38 -----
.../rowListScene_20211010123711.brs | 39 -----
.../rowListScene_20211010123739.brs | 38 -----
.../rowListScene_20211010123753.brs | 38 -----
.../rowListScene_20211010123754.brs | 38 -----
.../rowListScene_20211010123821.brs | 37 -----
.../rowListScene_20211010123912.brs | 37 -----
.../rowListScene_20211010123926.brs | 37 -----
.../rowListScene_20211010124004.brs | 36 -----
.../rowListScene_20211010124048.brs | 36 -----
.../rowListScene_20211010124059.brs | 36 -----
.../rowListScene_20211010124155.brs | 36 -----
.../rowListScene_20211010124210.brs | 36 -----
.../rowListScene_20211010124225.brs | 36 -----
.../rowListScene_20211010124416.brs | 36 -----
.../rowListScene_20211010124457.brs | 36 -----
.../rowListScene_20211010124504.brs | 36 -----
.../rowListScene_20211010124545.brs | 38 -----
.../rowListScene_20211010124549.brs | 39 -----
.../rowListScene_20211010124817.brs | 42 -----
.../rowListScene_20211010124832.brs | 42 -----
.../rowListScene_20211010124834.brs | 42 -----
.../rowListScene_20211010124838.brs | 41 -----
.../rowListScene_20211010124840.brs | 40 -----
.../rowListScene_20211010124841.brs | 40 -----
.../rowListScene_20211010124855.brs | 40 -----
.../rowListScene_20211010124857.brs | 40 -----
.../rowListScene_20211010124910.brs | 40 -----
.../rowListScene_20211010124917.brs | 41 -----
.../rowListScene_20211010125016.brs | 43 -----
.../rowListScene_20211010125023.brs | 43 -----
.../rowListScene_20211010125035.brs | 43 -----
.../rowListScene_20211010125125.brs | 43 -----
.../rowListScene_20211010125153.brs | 43 -----
.../rowListScene_20211010125251.brs | 44 ------
.../rowListScene_20211010125317.brs | 46 ------
.../rowListScene_20211010125328.brs | 46 ------
.../rowListScene_20211010125350.brs | 49 ------
.../rowListScene_20211010125431.brs | 50 ------
.../rowListScene_20211010125509.brs | 50 ------
.../rowListScene_20211010125709.brs | 49 ------
.../rowListScene_20211010125712.brs | 49 ------
.../rowListScene_20211010125717.brs | 50 ------
.../rowListScene_20211010125756.brs | 50 ------
.../rowListScene_20211010125848.brs | 49 ------
.../rowListScene_20211010125855.brs | 49 ------
.../rowListScene_20211010125904.brs | 50 ------
.../rowListScene_20211010130310.brs | 50 ------
.../rowListScene_20211010130315.brs | 50 ------
.../rowListScene_20211010130435.brs | 50 ------
.../rowListScene_20211010130553.brs | 50 ------
.../rowListScene_20211010130642.brs | 49 ------
.../rowListScene_20211010130800.brs | 49 ------
.../rowListScene_20211010130847.brs | 49 ------
.../rowListScene_20211010130910.brs | 49 ------
.../rowListScene_20211010130927.brs | 49 ------
.../rowListScene_20211010131020.brs | 49 ------
.../rowListScene_20211010131021.brs | 49 ------
.../rowListScene_20211010131044.brs | 49 ------
.../rowListScene_20211010131134.brs | 49 ------
.../rowListScene_20211010131150.brs | 49 ------
.../rowListScene_20211010131237.brs | 49 ------
.../rowListScene_20211010131430.brs | 49 ------
.../rowListScene_20211010131442.brs | 49 ------
.../rowListScene_20211010131514.brs | 49 ------
.../rowListScene_20211010131649.brs | 49 ------
.../rowListScene_20211010131725.brs | 49 ------
.../rowListScene_20211010131734.brs | 49 ------
.../rowListScene_20211010132014.brs | 53 -------
.../rowListScene_20211010132049.brs | 53 -------
.../rowListScene_20211010132232.brs | 53 -------
.../rowListScene_20211010132443.brs | 55 -------
.../rowListScene_20211010132532.brs | 57 -------
.../rowListScene_20211010132545.brs | 56 -------
.../rowListScene_20211010132642.brs | 56 -------
.../rowListScene_20211010132714.brs | 56 -------
.../rowListScene_20211010132739.brs | 56 -------
.../rowListScene_20211010132742.brs | 56 -------
.../rowListScene_20211010132749.brs | 56 -------
.../rowListScene_20211010132943.brs | 49 ------
.../rowListScene_20211010132944.brs | 48 ------
.../rowListScene_20211010132947.brs | 49 ------
.../rowListScene_20211010133121.brs | 51 ------
.../rowListScene_20211010133129.brs | 51 ------
.../rowListScene_20211010133140.brs | 51 ------
.../rowListScene_20211010133142.brs | 51 ------
.../rowListScene_20211010133202.brs | 51 ------
.../rowListScene_20211010133442.xml | 12 --
.../rowListScene_20211010133449.brs | 50 ------
.../rowListScene_20211010133458.brs | 45 ------
.../rowListScene_20211011134546.xml | 7 -
.../rowListScene_20211011134642.xml | 7 -
.../rowListScene_20211011134809.xml | 10 --
.../rowListScene_20211011134907.xml | 10 --
.../rowListScene_20211011134920.xml | 10 --
.../rowListScene_20211011135127.xml | 11 --
.../rowListScene_20211011135145.brs | 20 ---
.../rowListScene_20211011135201.brs | 21 ---
.../rowListScene_20211011135220.xml | 11 --
.../rowListScene_20211011135315.xml | 12 --
.../rowListScene_20211011135328.xml | 12 --
.../rowListScene_20211011135342.xml | 12 --
.../rowListScene_20211011135727.xml | 13 --
.../rowListScene_20211011135742.xml | 13 --
.../rowListScene_20211011135756.xml | 13 --
.../rowListScene_20211011135757.xml | 13 --
.../rowListScene_20211011140317.xml | 14 --
.../rowListScene_20211011140321.xml | 14 --
.../rowListScene_20211011142206.xml | 14 --
.../rowListScene_20211011142420.xml | 15 --
.../rowListScene_20211011142458.xml | 14 --
.../rowListScene_20211011142525.brs | 22 ---
.../rowListScene_20211011142610.brs | 23 ---
.../rowListScene_20211011142646.brs | 27 ----
.../rowListScene_20211011142657.brs | 27 ----
.../rowListScene_20211011142700.brs | 29 ----
.../rowListScene_20211011143048.brs | 30 ----
.../rowListScene_20211011143119.brs | 30 ----
.../rowListScene_20211011143203.brs | 31 ----
.../rowListScene_20211011143204.brs | 31 ----
.../rowListScene_20211011143521.brs | 35 ----
.../rowListScene_20211011143557.brs | 36 -----
.../rowListScene_20211011144019.xml | 14 --
.../rowListScene_20211011144025.xml | 14 --
.../rowListScene_20211011144115.xml | 14 --
.../rowListScene_20211011144141.xml | 13 --
.../rowListScene_20211011144330.xml | 13 --
.../rowListScene_20211011144343.brs | 36 -----
.../rowListScene_20211011144638.brs | 36 -----
.../rowListScene_20211011144659.brs | 34 ----
.../rowListScene_20211011144718.brs | 14 --
.../rowListScene_20211011151753.xml | 25 ---
.../rowListScene_20211011151755.xml | 25 ---
.../rowListScene_20211011151829.brs | 8 -
.../rowListScene_20211011151922.xml | 25 ---
.../rowListScene_20211011152047.xml | 26 ---
.../rowListScene_20211011152054.xml | 25 ---
.../rowListScene_20211011152249.xml | 24 ---
.../rowListScene_20211011152637.xml | 23 ---
.../rowListScene_20211011152704.xml | 23 ---
.../rowListScene_20211011152741.brs | 8 -
.../rowListScene_20211011152745.brs | 8 -
.../rowListScene_20211011152820.brs | 7 -
.../rowListScene_20211011154834.xml | 23 ---
.../rowListScene_20211011154858.xml | 23 ---
.../rowListScene_20211011160212.xml | 24 ---
.../rowListScene_20211011160214.xml | 23 ---
.../rowListScene_20211011160217.xml | 23 ---
.../rowListScene_20211011160729.xml | 23 ---
.../rowListScene_20211011160824.xml | 21 ---
.../rowListScene_20211011161430.xml | 21 ---
.../rowListScene_20211011161441.brs | 5 -
.../rowListScene_20211011161505.xml | 21 ---
.../rowListScene_20211011161514.xml | 21 ---
.../rowListScene_20211011161556.xml | 21 ---
.../rowListScene_20211011161820.brs | 5 -
.../rowListScene_20211011161851.xml | 22 ---
.../rowListScene_20211011161853.xml | 22 ---
.../rowListScene_20211011161900.xml | 25 ---
.../rowListScene_20211011161906.xml | 24 ---
.../rowListScene_20211011161926.xml | 22 ---
.../rowListScene_20211011163824.xml | 22 ---
.../rowListScene_20211011163856.xml | 22 ---
.../rowListScene_20211011163858.xml | 22 ---
.../rowListScene_20211011163948.xml | 22 ---
.../rowListScene_20211011163950.xml | 22 ---
.../rowListScene_20211012030439.xml | 25 ---
.../rowListScene_20211012030442.xml | 24 ---
.../rowListScene_20211012030443.xml | 25 ---
.../rowListScene_20211012030617.xml | 25 ---
.../rowListScene_20211012030618.xml | 25 ---
.../rowListScene_20211012030641.xml | 25 ---
.../rowListScene_20211012030736.xml | 25 ---
.../rowListScene_20211012030753.xml | 25 ---
.../rowListScene_20211012030805.brs | 5 -
.../rowListScene_20211012030811.brs | 6 -
.../rowListScene_20211012031004.xml | 25 ---
.../rowListScene_20211012031006.xml | 24 ---
.../rowListScene_20211012031011.xml | 23 ---
.../rowListScene_20211012031223.brs | 4 -
.../rowListScene_20211012031226.brs | 5 -
.../rowListScene_20211012031230.brs | 5 -
.../rowListScene_20211012031231.brs | 4 -
.../rowListScene_20211012031235.brs | 4 -
.../rowListScene_20211012031408.xml | 23 ---
.../rowListScene_20211012032157.xml | 23 ---
.../rowListScene_20211012122112.xml | 23 ---
.../rowListScene_20211012122632.xml | 24 ---
.../rowListScene_20211012122658.xml | 24 ---
.../rowListScene_20211012122713.xml | 24 ---
.../rowListScene_20211012122732.xml | 24 ---
.../trickplay/trickplay_20211013105704.xml | 0
.../trickplay/trickplay_20211013105742.xml | 5 -
.../trickplay/trickplay_20211013105805.xml | 5 -
.../trickplay/trickplay_20211013105810.xml | 5 -
.../trickplay/trickplay_20211013105834.xml | 7 -
.../trickplay/trickplay_20211013105854.xml | 8 -
.../trickplay/trickplay_20211013105904.xml | 8 -
.../trickplay/trickplay_20211013105925.xml | 8 -
.../trickplay/trickplay_20211013105928.xml | 8 -
.../trickplay/trickplay_20211013105940.xml | 9 --
.../trickplay/trickplay_20211013105959.xml | 11 --
.../trickplay/trickplay_20211013110019.xml | 15 --
.../trickplay/trickplay_20211013110037.xml | 15 --
.../trickplay/trickplay_20211013110049.xml | 15 --
.../trickplay/trickplay_20211013110104.xml | 15 --
.../trickplay/trickplay_20211013110225.xml | 15 --
.../trickplay/trickplay_20211013110317.xml | 15 --
.../trickplay/trickplay_20211013110331.xml | 15 --
.../trickplay/trickplay_20211013110335.xml | 15 --
.../trickplay/trickplay_20211013110343.xml | 15 --
.../trickplay/trickplay_20211013110709.xml | 15 --
.../trickplay/trickplay_20211013110830.xml | 15 --
.../trickplay/trickplay_20211013110853.xml | 15 --
.../trickplay/trickplay_20211013110857.xml | 15 --
.../trickplay/trickplay_20211013110936.xml | 16 --
.../trickplay/trickplay_20211013111004.xml | 16 --
.../trickplay/trickplay_20211013111014.xml | 16 --
.../trickplay/trickplay_20211013111030.xml | 16 --
.../trickplay/trickplay_20211013111143.xml | 16 --
.../trickplay/trickplay_20211013111202.xml | 16 --
.../trickplay/trickplay_20211013111214.xml | 18 ---
.../trickplay/trickplay_20211013111237.xml | 18 ---
.../trickplay/trickplay_20211013111254.xml | 20 ---
.../trickplay/trickplay_20211013111726.xml | 20 ---
.../trickplay/trickplay_20211013111834.xml | 20 ---
.../trickplay/trickplay_20211013111845.xml | 18 ---
.../trickplay/trickplay_20211013111942.xml | 18 ---
.../trickplay/trickplay_20211013112043.xml | 18 ---
.../trickplay/trickplay_20211013113737.xml | 18 ---
.../trickplay/trickplay_20211013113755.xml | 18 ---
.../trickplay/trickplay_20211013113757.xml | 18 ---
.../trickplay/trickplay_20211013114712.xml | 18 ---
.vscode/launch.json | 19 ---
components/trickplay/TrickPlay.xml | 2 +-
images/blackleft.png | Bin 0 -> 1535 bytes
images/blackpause.png | Bin 562 -> 2512 bytes
images/blackright.png | Bin 310 -> 1560 bytes
images/whiteleft.png | Bin 0 -> 1432 bytes
images/whitepause.png | Bin 592 -> 2578 bytes
images/whiteright.png | Bin 298 -> 1421 bytes
743 files changed, 1 insertion(+), 60757 deletions(-)
delete mode 100644 .clj-kondo/.cache/2021.09.25/lock
delete mode 100644 .history/.gitignore_20211008145905
delete mode 100644 .history/.gitignore_20211010133726
delete mode 100644 .history/.gitignore_20211011133958
delete mode 100644 .history/.gitignore_20211011134525
delete mode 100644 .history/components/MainScreen_20161215154627.xml
delete mode 100644 .history/components/MainScreen_20211011143248.xml
delete mode 100644 .history/components/Play_20211012131737.brs
delete mode 100644 .history/components/Play_20211012131808.brs
delete mode 100644 .history/components/Play_20211012131900.brs
delete mode 100644 .history/components/keyboardScene_20211012131932.brs
delete mode 100644 .history/components/keyboardScene_20211012132158.brs
delete mode 100644 .history/components/keyboardScene_20211012133530.brs
delete mode 100644 .history/components/keyboardScene_20211012133904.brs
delete mode 100644 .history/components/keyboardScene_20211012134451.brs
delete mode 100644 .history/components/keyboardScene_20211012134544.brs
delete mode 100644 .history/components/keyboardScene_20211012134647.brs
delete mode 100644 .history/components/keyboardScene_20211012134937.brs
delete mode 100644 .history/components/keyboardScene_20211012135037.brs
delete mode 100644 .history/components/keyboardScene_20211012135227.brs
delete mode 100644 .history/components/keyboardScene_20211012135232.brs
delete mode 100644 .history/components/keyboardScene_20211012135345.brs
delete mode 100644 .history/components/keyboardScene_20211012135459.brs
delete mode 100644 .history/components/keyboardScene_20211012135654.brs
delete mode 100644 .history/components/keyboardScene_20211012135833.brs
delete mode 100644 .history/components/keyboardScene_20211012135835.brs
delete mode 100644 .history/components/keyboardScene_20211012135845.brs
delete mode 100644 .history/components/keyboardScene_20211012135848.brs
delete mode 100644 .history/components/keyboardScene_20211012135849.brs
delete mode 100644 .history/components/keyboardScene_20211012140044.brs
delete mode 100644 .history/components/keyboardScene_20211012140310.brs
delete mode 100644 .history/components/keyboardScene_20211012140322.brs
delete mode 100644 .history/components/keyboardScene_20211012140753.brs
delete mode 100644 .history/components/keyboardScene_20211012140755.brs
delete mode 100644 .history/components/keyboardScene_20211012140756.brs
delete mode 100644 .history/components/keyboardScene_20211012140816.brs
delete mode 100644 .history/components/keyboardScene_20211012140911.brs
delete mode 100644 .history/components/keyboardScene_20211012140929.brs
delete mode 100644 .history/components/keyboardScene_20211012140932.brs
delete mode 100644 .history/components/keyboardScene_20211012140933.brs
delete mode 100644 .history/components/keyboardScene_20211012140937.brs
delete mode 100644 .history/components/keyboardScene_20211012141120.brs
delete mode 100644 .history/components/keyboardScene_20211012141140.brs
delete mode 100644 .history/components/keyboardScene_20211012141147.brs
delete mode 100644 .history/components/keyboardScene_20211012141326.brs
delete mode 100644 .history/components/keyboardScene_20211012141443.brs
delete mode 100644 .history/components/keyboardScene_20211012141637.brs
delete mode 100644 .history/components/keyboardScene_20211012141641.brs
delete mode 100644 .history/components/keyboardScene_20211012141813.brs
delete mode 100644 .history/components/keyboardScene_20211012141843.brs
delete mode 100644 .history/components/keyboardScene_20211012141913.brs
delete mode 100644 .history/components/keyboardScene_20211012141947.brs
delete mode 100644 .history/components/keyboardScene_20211012142027.brs
delete mode 100644 .history/components/keyboardScene_20211012142112.brs
delete mode 100644 .history/components/keyboardScene_20211012142206.brs
delete mode 100644 .history/components/keyboardScene_20211012142301.brs
delete mode 100644 .history/components/keyboardScene_20211012142428.brs
delete mode 100644 .history/components/keyboardScene_20211012142431.brs
delete mode 100644 .history/components/keyboardScene_20211012142554.brs
delete mode 100644 .history/components/keyboardScene_20211012142834.brs
delete mode 100644 .history/components/keyboardScene_20211012142946.brs
delete mode 100644 .history/components/keyboardScene_20211012143030.brs
delete mode 100644 .history/components/keyboardScene_20211012143106.brs
delete mode 100644 .history/components/keyboardScene_20211012143144.brs
delete mode 100644 .history/components/keyboardScene_20211012143255.brs
delete mode 100644 .history/components/keyboardScene_20211012143425.brs
delete mode 100644 .history/components/keyboardScene_20211012143432.brs
delete mode 100644 .history/components/keyboardScene_20211012143506.brs
delete mode 100644 .history/components/keyboardScene_20211012143547.brs
delete mode 100644 .history/components/keyboardScene_20211012143803.brs
delete mode 100644 .history/components/keyboardScene_20211012143849.brs
delete mode 100644 .history/components/keyboardScene_20211012144059.brs
delete mode 100644 .history/components/keyboardScene_20211012144148.brs
delete mode 100644 .history/components/keyboardScene_20211012144149.brs
delete mode 100644 .history/components/keyboardScene_20211012144401.brs
delete mode 100644 .history/components/keyboardScene_20211012144506.brs
delete mode 100644 .history/components/keyboardScene_20211012144537.brs
delete mode 100644 .history/components/keyboardScene_20211012144610.brs
delete mode 100644 .history/components/keyboardScene_20211012144744.brs
delete mode 100644 .history/components/keyboardScene_20211012144754.brs
delete mode 100644 .history/components/keyboardScene_20211012144806.brs
delete mode 100644 .history/components/keyboardScene_20211012144812.brs
delete mode 100644 .history/components/keyboardScene_20211012144825.brs
delete mode 100644 .history/components/keyboardScene_20211012145038.brs
delete mode 100644 .history/components/keyboardScene_20211012145051.brs
delete mode 100644 .history/components/keyboardScene_20211012145100.brs
delete mode 100644 .history/components/keyboardScene_20211012145914.brs
delete mode 100644 .history/components/keyboardScene_20211012145926.brs
delete mode 100644 .history/components/keyboardScene_20211012150040.brs
delete mode 100644 .history/components/keyboardScene_20211012150053.brs
delete mode 100644 .history/components/keyboardScene_20211012150212.brs
delete mode 100644 .history/components/keyboardScene_20211012150318.brs
delete mode 100644 .history/components/keyboardScene_20211012150319.brs
delete mode 100644 .history/components/keyboardScene_20211012150416.brs
delete mode 100644 .history/components/keyboardScene_20211012150424.brs
delete mode 100644 .history/components/keyboardScene_20211012150555.brs
delete mode 100644 .history/components/keyboardScene_20211012150601.brs
delete mode 100644 .history/components/keyboardScene_20211012150644.brs
delete mode 100644 .history/components/keyboardScene_20211012150915.brs
delete mode 100644 .history/components/keyboardScene_20211012150920.brs
delete mode 100644 .history/components/keyboardScene_20211012151005.brs
delete mode 100644 .history/components/keyboardScene_20211012151105.brs
delete mode 100644 .history/components/keyboardScene_20211012151115.brs
delete mode 100644 .history/components/keyboardScene_20211012151125.brs
delete mode 100644 .history/components/keyboardScene_20211012151129.brs
delete mode 100644 .history/components/keyboardScene_20211012151328.brs
delete mode 100644 .history/components/keyboardScene_20211012151452.brs
delete mode 100644 .history/components/keyboardScene_20211012151718.brs
delete mode 100644 .history/components/keyboardScene_20211012151724.brs
delete mode 100644 .history/components/keyboardScene_20211012151741.brs
delete mode 100644 .history/components/keyboardScene_20211012151753.brs
delete mode 100644 .history/components/keyboardScene_20211012151815.brs
delete mode 100644 .history/components/keyboardScene_20211012151941.brs
delete mode 100644 .history/components/keyboardScene_20211012151947.brs
delete mode 100644 .history/components/keyboardScene_20211012152121.brs
delete mode 100644 .history/components/keyboardScene_20211012152125.brs
delete mode 100644 .history/components/keyboardScene_20211012152229.brs
delete mode 100644 .history/components/keyboardScene_20211012152237.brs
delete mode 100644 .history/components/keyboardScene_20211012152352.brs
delete mode 100644 .history/components/keyboardScene_20211012152354.brs
delete mode 100644 .history/components/keyboardScene_20211012152507.brs
delete mode 100644 .history/components/keyboardScene_20211012152518.brs
delete mode 100644 .history/components/keyboardScene_20211012152520.brs
delete mode 100644 .history/components/keyboardScene_20211013084544.brs
delete mode 100644 .history/components/keyboardScene_20211013084609.brs
delete mode 100644 .history/components/keyboardScene_20211013084830.brs
delete mode 100644 .history/components/keyboardScene_20211013084919.brs
delete mode 100644 .history/components/keyboardScene_20211013084931.brs
delete mode 100644 .history/components/keyboardScene_20211013084953.brs
delete mode 100644 .history/components/keyboardScene_20211013085016.brs
delete mode 100644 .history/components/keyboardScene_20211013085019.brs
delete mode 100644 .history/components/keyboardScene_20211013085029.brs
delete mode 100644 .history/components/keyboardScene_20211013085134.brs
delete mode 100644 .history/components/keyboardScene_20211013085212.brs
delete mode 100644 .history/components/keyboardScene_20211013085303.brs
delete mode 100644 .history/components/keyboardScene_20211013085427.brs
delete mode 100644 .history/components/keyboardScene_20211013085504.brs
delete mode 100644 .history/components/keyboardScene_20211013085622.brs
delete mode 100644 .history/components/keyboardScene_20211013085645.brs
delete mode 100644 .history/components/keyboardScene_20211013085719.brs
delete mode 100644 .history/components/keyboardScene_20211013085937.brs
delete mode 100644 .history/components/keyboardScene_20211013085941.brs
delete mode 100644 .history/components/keyboardScene_20211013090029.brs
delete mode 100644 .history/components/keyboardScene_20211013090032.brs
delete mode 100644 .history/components/keyboardScene_20211013090124.brs
delete mode 100644 .history/components/keyboardScene_20211013090236.brs
delete mode 100644 .history/components/keyboardScene_20211013090237.brs
delete mode 100644 .history/components/keyboardScene_20211013090246.brs
delete mode 100644 .history/components/keyboardScene_20211013090357.brs
delete mode 100644 .history/components/keyboardScene_20211013090424.brs
delete mode 100644 .history/components/keyboardScene_20211013090428.brs
delete mode 100644 .history/components/keyboardScene_20211013090430.brs
delete mode 100644 .history/components/keyboardScene_20211013090606.brs
delete mode 100644 .history/components/keyboardScene_20211013090650.brs
delete mode 100644 .history/components/keyboardScene_20211013091239.brs
delete mode 100644 .history/components/keyboardScene_20211013091250.brs
delete mode 100644 .history/components/keyboardScene_20211013091409.brs
delete mode 100644 .history/components/keyboardScene_20211013091433.brs
delete mode 100644 .history/components/keyboardScene_20211013091435.brs
delete mode 100644 .history/components/keyboardScene_20211013091614.brs
delete mode 100644 .history/components/keyboardScene_20211013091744.brs
delete mode 100644 .history/components/keyboardScene_20211013091801.brs
delete mode 100644 .history/components/keyboardScene_20211013091824.brs
delete mode 100644 .history/components/keyboardScene_20211013091843.brs
delete mode 100644 .history/components/keyboardScene_20211013092139.brs
delete mode 100644 .history/components/keyboardScene_20211013092550.brs
delete mode 100644 .history/components/keyboardScene_20211013092609.brs
delete mode 100644 .history/components/keyboardScene_20211013092733.brs
delete mode 100644 .history/components/keyboardScene_20211013092747.brs
delete mode 100644 .history/components/keyboardScene_20211013093145.brs
delete mode 100644 .history/components/keyboardScene_20211013093216.brs
delete mode 100644 .history/components/keyboardScene_20211013093416.brs
delete mode 100644 .history/components/keyboardScene_20211013093425.brs
delete mode 100644 .history/components/keyboardScene_20211013093427.brs
delete mode 100644 .history/components/keyboardScene_20211013093435.brs
delete mode 100644 .history/components/keyboardScene_20211013093609.brs
delete mode 100644 .history/components/keyboardScene_20211013093716.brs
delete mode 100644 .history/components/keyboardScene_20211013093742.brs
delete mode 100644 .history/components/keyboardScene_20211013093901.brs
delete mode 100644 .history/components/keyboardScene_20211013094038.brs
delete mode 100644 .history/components/keyboardScene_20211013094149.brs
delete mode 100644 .history/components/keyboardScene_20211013094200.brs
delete mode 100644 .history/components/keyboardScene_20211013094215.brs
delete mode 100644 .history/components/keyboardScene_20211013094311.brs
delete mode 100644 .history/components/keyboardScene_20211013094327.brs
delete mode 100644 .history/components/keyboardScene_20211013094446.brs
delete mode 100644 .history/components/keyboardScene_20211013094518.brs
delete mode 100644 .history/components/keyboardScene_20211013094725.brs
delete mode 100644 .history/components/keyboardScene_20211013094755.brs
delete mode 100644 .history/components/keyboardScene_20211013094801.brs
delete mode 100644 .history/components/keyboardScene_20211013094955.brs
delete mode 100644 .history/components/keyboardScene_20211013095125.brs
delete mode 100644 .history/components/keyboardScene_20211013095129.brs
delete mode 100644 .history/components/keyboardScene_20211013095302.brs
delete mode 100644 .history/components/keyboardScene_20211013095309.brs
delete mode 100644 .history/components/keyboardScene_20211013095313.brs
delete mode 100644 .history/components/keyboardScene_20211013095352.brs
delete mode 100644 .history/components/keyboardScene_20211013095507.brs
delete mode 100644 .history/components/keyboardScene_20211013095619.brs
delete mode 100644 .history/components/keyboardScene_20211013095915.brs
delete mode 100644 .history/components/keyboardScene_20211013100109.brs
delete mode 100644 .history/components/keyboardScene_20211013100114.brs
delete mode 100644 .history/components/keyboardScene_20211013100321.brs
delete mode 100644 .history/components/keyboardScene_20211013100413.brs
delete mode 100644 .history/components/keyboardScene_20211013100611.brs
delete mode 100644 .history/components/keyboardScene_20211013100704.brs
delete mode 100644 .history/components/keyboardScene_20211013100732.brs
delete mode 100644 .history/components/keyboardScene_20211013100741.brs
delete mode 100644 .history/components/keyboardScene_20211013101010.brs
delete mode 100644 .history/components/keyboardScene_20211013101053.brs
delete mode 100644 .history/components/keyboardScene_20211013101209.brs
delete mode 100644 .history/components/keyboardScene_20211013101219.brs
delete mode 100644 .history/components/keyboardScene_20211013101612.brs
delete mode 100644 .history/components/keyboardScene_20211013101628.brs
delete mode 100644 .history/components/keyboardScene_20211013101701.brs
delete mode 100644 .history/components/keyboardScene_20211013101702.brs
delete mode 100644 .history/components/keyboardScene_20211013101804.brs
delete mode 100644 .history/components/keyboardScene_20211013101906.brs
delete mode 100644 .history/components/keyboardScene_20211013102044.brs
delete mode 100644 .history/components/keyboardScene_20211013102050.brs
delete mode 100644 .history/components/keyboardScene_20211013102112.brs
delete mode 100644 .history/components/keyboardScene_20211013102231.brs
delete mode 100644 .history/components/keyboardScene_20211013102345.brs
delete mode 100644 .history/components/keyboardScene_20211013102451.brs
delete mode 100644 .history/components/keyboardScene_20211013102459.brs
delete mode 100644 .history/components/keyboardScene_20211013102726.brs
delete mode 100644 .history/components/keyboardScene_20211013102731.brs
delete mode 100644 .history/components/keyboardScene_20211013102735.brs
delete mode 100644 .history/components/keyboardScene_20211013102942.brs
delete mode 100644 .history/components/keyboardScene_20211013103048.brs
delete mode 100644 .history/components/keyboardScene_20211013103053.brs
delete mode 100644 .history/components/keyboardScene_20211013103117.brs
delete mode 100644 .history/components/keyboardScene_20211013103253.brs
delete mode 100644 .history/components/keyboardScene_20211013103329.brs
delete mode 100644 .history/components/keyboardScene_20211013103340.brs
delete mode 100644 .history/components/keyboardScene_20211013103508.brs
delete mode 100644 .history/components/keyboardScene_20211013103610.brs
delete mode 100644 .history/components/keyboardScene_20211013103822.brs
delete mode 100644 .history/components/keyboardScene_20211013104007.brs
delete mode 100644 .history/components/keyboardScene_20211013104125.brs
delete mode 100644 .history/components/keyboardScene_20211013104129.brs
delete mode 100644 .history/components/keyboardScene_20211013104607.brs
delete mode 100644 .history/components/keyboardScene_20211013111804.brs
delete mode 100644 .history/components/keyboardScene_20211013112056.brs
delete mode 100644 .history/components/keyboardScene_20211013112130.brs
delete mode 100644 .history/components/keyboardScene_20211013112734.brs
delete mode 100644 .history/components/keyboardScene_20211013112809.brs
delete mode 100644 .history/components/keyboardScene_20211013112832.brs
delete mode 100644 .history/components/keyboardScene_20211013112904.brs
delete mode 100644 .history/components/keyboardScene_20211013112911.brs
delete mode 100644 .history/components/keyboardScene_20211013112916.brs
delete mode 100644 .history/components/keyboardScene_20211013112931.brs
delete mode 100644 .history/components/keyboardScene_20211013112957.brs
delete mode 100644 .history/components/keyboardScene_20211013113346.brs
delete mode 100644 .history/components/keyboardScene_20211013113353.brs
delete mode 100644 .history/components/keyboardScene_20211013113420.brs
delete mode 100644 .history/components/keyboardScene_20211013113430.brs
delete mode 100644 .history/components/keyboardScene_20211013113434.brs
delete mode 100644 .history/components/keyboardScene_20211013113448.brs
delete mode 100644 .history/components/keyboardScene_20211013113930.brs
delete mode 100644 .history/components/keyboardScene_20211013114149.brs
delete mode 100644 .history/components/keyboardScene_20211013114208.brs
delete mode 100644 .history/components/keyboardScene_20211013114259.brs
delete mode 100644 .history/components/keyboardScene_20211013114359.brs
delete mode 100644 .history/components/keyboardScene_20211013114558.brs
delete mode 100644 .history/components/keyboardScene_20211013114601.brs
delete mode 100644 .history/components/keyboardScene_20211013114638.brs
delete mode 100644 .history/components/keyboardScene_20211013114900.brs
delete mode 100644 .history/components/keyboardScene_20211013114903.brs
delete mode 100644 .history/components/keyboardScene_20211013114922.brs
delete mode 100644 .history/components/keyboardScene_20211013114926.brs
delete mode 100644 .history/components/keyboardScene_20211013115137.brs
delete mode 100644 .history/components/keyboardScene_20211013115148.brs
delete mode 100644 .history/components/keyboardScene_20211013115449.brs
delete mode 100644 .history/components/keyboardScene_20211013115508.brs
delete mode 100644 .history/components/keyboardScene_20211013115641.brs
delete mode 100644 .history/components/keyboardScene_20211013115642.brs
delete mode 100644 .history/components/keyboardScene_20211013120029.brs
delete mode 100644 .history/components/keyboardScene_20211013120221.brs
delete mode 100644 .history/components/keyboardScene_20211013120222.brs
delete mode 100644 .history/components/keyboardScene_20211013120224.brs
delete mode 100644 .history/components/keyboardScene_20211013120310.brs
delete mode 100644 .history/components/keyboardScene_20211013120433.brs
delete mode 100644 .history/components/keyboardScene_20211013120455.brs
delete mode 100644 .history/components/keyboardScene_20211013120556.brs
delete mode 100644 .history/components/keyboardScene_20211013120716.brs
delete mode 100644 .history/components/keyboardScene_20211013120749.brs
delete mode 100644 .history/components/keyboardScene_20211013120941.brs
delete mode 100644 .history/components/keyboardScene_20211013120950.brs
delete mode 100644 .history/components/keyboardScene_20211013121009.brs
delete mode 100644 .history/components/keyboardScene_20211013121301.brs
delete mode 100644 .history/components/keyboardScene_20211013121308.brs
delete mode 100644 .history/components/keyboardScene_20211013121430.brs
delete mode 100644 .history/components/keyboardScene_20211013121510.brs
delete mode 100644 .history/components/keyboardScene_20211013121513.brs
delete mode 100644 .history/components/keyboardScene_20211013121642.brs
delete mode 100644 .history/components/keyboardScene_20211013121733.brs
delete mode 100644 .history/components/keyboardScene_20211013121813.brs
delete mode 100644 .history/components/keyboardScene_20211013121920.brs
delete mode 100644 .history/components/keyboardScene_20211013122052.brs
delete mode 100644 .history/components/keyboardScene_20211013122203.brs
delete mode 100644 .history/components/keyboardScene_20211013122255.brs
delete mode 100644 .history/components/keyboardScene_20211013122346.brs
delete mode 100644 .history/components/keyboardScene_20211013122751.brs
delete mode 100644 .history/components/keyboardScene_20211013122827.brs
delete mode 100644 .history/components/keyboardScene_20211013122956.brs
delete mode 100644 .history/components/keyboardScene_20211013123106.brs
delete mode 100644 .history/components/keyboardScene_20211013123338.brs
delete mode 100644 .history/components/keyboardScene_20211013123348.brs
delete mode 100644 .history/components/keyboardScene_20211013123553.brs
delete mode 100644 .history/components/keyboardScene_20211013123635.brs
delete mode 100644 .history/components/keyboardScene_20211013123640.brs
delete mode 100644 .history/components/keyboardScene_20211013123711.brs
delete mode 100644 .history/components/keyboardScene_20211013123930.brs
delete mode 100644 .history/components/keyboardScene_20211013123941.brs
delete mode 100644 .history/components/keyboardScene_20211013124048.brs
delete mode 100644 .history/components/keyboardScene_20211013124103.brs
delete mode 100644 .history/components/keyboardScene_20211013124315.brs
delete mode 100644 .history/components/keyboardScene_20211013124342.brs
delete mode 100644 .history/components/keyboardScene_20211013124356.brs
delete mode 100644 .history/components/keyboardScene_20211013124407.brs
delete mode 100644 .history/components/keyboardScene_20211013124600.brs
delete mode 100644 .history/components/keyboardScene_20211013124601.brs
delete mode 100644 .history/components/keyboardScene_20211013124605.brs
delete mode 100644 .history/components/keyboardScene_20211013124801.brs
delete mode 100644 .history/components/keyboardScene_20211013124803.brs
delete mode 100644 .history/components/keyboardScene_20211013124813.brs
delete mode 100644 .history/components/keyboardScene_20211013124917.brs
delete mode 100644 .history/components/keyboardScene_20211013125042.brs
delete mode 100644 .history/components/keyboardScene_20211013125125.brs
delete mode 100644 .history/components/keyboardScene_20211013125245.brs
delete mode 100644 .history/components/keyboardScene_20211013125422.brs
delete mode 100644 .history/components/keyboardScene_20211013125550.brs
delete mode 100644 .history/components/keyboardScene_20211013125740.brs
delete mode 100644 .history/components/keyboardScene_20211013125813.brs
delete mode 100644 .history/components/keyboardScene_20211013130232.brs
delete mode 100644 .history/components/keyboardScene_20211013130255.brs
delete mode 100644 .history/components/keyboardScene_20211013130450.brs
delete mode 100644 .history/components/keyboardScene_20211013130504.brs
delete mode 100644 .history/components/keyboardScene_20211013130610.brs
delete mode 100644 .history/components/keyboardScene_20211013130615.brs
delete mode 100644 .history/components/keyboardScene_20211013130800.brs
delete mode 100644 .history/components/keyboardScene_20211013130841.brs
delete mode 100644 .history/components/keyboardScene_20211013130923.brs
delete mode 100644 .history/components/keyboardScene_20211013131007.brs
delete mode 100644 .history/components/keyboardScene_20211013131022.brs
delete mode 100644 .history/components/keyboardScene_20211013131110.brs
delete mode 100644 .history/components/keyboardScene_20211013131111.brs
delete mode 100644 .history/components/keyboardScene_20211013131430.brs
delete mode 100644 .history/components/keyboardScene_20211013131507.brs
delete mode 100644 .history/components/keyboardScene_20211013131514.brs
delete mode 100644 .history/components/keyboardScene_20211013131516.brs
delete mode 100644 .history/components/keyboardScene_20211013131537.brs
delete mode 100644 .history/components/keyboardScene_20211013131756.brs
delete mode 100644 .history/components/keyboardScene_20211013131908.brs
delete mode 100644 .history/components/keyboardScene_20211013131909.brs
delete mode 100644 .history/components/keyboardScene_20211013131944.brs
delete mode 100644 .history/components/keyboardScene_20211013132015.brs
delete mode 100644 .history/components/keyboardScene_20211013132042.brs
delete mode 100644 .history/components/keyboardScene_20211013132113.brs
delete mode 100644 .history/components/keyboardScene_20211013132154.brs
delete mode 100644 .history/components/keyboardScene_20211013132231.brs
delete mode 100644 .history/components/keyboardScene_20211013132325.brs
delete mode 100644 .history/components/keyboardScene_20211013132328.brs
delete mode 100644 .history/components/keyboardScene_20211013132822.brs
delete mode 100644 .history/components/keyboardScene_20211013132836.brs
delete mode 100644 .history/components/keyboardScene_20211013132919.brs
delete mode 100644 .history/components/keyboardScene_20211013132923.brs
delete mode 100644 .history/components/keyboardScene_20211013133140.brs
delete mode 100644 .history/components/keyboardScene_20211013133235.brs
delete mode 100644 .history/components/keyboardScene_20211013133307.brs
delete mode 100644 .history/components/keyboardScene_20211013133351.brs
delete mode 100644 .history/components/keyboardScene_20211013133354.brs
delete mode 100644 .history/components/keyboardScene_20211013133416.brs
delete mode 100644 .history/components/keyboardScene_20211013133531.brs
delete mode 100644 .history/components/keyboardScene_20211013133535.brs
delete mode 100644 .history/components/keyboardScene_20211013133645.brs
delete mode 100644 .history/components/keyboardScene_20211013133851.brs
delete mode 100644 .history/components/keyboardScene_20211013133853.brs
delete mode 100644 .history/components/keyboardScene_20211013133936.brs
delete mode 100644 .history/components/keyboardScene_20211013134505.brs
delete mode 100644 .history/components/keyboardScene_20211013134544.brs
delete mode 100644 .history/components/keyboardScene_20211013134546.brs
delete mode 100644 .history/components/keyboardScene_20211013134551.brs
delete mode 100644 .history/components/keyboardScene_20211013134614.brs
delete mode 100644 .history/components/keyboardScene_20211013134659.brs
delete mode 100644 .history/components/keyboardScene_20211013134857.brs
delete mode 100644 .history/components/keyboardScene_20211013134858.brs
delete mode 100644 .history/components/keyboardScene_20211013134903.brs
delete mode 100644 .history/components/keyboardScene_20211013134949.brs
delete mode 100644 .history/components/keyboardScene_20211013135052.brs
delete mode 100644 .history/components/keyboardScene_20211013135201.brs
delete mode 100644 .history/components/keyboardScene_20211013135245.brs
delete mode 100644 .history/components/keyboardScene_20211013135311.brs
delete mode 100644 .history/components/keyboardScene_20211013135323.brs
delete mode 100644 .history/components/keyboardScene_20211013135421.brs
delete mode 100644 .history/components/keyboardScene_20211013135423.brs
delete mode 100644 .history/components/keyboardScene_20211013135438.brs
delete mode 100644 .history/components/keyboardScene_20211013135941.brs
delete mode 100644 .history/components/keyboardScene_20211013140045.brs
delete mode 100644 .history/components/keyboardScene_20211013140050.brs
delete mode 100644 .history/components/keyboardScene_20211013140143.brs
delete mode 100644 .history/components/keyboardScene_20211013140205.brs
delete mode 100644 .history/components/keyboardScene_20211013140225.brs
delete mode 100644 .history/components/keyboardScene_20211013140252.brs
delete mode 100644 .history/components/keyboardScene_20211013140501.brs
delete mode 100644 .history/components/keyboardScene_20211013140635.brs
delete mode 100644 .history/components/keyboardScene_20211013140749.brs
delete mode 100644 .history/components/keyboardScene_20211013140847.brs
delete mode 100644 .history/components/keyboardScene_20211013141218.brs
delete mode 100644 .history/components/keyboardScene_20211013142600.brs
delete mode 100644 .history/components/keyboardScene_20211013142605.brs
delete mode 100644 .history/components/keyboardScene_20211013143004.brs
delete mode 100644 .history/components/keyboardScene_20211013143124.brs
delete mode 100644 .history/components/keyboardScene_20211013143327.brs
delete mode 100644 .history/components/keyboardScene_20211013143425.brs
delete mode 100644 .history/components/keyboardScene_20211013143546.brs
delete mode 100644 .history/components/keyboardScene_20211013144033.brs
delete mode 100644 .history/components/keyboardScene_20211013144219.brs
delete mode 100644 .history/components/keyboardScene_20211013144311.brs
delete mode 100644 .history/components/keyboardScene_20211013144317.brs
delete mode 100644 .history/components/keyboardScene_20211013144410.brs
delete mode 100644 .history/components/keyboardScene_20211013144558.brs
delete mode 100644 .history/components/keyboardScene_20211013144626.brs
delete mode 100644 .history/components/keyboardScene_20211013144935.brs
delete mode 100644 .history/components/keyboardScene_20211013144950.brs
delete mode 100644 .history/components/keyboardScene_20211013145019.brs
delete mode 100644 .history/components/keyboardScene_20211013145139.brs
delete mode 100644 .history/components/keyboardScene_20211013145506.brs
delete mode 100644 .history/components/keyboardScene_20211013145513.brs
delete mode 100644 .history/components/keyboardScene_20211013145610.brs
delete mode 100644 .history/components/keyboardScene_20211013145626.brs
delete mode 100644 .history/components/keyboardScene_20211013145743.brs
delete mode 100644 .history/components/keyboardScene_20211013145848.brs
delete mode 100644 .history/components/keyboardScene_20211013145849.brs
delete mode 100644 .history/components/keyboardScene_20211013145926.brs
delete mode 100644 .history/components/keyboardScene_20211013150159.brs
delete mode 100644 .history/components/keyboardScene_20211013150327.brs
delete mode 100644 .history/components/keyboardScene_20211013150822.brs
delete mode 100644 .history/components/keyboardScene_20211013151157.brs
delete mode 100644 .history/components/play_20211012131733.xml
delete mode 100644 .history/components/play_20211012131742.xml
delete mode 100644 .history/components/rowListContent_20211008145905.brs
delete mode 100644 .history/components/rowListContent_20211010122436.xml
delete mode 100644 .history/components/rowListContent_20211010122446.brs
delete mode 100644 .history/components/rowListContent_20211010122452.xml
delete mode 100644 .history/components/rowListContent_20211011134627.xml
delete mode 100644 .history/components/rowListContent_20211012145223.xml
delete mode 100644 .history/components/rowListItem_20211010122403.xml
delete mode 100644 .history/components/rowListItem_20211010122413.xml
delete mode 100644 .history/components/rowListItem_20211010122425.xml
delete mode 100644 .history/components/rowListItem_20211011134635.xml
delete mode 100644 .history/components/rowListItem_20211012145217.xml
delete mode 100644 .history/components/rowListScene_20211008145905.brs
delete mode 100644 .history/components/rowListScene_20211008145905.xml
delete mode 100644 .history/components/rowListScene_20211008145927.xml
delete mode 100644 .history/components/rowListScene_20211008150133.xml
delete mode 100644 .history/components/rowListScene_20211008150134.xml
delete mode 100644 .history/components/rowListScene_20211008150139.xml
delete mode 100644 .history/components/rowListScene_20211008150146.xml
delete mode 100644 .history/components/rowListScene_20211008150412.brs
delete mode 100644 .history/components/rowListScene_20211008150439.brs
delete mode 100644 .history/components/rowListScene_20211008150452.brs
delete mode 100644 .history/components/rowListScene_20211008150508.brs
delete mode 100644 .history/components/rowListScene_20211008150514.brs
delete mode 100644 .history/components/rowListScene_20211008150559.brs
delete mode 100644 .history/components/rowListScene_20211008150612.brs
delete mode 100644 .history/components/rowListScene_20211008150619.brs
delete mode 100644 .history/components/rowListScene_20211008150659.brs
delete mode 100644 .history/components/rowListScene_20211008150803.brs
delete mode 100644 .history/components/rowListScene_20211008150813.brs
delete mode 100644 .history/components/rowListScene_20211008150839.brs
delete mode 100644 .history/components/rowListScene_20211008150851.brs
delete mode 100644 .history/components/rowListScene_20211008150910.brs
delete mode 100644 .history/components/rowListScene_20211008150944.brs
delete mode 100644 .history/components/rowListScene_20211008151000.brs
delete mode 100644 .history/components/rowListScene_20211008151026.brs
delete mode 100644 .history/components/rowListScene_20211008151203.xml
delete mode 100644 .history/components/rowListScene_20211008151217.brs
delete mode 100644 .history/components/rowListScene_20211008151221.xml
delete mode 100644 .history/components/rowListScene_20211008151233.brs
delete mode 100644 .history/components/rowListScene_20211008151244.brs
delete mode 100644 .history/components/rowListScene_20211008151305.brs
delete mode 100644 .history/components/rowListScene_20211008151346.xml
delete mode 100644 .history/components/rowListScene_20211008151554.brs
delete mode 100644 .history/components/rowListScene_20211008151601.xml
delete mode 100644 .history/components/rowListScene_20211008151608.brs
delete mode 100644 .history/components/rowListScene_20211008151648.brs
delete mode 100644 .history/components/rowListScene_20211008151716.brs
delete mode 100644 .history/components/rowListScene_20211008151748.brs
delete mode 100644 .history/components/rowListScene_20211008151751.brs
delete mode 100644 .history/components/rowListScene_20211008151753.brs
delete mode 100644 .history/components/rowListScene_20211010122343.xml
delete mode 100644 .history/components/rowListScene_20211010122348.xml
delete mode 100644 .history/components/rowListScene_20211010122743.brs
delete mode 100644 .history/components/rowListScene_20211010122855.brs
delete mode 100644 .history/components/rowListScene_20211010122902.brs
delete mode 100644 .history/components/rowListScene_20211010123116.xml
delete mode 100644 .history/components/rowListScene_20211010123149.brs
delete mode 100644 .history/components/rowListScene_20211010123557.brs
delete mode 100644 .history/components/rowListScene_20211010123606.brs
delete mode 100644 .history/components/rowListScene_20211010123612.brs
delete mode 100644 .history/components/rowListScene_20211010123656.brs
delete mode 100644 .history/components/rowListScene_20211010123711.brs
delete mode 100644 .history/components/rowListScene_20211010123739.brs
delete mode 100644 .history/components/rowListScene_20211010123753.brs
delete mode 100644 .history/components/rowListScene_20211010123754.brs
delete mode 100644 .history/components/rowListScene_20211010123821.brs
delete mode 100644 .history/components/rowListScene_20211010123912.brs
delete mode 100644 .history/components/rowListScene_20211010123926.brs
delete mode 100644 .history/components/rowListScene_20211010124004.brs
delete mode 100644 .history/components/rowListScene_20211010124048.brs
delete mode 100644 .history/components/rowListScene_20211010124059.brs
delete mode 100644 .history/components/rowListScene_20211010124155.brs
delete mode 100644 .history/components/rowListScene_20211010124210.brs
delete mode 100644 .history/components/rowListScene_20211010124225.brs
delete mode 100644 .history/components/rowListScene_20211010124416.brs
delete mode 100644 .history/components/rowListScene_20211010124457.brs
delete mode 100644 .history/components/rowListScene_20211010124504.brs
delete mode 100644 .history/components/rowListScene_20211010124545.brs
delete mode 100644 .history/components/rowListScene_20211010124549.brs
delete mode 100644 .history/components/rowListScene_20211010124817.brs
delete mode 100644 .history/components/rowListScene_20211010124832.brs
delete mode 100644 .history/components/rowListScene_20211010124834.brs
delete mode 100644 .history/components/rowListScene_20211010124838.brs
delete mode 100644 .history/components/rowListScene_20211010124840.brs
delete mode 100644 .history/components/rowListScene_20211010124841.brs
delete mode 100644 .history/components/rowListScene_20211010124855.brs
delete mode 100644 .history/components/rowListScene_20211010124857.brs
delete mode 100644 .history/components/rowListScene_20211010124910.brs
delete mode 100644 .history/components/rowListScene_20211010124917.brs
delete mode 100644 .history/components/rowListScene_20211010125016.brs
delete mode 100644 .history/components/rowListScene_20211010125023.brs
delete mode 100644 .history/components/rowListScene_20211010125035.brs
delete mode 100644 .history/components/rowListScene_20211010125125.brs
delete mode 100644 .history/components/rowListScene_20211010125153.brs
delete mode 100644 .history/components/rowListScene_20211010125251.brs
delete mode 100644 .history/components/rowListScene_20211010125317.brs
delete mode 100644 .history/components/rowListScene_20211010125328.brs
delete mode 100644 .history/components/rowListScene_20211010125350.brs
delete mode 100644 .history/components/rowListScene_20211010125431.brs
delete mode 100644 .history/components/rowListScene_20211010125509.brs
delete mode 100644 .history/components/rowListScene_20211010125709.brs
delete mode 100644 .history/components/rowListScene_20211010125712.brs
delete mode 100644 .history/components/rowListScene_20211010125717.brs
delete mode 100644 .history/components/rowListScene_20211010125756.brs
delete mode 100644 .history/components/rowListScene_20211010125848.brs
delete mode 100644 .history/components/rowListScene_20211010125855.brs
delete mode 100644 .history/components/rowListScene_20211010125904.brs
delete mode 100644 .history/components/rowListScene_20211010130310.brs
delete mode 100644 .history/components/rowListScene_20211010130315.brs
delete mode 100644 .history/components/rowListScene_20211010130435.brs
delete mode 100644 .history/components/rowListScene_20211010130553.brs
delete mode 100644 .history/components/rowListScene_20211010130642.brs
delete mode 100644 .history/components/rowListScene_20211010130800.brs
delete mode 100644 .history/components/rowListScene_20211010130847.brs
delete mode 100644 .history/components/rowListScene_20211010130910.brs
delete mode 100644 .history/components/rowListScene_20211010130927.brs
delete mode 100644 .history/components/rowListScene_20211010131020.brs
delete mode 100644 .history/components/rowListScene_20211010131021.brs
delete mode 100644 .history/components/rowListScene_20211010131044.brs
delete mode 100644 .history/components/rowListScene_20211010131134.brs
delete mode 100644 .history/components/rowListScene_20211010131150.brs
delete mode 100644 .history/components/rowListScene_20211010131237.brs
delete mode 100644 .history/components/rowListScene_20211010131430.brs
delete mode 100644 .history/components/rowListScene_20211010131442.brs
delete mode 100644 .history/components/rowListScene_20211010131514.brs
delete mode 100644 .history/components/rowListScene_20211010131649.brs
delete mode 100644 .history/components/rowListScene_20211010131725.brs
delete mode 100644 .history/components/rowListScene_20211010131734.brs
delete mode 100644 .history/components/rowListScene_20211010132014.brs
delete mode 100644 .history/components/rowListScene_20211010132049.brs
delete mode 100644 .history/components/rowListScene_20211010132232.brs
delete mode 100644 .history/components/rowListScene_20211010132443.brs
delete mode 100644 .history/components/rowListScene_20211010132532.brs
delete mode 100644 .history/components/rowListScene_20211010132545.brs
delete mode 100644 .history/components/rowListScene_20211010132642.brs
delete mode 100644 .history/components/rowListScene_20211010132714.brs
delete mode 100644 .history/components/rowListScene_20211010132739.brs
delete mode 100644 .history/components/rowListScene_20211010132742.brs
delete mode 100644 .history/components/rowListScene_20211010132749.brs
delete mode 100644 .history/components/rowListScene_20211010132943.brs
delete mode 100644 .history/components/rowListScene_20211010132944.brs
delete mode 100644 .history/components/rowListScene_20211010132947.brs
delete mode 100644 .history/components/rowListScene_20211010133121.brs
delete mode 100644 .history/components/rowListScene_20211010133129.brs
delete mode 100644 .history/components/rowListScene_20211010133140.brs
delete mode 100644 .history/components/rowListScene_20211010133142.brs
delete mode 100644 .history/components/rowListScene_20211010133202.brs
delete mode 100644 .history/components/rowListScene_20211010133442.xml
delete mode 100644 .history/components/rowListScene_20211010133449.brs
delete mode 100644 .history/components/rowListScene_20211010133458.brs
delete mode 100644 .history/components/rowListScene_20211011134546.xml
delete mode 100644 .history/components/rowListScene_20211011134642.xml
delete mode 100644 .history/components/rowListScene_20211011134809.xml
delete mode 100644 .history/components/rowListScene_20211011134907.xml
delete mode 100644 .history/components/rowListScene_20211011134920.xml
delete mode 100644 .history/components/rowListScene_20211011135127.xml
delete mode 100644 .history/components/rowListScene_20211011135145.brs
delete mode 100644 .history/components/rowListScene_20211011135201.brs
delete mode 100644 .history/components/rowListScene_20211011135220.xml
delete mode 100644 .history/components/rowListScene_20211011135315.xml
delete mode 100644 .history/components/rowListScene_20211011135328.xml
delete mode 100644 .history/components/rowListScene_20211011135342.xml
delete mode 100644 .history/components/rowListScene_20211011135727.xml
delete mode 100644 .history/components/rowListScene_20211011135742.xml
delete mode 100644 .history/components/rowListScene_20211011135756.xml
delete mode 100644 .history/components/rowListScene_20211011135757.xml
delete mode 100644 .history/components/rowListScene_20211011140317.xml
delete mode 100644 .history/components/rowListScene_20211011140321.xml
delete mode 100644 .history/components/rowListScene_20211011142206.xml
delete mode 100644 .history/components/rowListScene_20211011142420.xml
delete mode 100644 .history/components/rowListScene_20211011142458.xml
delete mode 100644 .history/components/rowListScene_20211011142525.brs
delete mode 100644 .history/components/rowListScene_20211011142610.brs
delete mode 100644 .history/components/rowListScene_20211011142646.brs
delete mode 100644 .history/components/rowListScene_20211011142657.brs
delete mode 100644 .history/components/rowListScene_20211011142700.brs
delete mode 100644 .history/components/rowListScene_20211011143048.brs
delete mode 100644 .history/components/rowListScene_20211011143119.brs
delete mode 100644 .history/components/rowListScene_20211011143203.brs
delete mode 100644 .history/components/rowListScene_20211011143204.brs
delete mode 100644 .history/components/rowListScene_20211011143521.brs
delete mode 100644 .history/components/rowListScene_20211011143557.brs
delete mode 100644 .history/components/rowListScene_20211011144019.xml
delete mode 100644 .history/components/rowListScene_20211011144025.xml
delete mode 100644 .history/components/rowListScene_20211011144115.xml
delete mode 100644 .history/components/rowListScene_20211011144141.xml
delete mode 100644 .history/components/rowListScene_20211011144330.xml
delete mode 100644 .history/components/rowListScene_20211011144343.brs
delete mode 100644 .history/components/rowListScene_20211011144638.brs
delete mode 100644 .history/components/rowListScene_20211011144659.brs
delete mode 100644 .history/components/rowListScene_20211011144718.brs
delete mode 100644 .history/components/rowListScene_20211011151753.xml
delete mode 100644 .history/components/rowListScene_20211011151755.xml
delete mode 100644 .history/components/rowListScene_20211011151829.brs
delete mode 100644 .history/components/rowListScene_20211011151922.xml
delete mode 100644 .history/components/rowListScene_20211011152047.xml
delete mode 100644 .history/components/rowListScene_20211011152054.xml
delete mode 100644 .history/components/rowListScene_20211011152249.xml
delete mode 100644 .history/components/rowListScene_20211011152637.xml
delete mode 100644 .history/components/rowListScene_20211011152704.xml
delete mode 100644 .history/components/rowListScene_20211011152741.brs
delete mode 100644 .history/components/rowListScene_20211011152745.brs
delete mode 100644 .history/components/rowListScene_20211011152820.brs
delete mode 100644 .history/components/rowListScene_20211011154834.xml
delete mode 100644 .history/components/rowListScene_20211011154858.xml
delete mode 100644 .history/components/rowListScene_20211011160212.xml
delete mode 100644 .history/components/rowListScene_20211011160214.xml
delete mode 100644 .history/components/rowListScene_20211011160217.xml
delete mode 100644 .history/components/rowListScene_20211011160729.xml
delete mode 100644 .history/components/rowListScene_20211011160824.xml
delete mode 100644 .history/components/rowListScene_20211011161430.xml
delete mode 100644 .history/components/rowListScene_20211011161441.brs
delete mode 100644 .history/components/rowListScene_20211011161505.xml
delete mode 100644 .history/components/rowListScene_20211011161514.xml
delete mode 100644 .history/components/rowListScene_20211011161556.xml
delete mode 100644 .history/components/rowListScene_20211011161820.brs
delete mode 100644 .history/components/rowListScene_20211011161851.xml
delete mode 100644 .history/components/rowListScene_20211011161853.xml
delete mode 100644 .history/components/rowListScene_20211011161900.xml
delete mode 100644 .history/components/rowListScene_20211011161906.xml
delete mode 100644 .history/components/rowListScene_20211011161926.xml
delete mode 100644 .history/components/rowListScene_20211011163824.xml
delete mode 100644 .history/components/rowListScene_20211011163856.xml
delete mode 100644 .history/components/rowListScene_20211011163858.xml
delete mode 100644 .history/components/rowListScene_20211011163948.xml
delete mode 100644 .history/components/rowListScene_20211011163950.xml
delete mode 100644 .history/components/rowListScene_20211012030439.xml
delete mode 100644 .history/components/rowListScene_20211012030442.xml
delete mode 100644 .history/components/rowListScene_20211012030443.xml
delete mode 100644 .history/components/rowListScene_20211012030617.xml
delete mode 100644 .history/components/rowListScene_20211012030618.xml
delete mode 100644 .history/components/rowListScene_20211012030641.xml
delete mode 100644 .history/components/rowListScene_20211012030736.xml
delete mode 100644 .history/components/rowListScene_20211012030753.xml
delete mode 100644 .history/components/rowListScene_20211012030805.brs
delete mode 100644 .history/components/rowListScene_20211012030811.brs
delete mode 100644 .history/components/rowListScene_20211012031004.xml
delete mode 100644 .history/components/rowListScene_20211012031006.xml
delete mode 100644 .history/components/rowListScene_20211012031011.xml
delete mode 100644 .history/components/rowListScene_20211012031223.brs
delete mode 100644 .history/components/rowListScene_20211012031226.brs
delete mode 100644 .history/components/rowListScene_20211012031230.brs
delete mode 100644 .history/components/rowListScene_20211012031231.brs
delete mode 100644 .history/components/rowListScene_20211012031235.brs
delete mode 100644 .history/components/rowListScene_20211012031408.xml
delete mode 100644 .history/components/rowListScene_20211012032157.xml
delete mode 100644 .history/components/rowListScene_20211012122112.xml
delete mode 100644 .history/components/rowListScene_20211012122632.xml
delete mode 100644 .history/components/rowListScene_20211012122658.xml
delete mode 100644 .history/components/rowListScene_20211012122713.xml
delete mode 100644 .history/components/rowListScene_20211012122732.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013105704.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013105742.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013105805.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013105810.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013105834.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013105854.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013105904.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013105925.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013105928.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013105940.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013105959.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013110019.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013110037.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013110049.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013110104.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013110225.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013110317.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013110331.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013110335.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013110343.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013110709.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013110830.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013110853.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013110857.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013110936.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013111004.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013111014.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013111030.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013111143.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013111202.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013111214.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013111237.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013111254.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013111726.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013111834.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013111845.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013111942.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013112043.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013113737.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013113755.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013113757.xml
delete mode 100644 .history/components/trickplay/trickplay_20211013114712.xml
delete mode 100644 .vscode/launch.json
create mode 100644 images/blackleft.png
create mode 100644 images/whiteleft.png
diff --git a/.clj-kondo/.cache/2021.09.25/lock b/.clj-kondo/.cache/2021.09.25/lock
deleted file mode 100644
index e69de29..0000000
diff --git a/.history/.gitignore_20211008145905 b/.history/.gitignore_20211008145905
deleted file mode 100644
index fa001aa..0000000
--- a/.history/.gitignore_20211008145905
+++ /dev/null
@@ -1,2 +0,0 @@
-out/
-out/roku-deploy.zip
diff --git a/.history/.gitignore_20211010133726 b/.history/.gitignore_20211010133726
deleted file mode 100644
index a2a1892..0000000
--- a/.history/.gitignore_20211010133726
+++ /dev/null
@@ -1,4 +0,0 @@
-out/
-out/roku-deploy.zip
-.history/
-.vscode
\ No newline at end of file
diff --git a/.history/.gitignore_20211011133958 b/.history/.gitignore_20211011133958
deleted file mode 100644
index 6da9f97..0000000
--- a/.history/.gitignore_20211011133958
+++ /dev/null
@@ -1,4 +0,0 @@
-out/
-out/roku-deploy.zip
-.vscode/
-.history/
\ No newline at end of file
diff --git a/.history/.gitignore_20211011134525 b/.history/.gitignore_20211011134525
deleted file mode 100644
index 6da9f97..0000000
--- a/.history/.gitignore_20211011134525
+++ /dev/null
@@ -1,4 +0,0 @@
-out/
-out/roku-deploy.zip
-.vscode/
-.history/
\ No newline at end of file
diff --git a/.history/components/MainScreen_20161215154627.xml b/.history/components/MainScreen_20161215154627.xml
deleted file mode 100644
index 762ac43..0000000
--- a/.history/components/MainScreen_20161215154627.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.history/components/MainScreen_20211011143248.xml b/.history/components/MainScreen_20211011143248.xml
deleted file mode 100644
index 30a1786..0000000
--- a/.history/components/MainScreen_20211011143248.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/Play_20211012131737.brs b/.history/components/Play_20211012131737.brs
deleted file mode 100644
index a5fcad0..0000000
--- a/.history/components/Play_20211012131737.brs
+++ /dev/null
@@ -1,27 +0,0 @@
-sub init()
- m.http = createObject("roSGNode", "httpTask")
- m.http.control = "RUN"
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=1FL22N1EXDo", requestType: "GET" }
- m.http.observeFieldScoped("response", "useResponse")
- m.video = m.top.findNode("video")
-
- play()
-end sub
-
-sub play()
- m.video.control = "play"
-end sub
-
-sub useResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.http.response.body)
- m.content = createObject("roSGNode", "ContentNode")
- m.content.streamFormat = "mp4"
- m.content.url = ParseJson(matches[1]).streamingData.formats[0].url
- m.video.content = m.content
- play()
-end sub
-
diff --git a/.history/components/Play_20211012131808.brs b/.history/components/Play_20211012131808.brs
deleted file mode 100644
index 3e8f14b..0000000
--- a/.history/components/Play_20211012131808.brs
+++ /dev/null
@@ -1,28 +0,0 @@
-sub init()
- m.http = createObject("roSGNode", "httpTask")
- m.http.control = "RUN"
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=1FL22N1EXDo", requestType: "GET" }
- m.http.observeFieldScoped("response", "useResponse")
- m.video = m.top.findNode("video")
- ?m.video
-
- play()
-end sub
-
-sub play()
- m.video.control = "play"
-end sub
-
-sub useResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.http.response.body)
- m.content = createObject("roSGNode", "ContentNode")
- m.content.streamFormat = "mp4"
- m.content.url = ParseJson(matches[1]).streamingData.formats[0].url
- m.video.content = m.content
- play()
-end sub
-
diff --git a/.history/components/Play_20211012131900.brs b/.history/components/Play_20211012131900.brs
deleted file mode 100644
index a5fcad0..0000000
--- a/.history/components/Play_20211012131900.brs
+++ /dev/null
@@ -1,27 +0,0 @@
-sub init()
- m.http = createObject("roSGNode", "httpTask")
- m.http.control = "RUN"
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=1FL22N1EXDo", requestType: "GET" }
- m.http.observeFieldScoped("response", "useResponse")
- m.video = m.top.findNode("video")
-
- play()
-end sub
-
-sub play()
- m.video.control = "play"
-end sub
-
-sub useResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.http.response.body)
- m.content = createObject("roSGNode", "ContentNode")
- m.content.streamFormat = "mp4"
- m.content.url = ParseJson(matches[1]).streamingData.formats[0].url
- m.video.content = m.content
- play()
-end sub
-
diff --git a/.history/components/keyboardScene_20211012131932.brs b/.history/components/keyboardScene_20211012131932.brs
deleted file mode 100644
index ff84590..0000000
--- a/.history/components/keyboardScene_20211012131932.brs
+++ /dev/null
@@ -1,93 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012132158.brs b/.history/components/keyboardScene_20211012132158.brs
deleted file mode 100644
index 052d489..0000000
--- a/.history/components/keyboardScene_20211012132158.brs
+++ /dev/null
@@ -1,94 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012133530.brs b/.history/components/keyboardScene_20211012133530.brs
deleted file mode 100644
index 602d379..0000000
--- a/.history/components/keyboardScene_20211012133530.brs
+++ /dev/null
@@ -1,95 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableTricKPlay = false
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012133904.brs b/.history/components/keyboardScene_20211012133904.brs
deleted file mode 100644
index 2b5832d..0000000
--- a/.history/components/keyboardScene_20211012133904.brs
+++ /dev/null
@@ -1,95 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012134451.brs b/.history/components/keyboardScene_20211012134451.brs
deleted file mode 100644
index 35ee359..0000000
--- a/.history/components/keyboardScene_20211012134451.brs
+++ /dev/null
@@ -1,96 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFF00FFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012134544.brs b/.history/components/keyboardScene_20211012134544.brs
deleted file mode 100644
index 2cec4e2..0000000
--- a/.history/components/keyboardScene_20211012134544.brs
+++ /dev/null
@@ -1,96 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012134647.brs b/.history/components/keyboardScene_20211012134647.brs
deleted file mode 100644
index b215172..0000000
--- a/.history/components/keyboardScene_20211012134647.brs
+++ /dev/null
@@ -1,97 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012134937.brs b/.history/components/keyboardScene_20211012134937.brs
deleted file mode 100644
index e3a67e2..0000000
--- a/.history/components/keyboardScene_20211012134937.brs
+++ /dev/null
@@ -1,98 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
- m.video.trickPlayBar.filledBarBlendColor = "0x000000FF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012135037.brs b/.history/components/keyboardScene_20211012135037.brs
deleted file mode 100644
index 39eab47..0000000
--- a/.history/components/keyboardScene_20211012135037.brs
+++ /dev/null
@@ -1,98 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
- m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012135227.brs b/.history/components/keyboardScene_20211012135227.brs
deleted file mode 100644
index 04fffc4..0000000
--- a/.history/components/keyboardScene_20211012135227.brs
+++ /dev/null
@@ -1,99 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
- m.video.trickPlayBar.filledBarImageUri = ""
- m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012135232.brs b/.history/components/keyboardScene_20211012135232.brs
deleted file mode 100644
index 1b56228..0000000
--- a/.history/components/keyboardScene_20211012135232.brs
+++ /dev/null
@@ -1,99 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
- m.video.trickPlayBar.filledBarImageUri = invalid
- m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012135345.brs b/.history/components/keyboardScene_20211012135345.brs
deleted file mode 100644
index aa974ff..0000000
--- a/.history/components/keyboardScene_20211012135345.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
- m.video.trickPlayBar.filledBarImageUri = invalid
- m.video.trickPlayBar.trackImageUri = "https://png.pngtree.com/thumb_back/fh260/background/20200714/pngtree-modern-double-color-futuristic-neon-background-image_351866.jpg"
- m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012135459.brs b/.history/components/keyboardScene_20211012135459.brs
deleted file mode 100644
index 634b31f..0000000
--- a/.history/components/keyboardScene_20211012135459.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
- m.video.trickPlayBar.filledBarImageUri = "https://png.pngtree.com/thumb_back/fh260/background/20200714/pngtree-modern-double-color-futuristic-neon-background-image_351866.jpg"
- m.video.trickPlayBar.trackImageUri = ""
- m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012135654.brs b/.history/components/keyboardScene_20211012135654.brs
deleted file mode 100644
index 8ef80c0..0000000
--- a/.history/components/keyboardScene_20211012135654.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0x0000FF00"
- m.video.trickPlayBar.filledBarImageUri = "0xFFFFFF00"
- m.video.trickPlayBar.trackImageUri = ""
- m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012135833.brs b/.history/components/keyboardScene_20211012135833.brs
deleted file mode 100644
index c866245..0000000
--- a/.history/components/keyboardScene_20211012135833.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- m.video.trickPlayBar.filledBarImageUri = ""
- m.video.trickPlayBar.trackImageUri = ""
- m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012135835.brs b/.history/components/keyboardScene_20211012135835.brs
deleted file mode 100644
index c866245..0000000
--- a/.history/components/keyboardScene_20211012135835.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- m.video.trickPlayBar.filledBarImageUri = ""
- m.video.trickPlayBar.trackImageUri = ""
- m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012135845.brs b/.history/components/keyboardScene_20211012135845.brs
deleted file mode 100644
index 465016c..0000000
--- a/.history/components/keyboardScene_20211012135845.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0xFF00FF00"
- m.video.trickPlayBar.filledBarImageUri = ""
- m.video.trickPlayBar.trackImageUri = ""
- m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012135848.brs b/.history/components/keyboardScene_20211012135848.brs
deleted file mode 100644
index 56d06f2..0000000
--- a/.history/components/keyboardScene_20211012135848.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0xFF00FFFF"
- m.video.trickPlayBar.filledBarImageUri = ""
- m.video.trickPlayBar.trackImageUri = ""
- m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012135849.brs b/.history/components/keyboardScene_20211012135849.brs
deleted file mode 100644
index 56d06f2..0000000
--- a/.history/components/keyboardScene_20211012135849.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0xFF00FFFF"
- m.video.trickPlayBar.filledBarImageUri = ""
- m.video.trickPlayBar.trackImageUri = ""
- m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012140044.brs b/.history/components/keyboardScene_20211012140044.brs
deleted file mode 100644
index 18bea9b..0000000
--- a/.history/components/keyboardScene_20211012140044.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = ""
- m.video.trickPlayBar.trackImageUri = ""
- m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012140310.brs b/.history/components/keyboardScene_20211012140310.brs
deleted file mode 100644
index cb4d537..0000000
--- a/.history/components/keyboardScene_20211012140310.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.filledBarBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012140322.brs b/.history/components/keyboardScene_20211012140322.brs
deleted file mode 100644
index e3ae4fc..0000000
--- a/.history/components/keyboardScene_20211012140322.brs
+++ /dev/null
@@ -1,97 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012140753.brs b/.history/components/keyboardScene_20211012140753.brs
deleted file mode 100644
index 8caef93..0000000
--- a/.history/components/keyboardScene_20211012140753.brs
+++ /dev/null
@@ -1,101 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.emptyBarImageUri = "pkg:/images/white.jpg"
-
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012140755.brs b/.history/components/keyboardScene_20211012140755.brs
deleted file mode 100644
index dda45f3..0000000
--- a/.history/components/keyboardScene_20211012140755.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.emptyBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012140756.brs b/.history/components/keyboardScene_20211012140756.brs
deleted file mode 100644
index dda45f3..0000000
--- a/.history/components/keyboardScene_20211012140756.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.emptyBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012140816.brs b/.history/components/keyboardScene_20211012140816.brs
deleted file mode 100644
index 912a333..0000000
--- a/.history/components/keyboardScene_20211012140816.brs
+++ /dev/null
@@ -1,101 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0x0000FFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.emptyBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.emptyBarBlendColor = "0x00000033"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012140911.brs b/.history/components/keyboardScene_20211012140911.brs
deleted file mode 100644
index 32f8d27..0000000
--- a/.history/components/keyboardScene_20211012140911.brs
+++ /dev/null
@@ -1,101 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.emptyBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.emptyBarBlendColor = "0x00000033"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012140929.brs b/.history/components/keyboardScene_20211012140929.brs
deleted file mode 100644
index 1d4cf18..0000000
--- a/.history/components/keyboardScene_20211012140929.brs
+++ /dev/null
@@ -1,101 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.emptyBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x00000033"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012140932.brs b/.history/components/keyboardScene_20211012140932.brs
deleted file mode 100644
index 64a8f30..0000000
--- a/.history/components/keyboardScene_20211012140932.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x00000033"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012140933.brs b/.history/components/keyboardScene_20211012140933.brs
deleted file mode 100644
index 64a8f30..0000000
--- a/.history/components/keyboardScene_20211012140933.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x00000033"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFFFF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012140937.brs b/.history/components/keyboardScene_20211012140937.brs
deleted file mode 100644
index 9a1c68b..0000000
--- a/.history/components/keyboardScene_20211012140937.brs
+++ /dev/null
@@ -1,99 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x00000033"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012141120.brs b/.history/components/keyboardScene_20211012141120.brs
deleted file mode 100644
index 6ece5bb..0000000
--- a/.history/components/keyboardScene_20211012141120.brs
+++ /dev/null
@@ -1,99 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ?m.video.trickPlayBar
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012141140.brs b/.history/components/keyboardScene_20211012141140.brs
deleted file mode 100644
index 84cfbf5..0000000
--- a/.history/components/keyboardScene_20211012141140.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- trackBlendColor = "0x000000FF"
- ?m.video.trickPlayBar
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012141147.brs b/.history/components/keyboardScene_20211012141147.brs
deleted file mode 100644
index 0ce2fee..0000000
--- a/.history/components/keyboardScene_20211012141147.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x000000FF"
- ?m.video.trickPlayBar
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012141326.brs b/.history/components/keyboardScene_20211012141326.brs
deleted file mode 100644
index 308809a..0000000
--- a/.history/components/keyboardScene_20211012141326.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x000000FF"
- ?m.video.trickPlayBar.getParent()
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012141443.brs b/.history/components/keyboardScene_20211012141443.brs
deleted file mode 100644
index 0c7d4c5..0000000
--- a/.history/components/keyboardScene_20211012141443.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ?m.video.trickPlayBar.getParent()
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012141637.brs b/.history/components/keyboardScene_20211012141637.brs
deleted file mode 100644
index b88483d..0000000
--- a/.history/components/keyboardScene_20211012141637.brs
+++ /dev/null
@@ -1,101 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent()
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012141641.brs b/.history/components/keyboardScene_20211012141641.brs
deleted file mode 100644
index dd51c0a..0000000
--- a/.history/components/keyboardScene_20211012141641.brs
+++ /dev/null
@@ -1,100 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012141813.brs b/.history/components/keyboardScene_20211012141813.brs
deleted file mode 100644
index 7458c4d..0000000
--- a/.history/components/keyboardScene_20211012141813.brs
+++ /dev/null
@@ -1,101 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren()
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012141843.brs b/.history/components/keyboardScene_20211012141843.brs
deleted file mode 100644
index b88483d..0000000
--- a/.history/components/keyboardScene_20211012141843.brs
+++ /dev/null
@@ -1,101 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent()
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012141913.brs b/.history/components/keyboardScene_20211012141913.brs
deleted file mode 100644
index 03ddcec..0000000
--- a/.history/components/keyboardScene_20211012141913.brs
+++ /dev/null
@@ -1,101 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildCount()
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012141947.brs b/.history/components/keyboardScene_20211012141947.brs
deleted file mode 100644
index e8b9c0f..0000000
--- a/.history/components/keyboardScene_20211012141947.brs
+++ /dev/null
@@ -1,101 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12)
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012142027.brs b/.history/components/keyboardScene_20211012142027.brs
deleted file mode 100644
index 6232d4f..0000000
--- a/.history/components/keyboardScene_20211012142027.brs
+++ /dev/null
@@ -1,101 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012142112.brs b/.history/components/keyboardScene_20211012142112.brs
deleted file mode 100644
index 4e77d8f..0000000
--- a/.history/components/keyboardScene_20211012142112.brs
+++ /dev/null
@@ -1,102 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getParent().getChild(1)
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012142206.brs b/.history/components/keyboardScene_20211012142206.brs
deleted file mode 100644
index 51060a3..0000000
--- a/.history/components/keyboardScene_20211012142206.brs
+++ /dev/null
@@ -1,102 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012142301.brs b/.history/components/keyboardScene_20211012142301.brs
deleted file mode 100644
index 90a7908..0000000
--- a/.history/components/keyboardScene_20211012142301.brs
+++ /dev/null
@@ -1,102 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012142428.brs b/.history/components/keyboardScene_20211012142428.brs
deleted file mode 100644
index e0004a4..0000000
--- a/.history/components/keyboardScene_20211012142428.brs
+++ /dev/null
@@ -1,103 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012142431.brs b/.history/components/keyboardScene_20211012142431.brs
deleted file mode 100644
index c1aa572..0000000
--- a/.history/components/keyboardScene_20211012142431.brs
+++ /dev/null
@@ -1,103 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012142554.brs b/.history/components/keyboardScene_20211012142554.brs
deleted file mode 100644
index d6b5f9c..0000000
--- a/.history/components/keyboardScene_20211012142554.brs
+++ /dev/null
@@ -1,104 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(5)
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012142834.brs b/.history/components/keyboardScene_20211012142834.brs
deleted file mode 100644
index 545b791..0000000
--- a/.history/components/keyboardScene_20211012142834.brs
+++ /dev/null
@@ -1,104 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11)
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012142946.brs b/.history/components/keyboardScene_20211012142946.brs
deleted file mode 100644
index a745468..0000000
--- a/.history/components/keyboardScene_20211012142946.brs
+++ /dev/null
@@ -1,104 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildrenCount()
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012143030.brs b/.history/components/keyboardScene_20211012143030.brs
deleted file mode 100644
index 0ebc4d4..0000000
--- a/.history/components/keyboardScene_20211012143030.brs
+++ /dev/null
@@ -1,104 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildCount()
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012143106.brs b/.history/components/keyboardScene_20211012143106.brs
deleted file mode 100644
index 2b670e0..0000000
--- a/.history/components/keyboardScene_20211012143106.brs
+++ /dev/null
@@ -1,104 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012143144.brs b/.history/components/keyboardScene_20211012143144.brs
deleted file mode 100644
index 2a72bc6..0000000
--- a/.history/components/keyboardScene_20211012143144.brs
+++ /dev/null
@@ -1,105 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- ?m.video.trickPlayBar.getParent().getChild(11).getChild(0)
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012143255.brs b/.history/components/keyboardScene_20211012143255.brs
deleted file mode 100644
index 2b7c743..0000000
--- a/.history/components/keyboardScene_20211012143255.brs
+++ /dev/null
@@ -1,105 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- ?m.video.trickPlayBar.getParent().getChild(3)
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012143425.brs b/.history/components/keyboardScene_20211012143425.brs
deleted file mode 100644
index ac0d1be..0000000
--- a/.history/components/keyboardScene_20211012143425.brs
+++ /dev/null
@@ -1,104 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(2)
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012143432.brs b/.history/components/keyboardScene_20211012143432.brs
deleted file mode 100644
index a5f55a3..0000000
--- a/.history/components/keyboardScene_20211012143432.brs
+++ /dev/null
@@ -1,104 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.setFocus(true)
- m.video.control = "play"
- ?m.video.trickPlayBar.getParent().getChild(2)
-end sub
-
diff --git a/.history/components/keyboardScene_20211012143506.brs b/.history/components/keyboardScene_20211012143506.brs
deleted file mode 100644
index a400f4d..0000000
--- a/.history/components/keyboardScene_20211012143506.brs
+++ /dev/null
@@ -1,104 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.setFocus(true)
- m.video.control = "play"
- ?m.video.trickPlayBar.getParent().getChild(2).visible = false
-end sub
-
diff --git a/.history/components/keyboardScene_20211012143547.brs b/.history/components/keyboardScene_20211012143547.brs
deleted file mode 100644
index 0271cff..0000000
--- a/.history/components/keyboardScene_20211012143547.brs
+++ /dev/null
@@ -1,104 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.setFocus(true)
- m.video.control = "play"
- m.video.trickPlayBar.getParent().getChild(2).visible = false
-end sub
-
diff --git a/.history/components/keyboardScene_20211012143803.brs b/.history/components/keyboardScene_20211012143803.brs
deleted file mode 100644
index 2c610b0..0000000
--- a/.history/components/keyboardScene_20211012143803.brs
+++ /dev/null
@@ -1,105 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- ?m.video.trickPlayBar.getParent().getChild(5)
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012143849.brs b/.history/components/keyboardScene_20211012143849.brs
deleted file mode 100644
index 8b40144..0000000
--- a/.history/components/keyboardScene_20211012143849.brs
+++ /dev/null
@@ -1,105 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- ?m.video.trickPlayBar.getParent().getChild(5).height = 40
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012144059.brs b/.history/components/keyboardScene_20211012144059.brs
deleted file mode 100644
index 2c610b0..0000000
--- a/.history/components/keyboardScene_20211012144059.brs
+++ /dev/null
@@ -1,105 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- ?m.video.trickPlayBar.getParent().getChild(5)
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012144148.brs b/.history/components/keyboardScene_20211012144148.brs
deleted file mode 100644
index 3a69a2d..0000000
--- a/.history/components/keyboardScene_20211012144148.brs
+++ /dev/null
@@ -1,105 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- ?m.video.trickPlayBar.getParent().getChild(5).height = 0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012144149.brs b/.history/components/keyboardScene_20211012144149.brs
deleted file mode 100644
index 78966ac..0000000
--- a/.history/components/keyboardScene_20211012144149.brs
+++ /dev/null
@@ -1,105 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- m.video.trickPlayBar.getParent().getChild(5).height = 0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012144401.brs b/.history/components/keyboardScene_20211012144401.brs
deleted file mode 100644
index 78d2df6..0000000
--- a/.history/components/keyboardScene_20211012144401.brs
+++ /dev/null
@@ -1,105 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- m.video.trickPlayBar.getParent().getChild(5)
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012144506.brs b/.history/components/keyboardScene_20211012144506.brs
deleted file mode 100644
index aab76b0..0000000
--- a/.history/components/keyboardScene_20211012144506.brs
+++ /dev/null
@@ -1,106 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- m.video.trickPlayBar.getParent().getChild(5)
- m.video.bufferingBar.height = 20
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012144537.brs b/.history/components/keyboardScene_20211012144537.brs
deleted file mode 100644
index c30147e..0000000
--- a/.history/components/keyboardScene_20211012144537.brs
+++ /dev/null
@@ -1,107 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- m.video.trickPlayBar.getParent().getChild(5)
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012144610.brs b/.history/components/keyboardScene_20211012144610.brs
deleted file mode 100644
index 4b8921f..0000000
--- a/.history/components/keyboardScene_20211012144610.brs
+++ /dev/null
@@ -1,108 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- m.video.trickPlayBar.getParent().getChild(5)
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012144744.brs b/.history/components/keyboardScene_20211012144744.brs
deleted file mode 100644
index 72240e4..0000000
--- a/.history/components/keyboardScene_20211012144744.brs
+++ /dev/null
@@ -1,109 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- m.video.trickPlayBar.getParent().getChild(5)
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012144754.brs b/.history/components/keyboardScene_20211012144754.brs
deleted file mode 100644
index c608295..0000000
--- a/.history/components/keyboardScene_20211012144754.brs
+++ /dev/null
@@ -1,109 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- m.video.trickPlayBar.getParent().getChild(5)
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012144806.brs b/.history/components/keyboardScene_20211012144806.brs
deleted file mode 100644
index 4c2dc5a..0000000
--- a/.history/components/keyboardScene_20211012144806.brs
+++ /dev/null
@@ -1,110 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- m.video.trickPlayBar.getParent().getChild(5)
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012144812.brs b/.history/components/keyboardScene_20211012144812.brs
deleted file mode 100644
index 7b2f393..0000000
--- a/.history/components/keyboardScene_20211012144812.brs
+++ /dev/null
@@ -1,110 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- m.video.trickPlayBar.getParent().getChild(5)
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012144825.brs b/.history/components/keyboardScene_20211012144825.brs
deleted file mode 100644
index 39f08b8..0000000
--- a/.history/components/keyboardScene_20211012144825.brs
+++ /dev/null
@@ -1,110 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(11).getChildren(6, 0)
- m.video.trickPlayBar.getParent().getChild(5)
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012145038.brs b/.history/components/keyboardScene_20211012145038.brs
deleted file mode 100644
index 7e67136..0000000
--- a/.history/components/keyboardScene_20211012145038.brs
+++ /dev/null
@@ -1,109 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.trickPlayBar.getParent().getChild(5)
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012145051.brs b/.history/components/keyboardScene_20211012145051.brs
deleted file mode 100644
index baba9db..0000000
--- a/.history/components/keyboardScene_20211012145051.brs
+++ /dev/null
@@ -1,110 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(10).getChildren(6, 0)
- m.video.trickPlayBar.getParent().getChild(5)
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012145100.brs b/.history/components/keyboardScene_20211012145100.brs
deleted file mode 100644
index 660d001..0000000
--- a/.history/components/keyboardScene_20211012145100.brs
+++ /dev/null
@@ -1,110 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(10)
- m.video.trickPlayBar.getParent().getChild(5)
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012145914.brs b/.history/components/keyboardScene_20211012145914.brs
deleted file mode 100644
index 3a6b0a5..0000000
--- a/.history/components/keyboardScene_20211012145914.brs
+++ /dev/null
@@ -1,110 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(10)
- ?m.video.trickPlayBar.getParent().getChild(5)
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012145926.brs b/.history/components/keyboardScene_20211012145926.brs
deleted file mode 100644
index 2491089..0000000
--- a/.history/components/keyboardScene_20211012145926.brs
+++ /dev/null
@@ -1,110 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(10)
- ?m.video.trickPlayBar.getParent().getChild(5).getChildCount()
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012150040.brs b/.history/components/keyboardScene_20211012150040.brs
deleted file mode 100644
index 3992887..0000000
--- a/.history/components/keyboardScene_20211012150040.brs
+++ /dev/null
@@ -1,109 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(5).getChildCount()
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012150053.brs b/.history/components/keyboardScene_20211012150053.brs
deleted file mode 100644
index f2de7f6..0000000
--- a/.history/components/keyboardScene_20211012150053.brs
+++ /dev/null
@@ -1,109 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(5).getChildren(19, 0)
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012150212.brs b/.history/components/keyboardScene_20211012150212.brs
deleted file mode 100644
index 90c040e..0000000
--- a/.history/components/keyboardScene_20211012150212.brs
+++ /dev/null
@@ -1,109 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(5)
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012150318.brs b/.history/components/keyboardScene_20211012150318.brs
deleted file mode 100644
index 31c423e..0000000
--- a/.history/components/keyboardScene_20211012150318.brs
+++ /dev/null
@@ -1,113 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(5).observeField("visible", "tellMeText")
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub tellMeText()
-
- endsb
-
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012150319.brs b/.history/components/keyboardScene_20211012150319.brs
deleted file mode 100644
index 4e33a8d..0000000
--- a/.history/components/keyboardScene_20211012150319.brs
+++ /dev/null
@@ -1,112 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(5).observeField("visible", "tellMeText")
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub tellMeText()
-
-end sub
diff --git a/.history/components/keyboardScene_20211012150416.brs b/.history/components/keyboardScene_20211012150416.brs
deleted file mode 100644
index 10d5f7e..0000000
--- a/.history/components/keyboardScene_20211012150416.brs
+++ /dev/null
@@ -1,113 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(5).observeField("visible", "tellMeText")
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub tellMeText()
- ?m.video.trickPlayBar.getParent().getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(3)
-end sub
diff --git a/.history/components/keyboardScene_20211012150424.brs b/.history/components/keyboardScene_20211012150424.brs
deleted file mode 100644
index 6f610a8..0000000
--- a/.history/components/keyboardScene_20211012150424.brs
+++ /dev/null
@@ -1,113 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.trickPlayBar.getParent().getChild(5).observeField("visible", "tellMeText")
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub tellMeText()
- ?m.video.trickPlayBar.getParent().getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(3)
-end sub
diff --git a/.history/components/keyboardScene_20211012150555.brs b/.history/components/keyboardScene_20211012150555.brs
deleted file mode 100644
index 39f97b1..0000000
--- a/.history/components/keyboardScene_20211012150555.brs
+++ /dev/null
@@ -1,113 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.trickPlayBar.getParent().getChild(5).observeField("visible", "tellMeText")
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub tellMeText()
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
-end sub
diff --git a/.history/components/keyboardScene_20211012150601.brs b/.history/components/keyboardScene_20211012150601.brs
deleted file mode 100644
index 155be2f..0000000
--- a/.history/components/keyboardScene_20211012150601.brs
+++ /dev/null
@@ -1,114 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.trickPlayBar.getParent().getChild(5).observeField("visible", "tellMeText")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub tellMeText()
-
-end sub
diff --git a/.history/components/keyboardScene_20211012150644.brs b/.history/components/keyboardScene_20211012150644.brs
deleted file mode 100644
index 1d79406..0000000
--- a/.history/components/keyboardScene_20211012150644.brs
+++ /dev/null
@@ -1,115 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.trickPlayBar.getParent().getChild(5).observeField("visible", "tellMeText")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub tellMeText()
- ?m.video.trickPlayBar.getParent().getChild(8)
- ?m.video.trickPlayBar.getParent().getChild(10)
-end sub
diff --git a/.history/components/keyboardScene_20211012150915.brs b/.history/components/keyboardScene_20211012150915.brs
deleted file mode 100644
index 28d9bd9..0000000
--- a/.history/components/keyboardScene_20211012150915.brs
+++ /dev/null
@@ -1,111 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.trickPlayBar.getParent().getChild(8).text = m.video.bufferingBar.percentage
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012150920.brs b/.history/components/keyboardScene_20211012150920.brs
deleted file mode 100644
index 323f8a6..0000000
--- a/.history/components/keyboardScene_20211012150920.brs
+++ /dev/null
@@ -1,111 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.trickPlayBar.getParent().getChild(8).text = m.video.bufferingBar.percentage + "%"
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012151005.brs b/.history/components/keyboardScene_20211012151005.brs
deleted file mode 100644
index 47c73e0..0000000
--- a/.history/components/keyboardScene_20211012151005.brs
+++ /dev/null
@@ -1,111 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012151105.brs b/.history/components/keyboardScene_20211012151105.brs
deleted file mode 100644
index 2ee5276..0000000
--- a/.history/components/keyboardScene_20211012151105.brs
+++ /dev/null
@@ -1,112 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.bufferingBar.observeField("pecentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
diff --git a/.history/components/keyboardScene_20211012151115.brs b/.history/components/keyboardScene_20211012151115.brs
deleted file mode 100644
index 0103d70..0000000
--- a/.history/components/keyboardScene_20211012151115.brs
+++ /dev/null
@@ -1,115 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.bufferingBar.observeField("pecentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
-
-end sub
diff --git a/.history/components/keyboardScene_20211012151125.brs b/.history/components/keyboardScene_20211012151125.brs
deleted file mode 100644
index 9f4070f..0000000
--- a/.history/components/keyboardScene_20211012151125.brs
+++ /dev/null
@@ -1,115 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.bufferingBar.observeField("pecentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
diff --git a/.history/components/keyboardScene_20211012151129.brs b/.history/components/keyboardScene_20211012151129.brs
deleted file mode 100644
index 8c4b540..0000000
--- a/.history/components/keyboardScene_20211012151129.brs
+++ /dev/null
@@ -1,114 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.bufferingBar.observeField("pecentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
diff --git a/.history/components/keyboardScene_20211012151328.brs b/.history/components/keyboardScene_20211012151328.brs
deleted file mode 100644
index 5425ad6..0000000
--- a/.history/components/keyboardScene_20211012151328.brs
+++ /dev/null
@@ -1,114 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
diff --git a/.history/components/keyboardScene_20211012151452.brs b/.history/components/keyboardScene_20211012151452.brs
deleted file mode 100644
index 0f58975..0000000
--- a/.history/components/keyboardScene_20211012151452.brs
+++ /dev/null
@@ -1,115 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
diff --git a/.history/components/keyboardScene_20211012151718.brs b/.history/components/keyboardScene_20211012151718.brs
deleted file mode 100644
index 0e5cad1..0000000
--- a/.history/components/keyboardScene_20211012151718.brs
+++ /dev/null
@@ -1,116 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.observeField("visible", "log")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
diff --git a/.history/components/keyboardScene_20211012151724.brs b/.history/components/keyboardScene_20211012151724.brs
deleted file mode 100644
index 4c0ea8e..0000000
--- a/.history/components/keyboardScene_20211012151724.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.observeField("visible", "log")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
-
-sub log()
-
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012151741.brs b/.history/components/keyboardScene_20211012151741.brs
deleted file mode 100644
index b0600cf..0000000
--- a/.history/components/keyboardScene_20211012151741.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.observeField("visible", "log")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
-
-sub log()
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012151753.brs b/.history/components/keyboardScene_20211012151753.brs
deleted file mode 100644
index 8882c91..0000000
--- a/.history/components/keyboardScene_20211012151753.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.observeField("visible", "logy")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
-
-sub logy()
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012151815.brs b/.history/components/keyboardScene_20211012151815.brs
deleted file mode 100644
index b47758c..0000000
--- a/.history/components/keyboardScene_20211012151815.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.observeField("visible", "logy")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
-
-sub logy()
- ?m.video.trickPlayBar.getParent().getChild(2).text
- ?m.video.trickPlayBar.getParent().getChild(3).text
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012151941.brs b/.history/components/keyboardScene_20211012151941.brs
deleted file mode 100644
index 546383a..0000000
--- a/.history/components/keyboardScene_20211012151941.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.observeField("visible", "logy")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
-
-sub logy()
- ?m.video.trickPlayBar.getParent().getChild(8).text
- ?m.video.trickPlayBar.getParent().getChild(10).text
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012151947.brs b/.history/components/keyboardScene_20211012151947.brs
deleted file mode 100644
index 64e1400..0000000
--- a/.history/components/keyboardScene_20211012151947.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.observeField("visible", "logy")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
-
-sub logy()
- ?m.video.trickPlayBar.getParent().getChild(8)
- ?m.video.trickPlayBar.getParent().getChild(10)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152121.brs b/.history/components/keyboardScene_20211012152121.brs
deleted file mode 100644
index b73f241..0000000
--- a/.history/components/keyboardScene_20211012152121.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.observeField("visible", "logy")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
-
-sub logy()
- ?m.video.trickPlayBar.getChildCount()
- ?m.video.trickPlayBar.getParent().getChild(10)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152125.brs b/.history/components/keyboardScene_20211012152125.brs
deleted file mode 100644
index 4676f6b..0000000
--- a/.history/components/keyboardScene_20211012152125.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.observeField("visible", "logy")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
-
-sub logy()
- ?m.video.trickPlayBar.getChildCount()
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152229.brs b/.history/components/keyboardScene_20211012152229.brs
deleted file mode 100644
index 005386f..0000000
--- a/.history/components/keyboardScene_20211012152229.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.observeField("visible", "logy")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
-
-sub logy()
- ?m.video.trickPlayBar.getChildren(19), 0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152237.brs b/.history/components/keyboardScene_20211012152237.brs
deleted file mode 100644
index 8583a1a..0000000
--- a/.history/components/keyboardScene_20211012152237.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.observeField("visible", "logy")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
-
-sub logy()
- ?m.video.trickPlayBar.getChildren(19, 0)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152352.brs b/.history/components/keyboardScene_20211012152352.brs
deleted file mode 100644
index b124259..0000000
--- a/.history/components/keyboardScene_20211012152352.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.observeField("visible", "logy")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
-
-sub logy()
- ?m.video.trickPlayBar.getChildren(19, 0)
- ?m.video.trickPlayBar.getChild(10)
- ?m.video.trickPlayBar.getChild(9)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152354.brs b/.history/components/keyboardScene_20211012152354.brs
deleted file mode 100644
index a839c35..0000000
--- a/.history/components/keyboardScene_20211012152354.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.observeField("visible", "logy")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
-
-sub logy()
- ?m.video.trickPlayBar.getChildren(19, 0)
- ?m.video.trickPlayBar.getChild(9)
- ?m.video.trickPlayBar.getChild(10)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152507.brs b/.history/components/keyboardScene_20211012152507.brs
deleted file mode 100644
index 8583a1a..0000000
--- a/.history/components/keyboardScene_20211012152507.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.observeField("visible", "logy")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
-
-sub logy()
- ?m.video.trickPlayBar.getChildren(19, 0)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152518.brs b/.history/components/keyboardScene_20211012152518.brs
deleted file mode 100644
index d12173b..0000000
--- a/.history/components/keyboardScene_20211012152518.brs
+++ /dev/null
@@ -1,115 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211012152520.brs b/.history/components/keyboardScene_20211012152520.brs
deleted file mode 100644
index d12173b..0000000
--- a/.history/components/keyboardScene_20211012152520.brs
+++ /dev/null
@@ -1,115 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013084544.brs b/.history/components/keyboardScene_20211013084544.brs
deleted file mode 100644
index 71332f8..0000000
--- a/.history/components/keyboardScene_20211013084544.brs
+++ /dev/null
@@ -1,115 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 14
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013084609.brs b/.history/components/keyboardScene_20211013084609.brs
deleted file mode 100644
index fa806c2..0000000
--- a/.history/components/keyboardScene_20211013084609.brs
+++ /dev/null
@@ -1,115 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013084830.brs b/.history/components/keyboardScene_20211013084830.brs
deleted file mode 100644
index 87f705c..0000000
--- a/.history/components/keyboardScene_20211013084830.brs
+++ /dev/null
@@ -1,116 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013084919.brs b/.history/components/keyboardScene_20211013084919.brs
deleted file mode 100644
index 3df97ef..0000000
--- a/.history/components/keyboardScene_20211013084919.brs
+++ /dev/null
@@ -1,117 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.getChildren(12, 0)
- ?m.video.getChild(5)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013084931.brs b/.history/components/keyboardScene_20211013084931.brs
deleted file mode 100644
index 14edd82..0000000
--- a/.history/components/keyboardScene_20211013084931.brs
+++ /dev/null
@@ -1,117 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.getChildren(12, 0)
- ?m.video.getChild(5)
- ' Hides the black background in the scrubber
- m.video.getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013084953.brs b/.history/components/keyboardScene_20211013084953.brs
deleted file mode 100644
index 14edd82..0000000
--- a/.history/components/keyboardScene_20211013084953.brs
+++ /dev/null
@@ -1,117 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.getChildren(12, 0)
- ?m.video.getChild(5)
- ' Hides the black background in the scrubber
- m.video.getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085016.brs b/.history/components/keyboardScene_20211013085016.brs
deleted file mode 100644
index 3df97ef..0000000
--- a/.history/components/keyboardScene_20211013085016.brs
+++ /dev/null
@@ -1,117 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.getChildren(12, 0)
- ?m.video.getChild(5)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085019.brs b/.history/components/keyboardScene_20211013085019.brs
deleted file mode 100644
index c1986cd..0000000
--- a/.history/components/keyboardScene_20211013085019.brs
+++ /dev/null
@@ -1,116 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085029.brs b/.history/components/keyboardScene_20211013085029.brs
deleted file mode 100644
index af07381..0000000
--- a/.history/components/keyboardScene_20211013085029.brs
+++ /dev/null
@@ -1,117 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085134.brs b/.history/components/keyboardScene_20211013085134.brs
deleted file mode 100644
index 8ea9891..0000000
--- a/.history/components/keyboardScene_20211013085134.brs
+++ /dev/null
@@ -1,117 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildCount()
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085212.brs b/.history/components/keyboardScene_20211013085212.brs
deleted file mode 100644
index d0a2ca1..0000000
--- a/.history/components/keyboardScene_20211013085212.brs
+++ /dev/null
@@ -1,117 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085303.brs b/.history/components/keyboardScene_20211013085303.brs
deleted file mode 100644
index 3b175ff..0000000
--- a/.history/components/keyboardScene_20211013085303.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- ?m.video.trickPlayBar.getChild(1)
- ?m.video.trickPlayBar.getChild(2)
- ?m.video.trickPlayBar.getChild(3)
- ?m.video.trickPlayBar.getChild(4)
-
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085427.brs b/.history/components/keyboardScene_20211013085427.brs
deleted file mode 100644
index f8fa6ea..0000000
--- a/.history/components/keyboardScene_20211013085427.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- ?m.video.trickPlayBar.getChild(0)
- ?m.video.trickPlayBar.getChild(1)
-
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085504.brs b/.history/components/keyboardScene_20211013085504.brs
deleted file mode 100644
index 35a4cab..0000000
--- a/.history/components/keyboardScene_20211013085504.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- ?m.video.trickPlayBar.getChild(0).height = 8
- ?m.video.trickPlayBar.getChild(1).height = 8
-
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085622.brs b/.history/components/keyboardScene_20211013085622.brs
deleted file mode 100644
index 0ea86b9..0000000
--- a/.history/components/keyboardScene_20211013085622.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- ?m.video.trickPlayBar.getChild(0).height = 8
- ?m.video.trickPlayBar.getChild(1).height = 8
-
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 4
- m.video.bufferingBar.height = 4
- ?
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085645.brs b/.history/components/keyboardScene_20211013085645.brs
deleted file mode 100644
index f67488c..0000000
--- a/.history/components/keyboardScene_20211013085645.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
-
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085719.brs b/.history/components/keyboardScene_20211013085719.brs
deleted file mode 100644
index dace9e0..0000000
--- a/.history/components/keyboardScene_20211013085719.brs
+++ /dev/null
@@ -1,126 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(9)
- ?m.video.trickPlayBar.getChild(10)
- ?m.video.trickPlayBar.getChild(11)
- ?m.video.trickPlayBar.getChild(12)
- ?m.video.trickPlayBar.getChild(13)
- ?m.video.trickPlayBar.getChild(14)
- ?m.video.trickPlayBar.getChild(15)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085937.brs b/.history/components/keyboardScene_20211013085937.brs
deleted file mode 100644
index ab1cf24..0000000
--- a/.history/components/keyboardScene_20211013085937.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(9)
- ?m.video.trickPlayBar.getChild(10).visible = false
- ?m.video.trickPlayBar.getChild(11).visible = false
- ?m.video.trickPlayBar.getChild(12).visible = false
- ?m.video.trickPlayBar.getChild(13).visible = false
- ?m.video.trickPlayBar.getChild(14).visible = false
- ?m.video.trickPlayBar.getChild(15).visible = false
- ?m.video.trickPlayBar.getChild(16).visible = false
- ?m.video.trickPlayBar.getChild(17).visible = false
- ?m.video.trickPlayBar.getChild(18).visible = false
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013085941.brs b/.history/components/keyboardScene_20211013085941.brs
deleted file mode 100644
index 779c5c7..0000000
--- a/.history/components/keyboardScene_20211013085941.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(9)
- m.video.trickPlayBar.getChild(10).visible = false
- m.video.trickPlayBar.getChild(11).visible = false
- m.video.trickPlayBar.getChild(12).visible = false
- m.video.trickPlayBar.getChild(13).visible = false
- m.video.trickPlayBar.getChild(14).visible = false
- m.video.trickPlayBar.getChild(15).visible = false
- m.video.trickPlayBar.getChild(16).visible = false
- m.video.trickPlayBar.getChild(17).visible = false
- m.video.trickPlayBar.getChild(18).visible = false
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090029.brs b/.history/components/keyboardScene_20211013090029.brs
deleted file mode 100644
index 62998c3..0000000
--- a/.history/components/keyboardScene_20211013090029.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).height = 8
- m.video.trickPlayBar.getChild(3).height = 8
- m.video.trickPlayBar.getChild(4).height = 8
- m.video.trickPlayBar.getChild(5).height = 8
- m.video.trickPlayBar.getChild(6).height = 8
- m.video.trickPlayBar.getChild(7).height = 8
- m.video.trickPlayBar.getChild(8).height = 8
- ?m.video.trickPlayBar.getChild(9)
- m.video.trickPlayBar.getChild(10).visible = false
- m.video.trickPlayBar.getChild(11).visible = false
- m.video.trickPlayBar.getChild(12).visible = false
- m.video.trickPlayBar.getChild(13).visible = false
- m.video.trickPlayBar.getChild(14).visible = false
- m.video.trickPlayBar.getChild(15).visible = false
- m.video.trickPlayBar.getChild(16).visible = false
- m.video.trickPlayBar.getChild(17).visible = false
- m.video.trickPlayBar.getChild(18).visible = false
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090032.brs b/.history/components/keyboardScene_20211013090032.brs
deleted file mode 100644
index 53b071a..0000000
--- a/.history/components/keyboardScene_20211013090032.brs
+++ /dev/null
@@ -1,135 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).height = 8
- m.video.trickPlayBar.getChild(3).height = 8
- m.video.trickPlayBar.getChild(4).height = 8
- m.video.trickPlayBar.getChild(5).height = 8
- m.video.trickPlayBar.getChild(6).height = 8
- m.video.trickPlayBar.getChild(7).height = 8
- m.video.trickPlayBar.getChild(8).height = 8
- m.video.trickPlayBar.getChild(10).visible = false
- m.video.trickPlayBar.getChild(11).visible = false
- m.video.trickPlayBar.getChild(12).visible = false
- m.video.trickPlayBar.getChild(13).visible = false
- m.video.trickPlayBar.getChild(14).visible = false
- m.video.trickPlayBar.getChild(15).visible = false
- m.video.trickPlayBar.getChild(16).visible = false
- m.video.trickPlayBar.getChild(17).visible = false
- m.video.trickPlayBar.getChild(18).visible = false
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090124.brs b/.history/components/keyboardScene_20211013090124.brs
deleted file mode 100644
index ec56bec..0000000
--- a/.history/components/keyboardScene_20211013090124.brs
+++ /dev/null
@@ -1,135 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).height = 8
- m.video.trickPlayBar.getChild(3).height = 8
- m.video.trickPlayBar.getChild(4).height = 8
- m.video.trickPlayBar.getChild(5).height = 8
- m.video.trickPlayBar.getChild(6).height = 8
- m.video.trickPlayBar.getChild(7).height = 8
- m.video.trickPlayBar.getChild(8).height = 8
- m.video.trickPlayBar.getChild(10).visible = false
- m.video.trickPlayBar.getChild(11).visible = false
- m.video.trickPlayBar.getChild(12).visible = false
- m.video.trickPlayBar.getChild(13).visible = false
- m.video.trickPlayBar.getChild(14).visible = false
- m.video.trickPlayBar.getChild(15).visible = false
- m.video.trickPlayBar.getChild(16).visible = false
- m.video.trickPlayBar.getChild(17).visible = false
- m.video.trickPlayBar.getChild(18).visible = false
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090236.brs b/.history/components/keyboardScene_20211013090236.brs
deleted file mode 100644
index 9045cf2..0000000
--- a/.history/components/keyboardScene_20211013090236.brs
+++ /dev/null
@@ -1,137 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- ?m.video.trickPlayBar.getChild(7)
-
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).height = 8
- m.video.trickPlayBar.getChild(3).height = 8
- m.video.trickPlayBar.getChild(4).height = 8
- m.video.trickPlayBar.getChild(5).height = 8
- m.video.trickPlayBar.getChild(6).height = 8
- m.video.trickPlayBar.getChild(7).height = 8
- m.video.trickPlayBar.getChild(8).height = 8
- m.video.trickPlayBar.getChild(10).visible = false
- m.video.trickPlayBar.getChild(11).visible = false
- m.video.trickPlayBar.getChild(12).visible = false
- m.video.trickPlayBar.getChild(13).visible = false
- m.video.trickPlayBar.getChild(14).visible = false
- m.video.trickPlayBar.getChild(15).visible = false
- m.video.trickPlayBar.getChild(16).visible = false
- m.video.trickPlayBar.getChild(17).visible = false
- m.video.trickPlayBar.getChild(18).visible = false
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090237.brs b/.history/components/keyboardScene_20211013090237.brs
deleted file mode 100644
index 93f22b7..0000000
--- a/.history/components/keyboardScene_20211013090237.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- ?m.video.trickPlayBar.getChild(7)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).height = 8
- m.video.trickPlayBar.getChild(3).height = 8
- m.video.trickPlayBar.getChild(4).height = 8
- m.video.trickPlayBar.getChild(5).height = 8
- m.video.trickPlayBar.getChild(6).height = 8
- m.video.trickPlayBar.getChild(7).height = 8
- m.video.trickPlayBar.getChild(8).height = 8
- m.video.trickPlayBar.getChild(10).visible = false
- m.video.trickPlayBar.getChild(11).visible = false
- m.video.trickPlayBar.getChild(12).visible = false
- m.video.trickPlayBar.getChild(13).visible = false
- m.video.trickPlayBar.getChild(14).visible = false
- m.video.trickPlayBar.getChild(15).visible = false
- m.video.trickPlayBar.getChild(16).visible = false
- m.video.trickPlayBar.getChild(17).visible = false
- m.video.trickPlayBar.getChild(18).visible = false
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090246.brs b/.history/components/keyboardScene_20211013090246.brs
deleted file mode 100644
index 6fba3b5..0000000
--- a/.history/components/keyboardScene_20211013090246.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- ?m.video.trickPlayBar.getChild(7)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(10).visible = false
- m.video.trickPlayBar.getChild(11).visible = false
- m.video.trickPlayBar.getChild(12).visible = false
- m.video.trickPlayBar.getChild(13).visible = false
- m.video.trickPlayBar.getChild(14).visible = false
- m.video.trickPlayBar.getChild(15).visible = false
- m.video.trickPlayBar.getChild(16).visible = false
- m.video.trickPlayBar.getChild(17).visible = false
- m.video.trickPlayBar.getChild(18).visible = false
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090357.brs b/.history/components/keyboardScene_20211013090357.brs
deleted file mode 100644
index 4f86140..0000000
--- a/.history/components/keyboardScene_20211013090357.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ?m.video.trickPlayBar.getChild(10)
- ?m.video.trickPlayBar.getChild(11)
- ?m.video.trickPlayBar.getChild(12)
- ?m.video.trickPlayBar.getChild(13)
- ?m.video.trickPlayBar.getChild(14)
- ?m.video.trickPlayBar.getChild(15)
- ?m.video.trickPlayBar.getChild(16)
- ?m.video.trickPlayBar.getChild(17)
- ?m.video.trickPlayBar.getChild(18)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090424.brs b/.history/components/keyboardScene_20211013090424.brs
deleted file mode 100644
index 171f642..0000000
--- a/.history/components/keyboardScene_20211013090424.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.trickPlayBar.getParent().getChild(7)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ?m.video.trickPlayBar.getChild(10)
- ?m.video.trickPlayBar.getChild(11)
- ?m.video.trickPlayBar.getChild(12)
- ?m.video.trickPlayBar.getChild(13)
- ?m.video.trickPlayBar.getChild(14)
- ?m.video.trickPlayBar.getChild(15)
- ?m.video.trickPlayBar.getChild(16)
- ?m.video.trickPlayBar.getChild(17)
- ?m.video.trickPlayBar.getChild(18)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090428.brs b/.history/components/keyboardScene_20211013090428.brs
deleted file mode 100644
index f354aa2..0000000
--- a/.history/components/keyboardScene_20211013090428.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.trickPlayBar.getParent().getChild(7)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ?m.video.trickPlayBar.getChild(10)
- ?m.video.trickPlayBar.getChild(11)
- ?m.video.trickPlayBar.getChild(12)
- ?m.video.trickPlayBar.getChild(13)
- ?m.video.trickPlayBar.getChild(14)
- ?m.video.trickPlayBar.getChild(15)
- ?m.video.trickPlayBar.getChild(16)
- ?m.video.trickPlayBar.getChild(17)
- ?m.video.trickPlayBar.getChild(18)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090430.brs b/.history/components/keyboardScene_20211013090430.brs
deleted file mode 100644
index fa96ef7..0000000
--- a/.history/components/keyboardScene_20211013090430.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.trickPlayBar.getParent().getChild(7)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ?m.video.trickPlayBar.getChild(10)
- ?m.video.trickPlayBar.getChild(11)
- ?m.video.trickPlayBar.getChild(12)
- ?m.video.trickPlayBar.getChild(13)
- ?m.video.trickPlayBar.getChild(14)
- ?m.video.trickPlayBar.getChild(15)
- ?m.video.trickPlayBar.getChild(16)
- ?m.video.trickPlayBar.getChild(17)
- ?m.video.trickPlayBar.getChild(18)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090606.brs b/.history/components/keyboardScene_20211013090606.brs
deleted file mode 100644
index f2a067d..0000000
--- a/.history/components/keyboardScene_20211013090606.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ?m.video.trickPlayBar.getChild(10)
- ?m.video.trickPlayBar.getChild(11)
- ?m.video.trickPlayBar.getChild(12)
- ?m.video.trickPlayBar.getChild(13)
- ?m.video.trickPlayBar.getChild(14)
- ?m.video.trickPlayBar.getChild(15)
- ?m.video.trickPlayBar.getChild(16)
- ?m.video.trickPlayBar.getChild(17)
- ?m.video.trickPlayBar.getChild(18)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013090650.brs b/.history/components/keyboardScene_20211013090650.brs
deleted file mode 100644
index 85baf00..0000000
--- a/.history/components/keyboardScene_20211013090650.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ?m.video.trickPlayBar.getChild(1)
- ?m.video.trickPlayBar.getChild(2)
- ?m.video.trickPlayBar.getChild(3)
- ?m.video.trickPlayBar.getChild(4)
- ?m.video.trickPlayBar.getChild(14)
- ?m.video.trickPlayBar.getChild(15)
- ?m.video.trickPlayBar.getChild(16)
- ?m.video.trickPlayBar.getChild(17)
- ?m.video.trickPlayBar.getChild(18)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091239.brs b/.history/components/keyboardScene_20211013091239.brs
deleted file mode 100644
index c617de9..0000000
--- a/.history/components/keyboardScene_20211013091239.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.trickPlayBar.getChild(1).visible = false
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- ?m.video.trickPlayBar.getChild(14)
- ?m.video.trickPlayBar.getChild(15)
- ?m.video.trickPlayBar.getChild(16)
- ?m.video.trickPlayBar.getChild(17)
- ?m.video.trickPlayBar.getChild(18)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091250.brs b/.history/components/keyboardScene_20211013091250.brs
deleted file mode 100644
index 091a2e0..0000000
--- a/.history/components/keyboardScene_20211013091250.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber
- ' test
- m.video.trickPlayBar.getChild(1).visible = false
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ?m.video.trickPlayBar.getChild(14)
- ?m.video.trickPlayBar.getChild(15)
- ?m.video.trickPlayBar.getChild(16)
- ?m.video.trickPlayBar.getChild(17)
- ?m.video.trickPlayBar.getChild(18)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091409.brs b/.history/components/keyboardScene_20211013091409.brs
deleted file mode 100644
index 8724b9d..0000000
--- a/.history/components/keyboardScene_20211013091409.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber
- ' test
- m.video.trickPlayBar.getChild(1).visible = true
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ?m.video.trickPlayBar.getChild(14)
- ?m.video.trickPlayBar.getChild(15)
- ?m.video.trickPlayBar.getChild(16)
- ?m.video.trickPlayBar.getChild(17)
- ?m.video.trickPlayBar.getChild(18)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091433.brs b/.history/components/keyboardScene_20211013091433.brs
deleted file mode 100644
index 71b7471..0000000
--- a/.history/components/keyboardScene_20211013091433.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber
- ' test
- m.video.trickPlayBar.getChild(1).visible = true
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ?m.video.trickPlayBar.getChild(14)
- ?m.video.trickPlayBar.getChild(15)
- ?m.video.trickPlayBar.getChild(16)
- ?m.video.trickPlayBar.getChild(17)
- ?m.video.trickPlayBar.getChild(18)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091435.brs b/.history/components/keyboardScene_20211013091435.brs
deleted file mode 100644
index 81dc453..0000000
--- a/.history/components/keyboardScene_20211013091435.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber
- ' test
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ?m.video.trickPlayBar.getChild(14)
- ?m.video.trickPlayBar.getChild(15)
- ?m.video.trickPlayBar.getChild(16)
- ?m.video.trickPlayBar.getChild(17)
- ?m.video.trickPlayBar.getChild(18)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091614.brs b/.history/components/keyboardScene_20211013091614.brs
deleted file mode 100644
index 6a5de2c..0000000
--- a/.history/components/keyboardScene_20211013091614.brs
+++ /dev/null
@@ -1,126 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber
- ' test
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091744.brs b/.history/components/keyboardScene_20211013091744.brs
deleted file mode 100644
index fe529ae..0000000
--- a/.history/components/keyboardScene_20211013091744.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091801.brs b/.history/components/keyboardScene_20211013091801.brs
deleted file mode 100644
index 8db9fb6..0000000
--- a/.history/components/keyboardScene_20211013091801.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091824.brs b/.history/components/keyboardScene_20211013091824.brs
deleted file mode 100644
index 8c9ddea..0000000
--- a/.history/components/keyboardScene_20211013091824.brs
+++ /dev/null
@@ -1,126 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013091843.brs b/.history/components/keyboardScene_20211013091843.brs
deleted file mode 100644
index 24b2dd4..0000000
--- a/.history/components/keyboardScene_20211013091843.brs
+++ /dev/null
@@ -1,126 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChildCount()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013092139.brs b/.history/components/keyboardScene_20211013092139.brs
deleted file mode 100644
index 197b91d..0000000
--- a/.history/components/keyboardScene_20211013092139.brs
+++ /dev/null
@@ -1,127 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(0)
- ?m.video.getChild(1)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013092550.brs b/.history/components/keyboardScene_20211013092550.brs
deleted file mode 100644
index 1814aa7..0000000
--- a/.history/components/keyboardScene_20211013092550.brs
+++ /dev/null
@@ -1,126 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildCount()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013092609.brs b/.history/components/keyboardScene_20211013092609.brs
deleted file mode 100644
index 7ca691e..0000000
--- a/.history/components/keyboardScene_20211013092609.brs
+++ /dev/null
@@ -1,127 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildCount()
- ?m.video.trickPlayBar
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013092733.brs b/.history/components/keyboardScene_20211013092733.brs
deleted file mode 100644
index 880ef42..0000000
--- a/.history/components/keyboardScene_20211013092733.brs
+++ /dev/null
@@ -1,127 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- ?m.video.trickPlayBar
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013092747.brs b/.history/components/keyboardScene_20211013092747.brs
deleted file mode 100644
index f7d8969..0000000
--- a/.history/components/keyboardScene_20211013092747.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093145.brs b/.history/components/keyboardScene_20211013093145.brs
deleted file mode 100644
index c62669e..0000000
--- a/.history/components/keyboardScene_20211013093145.brs
+++ /dev/null
@@ -1,127 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093216.brs b/.history/components/keyboardScene_20211013093216.brs
deleted file mode 100644
index ac2ff6c..0000000
--- a/.history/components/keyboardScene_20211013093216.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- ?m.video.trickPlayBar.getParent().getChild(7)
- ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093416.brs b/.history/components/keyboardScene_20211013093416.brs
deleted file mode 100644
index 397c2ab..0000000
--- a/.history/components/keyboardScene_20211013093416.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChildCount()
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- ' ?m.video.trickPlayBar.getParent().getChild(7)
- ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093425.brs b/.history/components/keyboardScene_20211013093425.brs
deleted file mode 100644
index f40f734..0000000
--- a/.history/components/keyboardScene_20211013093425.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChildCount()
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChildCount
- ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093427.brs b/.history/components/keyboardScene_20211013093427.brs
deleted file mode 100644
index 3968b20..0000000
--- a/.history/components/keyboardScene_20211013093427.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChildCount()
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChildCount()
- ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093435.brs b/.history/components/keyboardScene_20211013093435.brs
deleted file mode 100644
index d9b7f3f..0000000
--- a/.history/components/keyboardScene_20211013093435.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChildCount()
- ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093609.brs b/.history/components/keyboardScene_20211013093609.brs
deleted file mode 100644
index c3a3d52..0000000
--- a/.history/components/keyboardScene_20211013093609.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093716.brs b/.history/components/keyboardScene_20211013093716.brs
deleted file mode 100644
index 9482fd0..0000000
--- a/.history/components/keyboardScene_20211013093716.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(8).vertiAlign = right
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093742.brs b/.history/components/keyboardScene_20211013093742.brs
deleted file mode 100644
index dca2f0a..0000000
--- a/.history/components/keyboardScene_20211013093742.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(8).vertAlign = right
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013093901.brs b/.history/components/keyboardScene_20211013093901.brs
deleted file mode 100644
index 33f0ea0..0000000
--- a/.history/components/keyboardScene_20211013093901.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(8).vertAlign = "right"
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094038.brs b/.history/components/keyboardScene_20211013094038.brs
deleted file mode 100644
index d8cd21d..0000000
--- a/.history/components/keyboardScene_20211013094038.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- m.video.trickPlayBar.getParent().getChild(8).vertAlign = "right"
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094149.brs b/.history/components/keyboardScene_20211013094149.brs
deleted file mode 100644
index 6046dec..0000000
--- a/.history/components/keyboardScene_20211013094149.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
- m.video.trickPlayBar.getParent().getChild(8).vertAlign = "right"
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094200.brs b/.history/components/keyboardScene_20211013094200.brs
deleted file mode 100644
index 3318142..0000000
--- a/.history/components/keyboardScene_20211013094200.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).vertAlign = "right"
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094215.brs b/.history/components/keyboardScene_20211013094215.brs
deleted file mode 100644
index 2813bd8..0000000
--- a/.history/components/keyboardScene_20211013094215.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
- m.video.trickPlayBar.getParent().getChild(8).vertAlign = "right"
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094311.brs b/.history/components/keyboardScene_20211013094311.brs
deleted file mode 100644
index 1bc5596..0000000
--- a/.history/components/keyboardScene_20211013094311.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
- m.video.trickPlayBar.getParent().getChild(8).vertAlign = "center"
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094327.brs b/.history/components/keyboardScene_20211013094327.brs
deleted file mode 100644
index 6d94a25..0000000
--- a/.history/components/keyboardScene_20211013094327.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
- m.video.trickPlayBar.getParent().getChild(8).vertAlign = "center"
- m.video.trickPlayBar.getParent().getChild(8).horizAlign = "right"
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094446.brs b/.history/components/keyboardScene_20211013094446.brs
deleted file mode 100644
index 4999272..0000000
--- a/.history/components/keyboardScene_20211013094446.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
- m.video.trickPlayBar.getParent().getChild(8).vertAlign = "center"
- m.video.trickPlayBar.getParent().getChild(8).horizAlgin = "right"
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094518.brs b/.history/components/keyboardScene_20211013094518.brs
deleted file mode 100644
index e80fd85..0000000
--- a/.history/components/keyboardScene_20211013094518.brs
+++ /dev/null
@@ -1,137 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
- m.video.trickPlayBar.getParent().getChild(8).vertAlign = "center"
- m.video.trickPlayBar.getParent().getChild(8).horizAlgin = "right"
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(7)
- ?m.video.trickPlayBar.getParent().getChild(8)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094725.brs b/.history/components/keyboardScene_20211013094725.brs
deleted file mode 100644
index 14d5e8b..0000000
--- a/.history/components/keyboardScene_20211013094725.brs
+++ /dev/null
@@ -1,140 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
- m.video.trickPlayBar.getParent().getChild(8).vertAlign = "center"
- m.video.trickPlayBar.getParent().getChild(8).horizAlgin = "right"
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(8)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094755.brs b/.history/components/keyboardScene_20211013094755.brs
deleted file mode 100644
index db51cd3..0000000
--- a/.history/components/keyboardScene_20211013094755.brs
+++ /dev/null
@@ -1,138 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(8)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094801.brs b/.history/components/keyboardScene_20211013094801.brs
deleted file mode 100644
index d1a27e3..0000000
--- a/.history/components/keyboardScene_20211013094801.brs
+++ /dev/null
@@ -1,138 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(7).getChild(0).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(2).height = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(3).height = 8
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(8)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013094955.brs b/.history/components/keyboardScene_20211013094955.brs
deleted file mode 100644
index 3e24701..0000000
--- a/.history/components/keyboardScene_20211013094955.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(7).getChild(0).bitmapHeight = 8
- m.video.trickPlayBar.getParent().getChild(7).getChild(2).bitmapHeight = 8
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(8)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095125.brs b/.history/components/keyboardScene_20211013095125.brs
deleted file mode 100644
index 220bd75..0000000
--- a/.history/components/keyboardScene_20211013095125.brs
+++ /dev/null
@@ -1,137 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getParent().getChild(7).getChild(0).bitmapHeight = 8.0
- m.video.trickPlayBar.getParent().getChild(7).getChild(1).bitmapHeight = 8.0
- m.video.trickPlayBar.getParent().getChild(7).getChild(2).bitmapHeight = 8.0
- m.video.trickPlayBar.getParent().getChild(7).getChild(3).bitmapHeight = 8.0
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(8)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095129.brs b/.history/components/keyboardScene_20211013095129.brs
deleted file mode 100644
index b734c72..0000000
--- a/.history/components/keyboardScene_20211013095129.brs
+++ /dev/null
@@ -1,133 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(8)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095302.brs b/.history/components/keyboardScene_20211013095302.brs
deleted file mode 100644
index 33ce3e1..0000000
--- a/.history/components/keyboardScene_20211013095302.brs
+++ /dev/null
@@ -1,135 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?subType(m.video.trickPlayBar.getParent().getChild(7))
- ?m.video.trickPlayBar.getParent().getChild(8)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095309.brs b/.history/components/keyboardScene_20211013095309.brs
deleted file mode 100644
index 17a64ce..0000000
--- a/.history/components/keyboardScene_20211013095309.brs
+++ /dev/null
@@ -1,135 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(7).subType()
- ?m.video.trickPlayBar.getParent().getChild(8)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095313.brs b/.history/components/keyboardScene_20211013095313.brs
deleted file mode 100644
index 540ac47..0000000
--- a/.history/components/keyboardScene_20211013095313.brs
+++ /dev/null
@@ -1,139 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(7).subType()
- ?m.video.trickPlayBar.getParent().getChild(8)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(7).getChild(0).bitmapHeight = 8.0
- m.video.trickPlayBar.getParent().getChild(7).getChild(1).bitmapHeight = 8.0
- m.video.trickPlayBar.getParent().getChild(7).getChild(2).bitmapHeight = 8.0
- m.video.trickPlayBar.getParent().getChild(7).getChild(3).bitmapHeight = 8.0
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095352.brs b/.history/components/keyboardScene_20211013095352.brs
deleted file mode 100644
index 7ea1c4a..0000000
--- a/.history/components/keyboardScene_20211013095352.brs
+++ /dev/null
@@ -1,138 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(8)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(7).getChild(0).bitmapHeight = 8.0
- m.video.trickPlayBar.getParent().getChild(7).getChild(1).bitmapHeight = 8.0
- m.video.trickPlayBar.getParent().getChild(7).getChild(2).bitmapHeight = 8.0
- m.video.trickPlayBar.getParent().getChild(7).getChild(3).bitmapHeight = 8.0
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095507.brs b/.history/components/keyboardScene_20211013095507.brs
deleted file mode 100644
index d5646e5..0000000
--- a/.history/components/keyboardScene_20211013095507.brs
+++ /dev/null
@@ -1,134 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(4)
- ?m.video.trickPlayBar.getParent().getChild(8)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095619.brs b/.history/components/keyboardScene_20211013095619.brs
deleted file mode 100644
index f82dedd..0000000
--- a/.history/components/keyboardScene_20211013095619.brs
+++ /dev/null
@@ -1,133 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(8)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013095915.brs b/.history/components/keyboardScene_20211013095915.brs
deleted file mode 100644
index 405a314..0000000
--- a/.history/components/keyboardScene_20211013095915.brs
+++ /dev/null
@@ -1,133 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(7).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(8)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100109.brs b/.history/components/keyboardScene_20211013100109.brs
deleted file mode 100644
index c0c36e8..0000000
--- a/.history/components/keyboardScene_20211013100109.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
- ?m.video.trickPlayBar.getParent().getChild(9).getChild(0)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100114.brs b/.history/components/keyboardScene_20211013100114.brs
deleted file mode 100644
index 9c94fb4..0000000
--- a/.history/components/keyboardScene_20211013100114.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
- ?m.video.trickPlayBar.getParent().getChild(9)
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100321.brs b/.history/components/keyboardScene_20211013100321.brs
deleted file mode 100644
index 353d1d2..0000000
--- a/.history/components/keyboardScene_20211013100321.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- ?m.video.trickPlayBar.getParent().getChild(10)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100413.brs b/.history/components/keyboardScene_20211013100413.brs
deleted file mode 100644
index f3de087..0000000
--- a/.history/components/keyboardScene_20211013100413.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ?m.video.trickPlayBar.getParent().getChild(10)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100611.brs b/.history/components/keyboardScene_20211013100611.brs
deleted file mode 100644
index b3f2e66..0000000
--- a/.history/components/keyboardScene_20211013100611.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100704.brs b/.history/components/keyboardScene_20211013100704.brs
deleted file mode 100644
index b3f2e66..0000000
--- a/.history/components/keyboardScene_20211013100704.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100732.brs b/.history/components/keyboardScene_20211013100732.brs
deleted file mode 100644
index 43402d6..0000000
--- a/.history/components/keyboardScene_20211013100732.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(7)
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013100741.brs b/.history/components/keyboardScene_20211013100741.brs
deleted file mode 100644
index b3f2e66..0000000
--- a/.history/components/keyboardScene_20211013100741.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getParent().getChild(7).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101010.brs b/.history/components/keyboardScene_20211013101010.brs
deleted file mode 100644
index 6a133e5..0000000
--- a/.history/components/keyboardScene_20211013101010.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChildCount()
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101053.brs b/.history/components/keyboardScene_20211013101053.brs
deleted file mode 100644
index 99fda62..0000000
--- a/.history/components/keyboardScene_20211013101053.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChildCount()
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101209.brs b/.history/components/keyboardScene_20211013101209.brs
deleted file mode 100644
index 4a94f80..0000000
--- a/.history/components/keyboardScene_20211013101209.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ?m.video.trickPlayBar.getChild(0)
- ?m.video.trickPlayBar.getChild(1)
- ?m.video.trickPlayBar.getChild(2)
- ?m.video.trickPlayBar.getChild(2)
- ?m.video.trickPlayBar.getChild(3)
- ?m.video.trickPlayBar.getChild(4)
- ?m.video.trickPlayBar.getChild(5)
- ?m.video.trickPlayBar.getChild(6)
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101219.brs b/.history/components/keyboardScene_20211013101219.brs
deleted file mode 100644
index d00c9c9..0000000
--- a/.history/components/keyboardScene_20211013101219.brs
+++ /dev/null
@@ -1,138 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ?m.video.trickPlayBar.getChild(0)
- ?m.video.trickPlayBar.getChild(1)
- ?m.video.trickPlayBar.getChild(2)
- ?m.video.trickPlayBar.getChild(2)
- ?m.video.trickPlayBar.getChild(3)
- ?m.video.trickPlayBar.getChild(4)
- ?m.video.trickPlayBar.getChild(5)
- ?m.video.trickPlayBar.getChild(6)
- ?m.video.trickPlayBar.getChild(7)
- ?m.video.trickPlayBar.getChild(8)
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101612.brs b/.history/components/keyboardScene_20211013101612.brs
deleted file mode 100644
index fa94b56..0000000
--- a/.history/components/keyboardScene_20211013101612.brs
+++ /dev/null
@@ -1,139 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ?m.video.trickPlayBar.getChild(0)
- ?m.video.trickPlayBar.getChild(1)
- ?m.video.trickPlayBar.getChild(2)
- ?m.video.trickPlayBar.getChild(2)
- ?m.video.trickPlayBar.getChild(3)
- ?m.video.trickPlayBar.getChild(4)
- ?m.video.trickPlayBar.getChild(5)
- ?m.video.trickPlayBar.getChild(6)
- ?m.video.trickPlayBar.getChild(7)
- ?m.video.trickPlayBar.getChild(8)
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101628.brs b/.history/components/keyboardScene_20211013101628.brs
deleted file mode 100644
index fa94b56..0000000
--- a/.history/components/keyboardScene_20211013101628.brs
+++ /dev/null
@@ -1,139 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ?m.video.trickPlayBar.getChild(0)
- ?m.video.trickPlayBar.getChild(1)
- ?m.video.trickPlayBar.getChild(2)
- ?m.video.trickPlayBar.getChild(2)
- ?m.video.trickPlayBar.getChild(3)
- ?m.video.trickPlayBar.getChild(4)
- ?m.video.trickPlayBar.getChild(5)
- ?m.video.trickPlayBar.getChild(6)
- ?m.video.trickPlayBar.getChild(7)
- ?m.video.trickPlayBar.getChild(8)
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101701.brs b/.history/components/keyboardScene_20211013101701.brs
deleted file mode 100644
index 490fe15..0000000
--- a/.history/components/keyboardScene_20211013101701.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101702.brs b/.history/components/keyboardScene_20211013101702.brs
deleted file mode 100644
index bda3921..0000000
--- a/.history/components/keyboardScene_20211013101702.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.height = 10
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101804.brs b/.history/components/keyboardScene_20211013101804.brs
deleted file mode 100644
index 4179798..0000000
--- a/.history/components/keyboardScene_20211013101804.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 8.0
- m.video.bufferingBar.height = 8.0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013101906.brs b/.history/components/keyboardScene_20211013101906.brs
deleted file mode 100644
index 9ef3a7b..0000000
--- a/.history/components/keyboardScene_20211013101906.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 8.0
- m.video.bufferingBar.height = 8.0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.retrievingBar.height = 8.0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102044.brs b/.history/components/keyboardScene_20211013102044.brs
deleted file mode 100644
index 3ccf95c..0000000
--- a/.history/components/keyboardScene_20211013102044.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 8.0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.retrievingBar.height = 8.0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102050.brs b/.history/components/keyboardScene_20211013102050.brs
deleted file mode 100644
index 38bfdcf..0000000
--- a/.history/components/keyboardScene_20211013102050.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 8.0
- ?m.video.bufferingBar.height
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.retrievingBar.height = 8.0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102112.brs b/.history/components/keyboardScene_20211013102112.brs
deleted file mode 100644
index 6b58380..0000000
--- a/.history/components/keyboardScene_20211013102112.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 8.0
- ?m.video.bufferingBar.height
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.retrievingBar.height = 8.0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102231.brs b/.history/components/keyboardScene_20211013102231.brs
deleted file mode 100644
index 497a261..0000000
--- a/.history/components/keyboardScene_20211013102231.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 8.0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.retrievingBar.height = 8.0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102345.brs b/.history/components/keyboardScene_20211013102345.brs
deleted file mode 100644
index b7ff957..0000000
--- a/.history/components/keyboardScene_20211013102345.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 8.0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.retrievingBar.height = 8.0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.width = 50
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102451.brs b/.history/components/keyboardScene_20211013102451.brs
deleted file mode 100644
index bb15b9b..0000000
--- a/.history/components/keyboardScene_20211013102451.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 4.0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.retrievingBar.height = 8.0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.width = 50
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102459.brs b/.history/components/keyboardScene_20211013102459.brs
deleted file mode 100644
index e9df415..0000000
--- a/.history/components/keyboardScene_20211013102459.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 4.0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.retrievingBar.height = 8.0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102726.brs b/.history/components/keyboardScene_20211013102726.brs
deleted file mode 100644
index a584454..0000000
--- a/.history/components/keyboardScene_20211013102726.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 4.0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.retrievingBar.height = 8.0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102731.brs b/.history/components/keyboardScene_20211013102731.brs
deleted file mode 100644
index 25c5e45..0000000
--- a/.history/components/keyboardScene_20211013102731.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 8.0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.retrievingBar.height = 8.0
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102735.brs b/.history/components/keyboardScene_20211013102735.brs
deleted file mode 100644
index ca88203..0000000
--- a/.history/components/keyboardScene_20211013102735.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 8.0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013102942.brs b/.history/components/keyboardScene_20211013102942.brs
deleted file mode 100644
index cf8097d..0000000
--- a/.history/components/keyboardScene_20211013102942.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103048.brs b/.history/components/keyboardScene_20211013103048.brs
deleted file mode 100644
index 692ef6f..0000000
--- a/.history/components/keyboardScene_20211013103048.brs
+++ /dev/null
@@ -1,126 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
-
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103053.brs b/.history/components/keyboardScene_20211013103053.brs
deleted file mode 100644
index 19556b5..0000000
--- a/.history/components/keyboardScene_20211013103053.brs
+++ /dev/null
@@ -1,124 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103117.brs b/.history/components/keyboardScene_20211013103117.brs
deleted file mode 100644
index 19556b5..0000000
--- a/.history/components/keyboardScene_20211013103117.brs
+++ /dev/null
@@ -1,124 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103253.brs b/.history/components/keyboardScene_20211013103253.brs
deleted file mode 100644
index 16a41c3..0000000
--- a/.history/components/keyboardScene_20211013103253.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103329.brs b/.history/components/keyboardScene_20211013103329.brs
deleted file mode 100644
index ef36ed3..0000000
--- a/.history/components/keyboardScene_20211013103329.brs
+++ /dev/null
@@ -1,126 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(3)
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103340.brs b/.history/components/keyboardScene_20211013103340.brs
deleted file mode 100644
index ef1aaae..0000000
--- a/.history/components/keyboardScene_20211013103340.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(3)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103508.brs b/.history/components/keyboardScene_20211013103508.brs
deleted file mode 100644
index 29b5cb6..0000000
--- a/.history/components/keyboardScene_20211013103508.brs
+++ /dev/null
@@ -1,124 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103610.brs b/.history/components/keyboardScene_20211013103610.brs
deleted file mode 100644
index 506e4c1..0000000
--- a/.history/components/keyboardScene_20211013103610.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
- ?m.video.trickPlayBar.getParent().getChild(10)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013103822.brs b/.history/components/keyboardScene_20211013103822.brs
deleted file mode 100644
index 11b3c43..0000000
--- a/.history/components/keyboardScene_20211013103822.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
- ?m.video.bufferingBar
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013104007.brs b/.history/components/keyboardScene_20211013104007.brs
deleted file mode 100644
index cee0f8d..0000000
--- a/.history/components/keyboardScene_20211013104007.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
- ?m.video.bufferingBar.getChildCount()
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013104125.brs b/.history/components/keyboardScene_20211013104125.brs
deleted file mode 100644
index 1a824c7..0000000
--- a/.history/components/keyboardScene_20211013104125.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
- ?m.video.bufferingBar.getChild(0)
- ?m.video.bufferingBar.getChild(2)
- ?m.video.bufferingBar.getChild(3)
- ?m.video.bufferingBar.getChild(4)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013104129.brs b/.history/components/keyboardScene_20211013104129.brs
deleted file mode 100644
index d952426..0000000
--- a/.history/components/keyboardScene_20211013104129.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
- ?m.video.bufferingBar.getChild(0)
- ?m.video.bufferingBar.getChild(1)
- ?m.video.bufferingBar.getChild(2)
- ?m.video.bufferingBar.getChild(3)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013104607.brs b/.history/components/keyboardScene_20211013104607.brs
deleted file mode 100644
index 69b3d8b..0000000
--- a/.history/components/keyboardScene_20211013104607.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013111804.brs b/.history/components/keyboardScene_20211013111804.brs
deleted file mode 100644
index 705add1..0000000
--- a/.history/components/keyboardScene_20211013111804.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013112056.brs b/.history/components/keyboardScene_20211013112056.brs
deleted file mode 100644
index 701cfd7..0000000
--- a/.history/components/keyboardScene_20211013112056.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013112130.brs b/.history/components/keyboardScene_20211013112130.brs
deleted file mode 100644
index 7ae7ecc..0000000
--- a/.history/components/keyboardScene_20211013112130.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013112734.brs b/.history/components/keyboardScene_20211013112734.brs
deleted file mode 100644
index 567d1d8..0000000
--- a/.history/components/keyboardScene_20211013112734.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013112809.brs b/.history/components/keyboardScene_20211013112809.brs
deleted file mode 100644
index 240722e..0000000
--- a/.history/components/keyboardScene_20211013112809.brs
+++ /dev/null
@@ -1,149 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- handled = false
- if press then
- if (key = "back") then
- handled = false
- else
- if (m.warninglabel.visible = false)
- m.warninglabel.visible = "true"
- else
- if (key = "OK") then
- m.warninglabel.visible = "false"
- end if
- end if
- handled = true
- end if
- end if
- return handled
-end function
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013112832.brs b/.history/components/keyboardScene_20211013112832.brs
deleted file mode 100644
index 42fcd6b..0000000
--- a/.history/components/keyboardScene_20211013112832.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013112904.brs b/.history/components/keyboardScene_20211013112904.brs
deleted file mode 100644
index 42fcd6b..0000000
--- a/.history/components/keyboardScene_20211013112904.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013112911.brs b/.history/components/keyboardScene_20211013112911.brs
deleted file mode 100644
index 737aebb..0000000
--- a/.history/components/keyboardScene_20211013112911.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013112916.brs b/.history/components/keyboardScene_20211013112916.brs
deleted file mode 100644
index 3ff9784..0000000
--- a/.history/components/keyboardScene_20211013112916.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013112931.brs b/.history/components/keyboardScene_20211013112931.brs
deleted file mode 100644
index 0c776d0..0000000
--- a/.history/components/keyboardScene_20211013112931.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND m.video.trickPlayBar.visible = false
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013112957.brs b/.history/components/keyboardScene_20211013112957.brs
deleted file mode 100644
index 798b48c..0000000
--- a/.history/components/keyboardScene_20211013112957.brs
+++ /dev/null
@@ -1,134 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND m.video.trickPlayBar.visible = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.visible.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013113346.brs b/.history/components/keyboardScene_20211013113346.brs
deleted file mode 100644
index 59d6599..0000000
--- a/.history/components/keyboardScene_20211013113346.brs
+++ /dev/null
@@ -1,134 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND tricky = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.visible.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- tricky = createObject("roSGNode", "TrickPlay")
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013113353.brs b/.history/components/keyboardScene_20211013113353.brs
deleted file mode 100644
index 643b7c1..0000000
--- a/.history/components/keyboardScene_20211013113353.brs
+++ /dev/null
@@ -1,134 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND tricky.visible = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.visible.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- tricky = createObject("roSGNode", "TrickPlay")
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013113420.brs b/.history/components/keyboardScene_20211013113420.brs
deleted file mode 100644
index 93a4349..0000000
--- a/.history/components/keyboardScene_20211013113420.brs
+++ /dev/null
@@ -1,135 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND tricky.visible = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.visible.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- tricky = createObject("roSGNode", "TrickPlay")
- tricky.visible = false
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013113430.brs b/.history/components/keyboardScene_20211013113430.brs
deleted file mode 100644
index a6019c4..0000000
--- a/.history/components/keyboardScene_20211013113430.brs
+++ /dev/null
@@ -1,135 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND, .tricky.visible = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.visible.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- , .tricky = createObject("roSGNode", "TrickPlay")
- , .tricky.visible = false
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013113434.brs b/.history/components/keyboardScene_20211013113434.brs
deleted file mode 100644
index 576400d..0000000
--- a/.history/components/keyboardScene_20211013113434.brs
+++ /dev/null
@@ -1,135 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND m.tricky.visible = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.visible.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.tricky.visible = false
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013113448.brs b/.history/components/keyboardScene_20211013113448.brs
deleted file mode 100644
index 6a0b6b4..0000000
--- a/.history/components/keyboardScene_20211013113448.brs
+++ /dev/null
@@ -1,135 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND m.tricky.visible = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.tricky.visible = false
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013113930.brs b/.history/components/keyboardScene_20211013113930.brs
deleted file mode 100644
index ce2bccd..0000000
--- a/.history/components/keyboardScene_20211013113930.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND m.tricky.visible = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.tricky.visible = false
- m.video.appendChild(m.tricky)
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013114149.brs b/.history/components/keyboardScene_20211013114149.brs
deleted file mode 100644
index 08772fa..0000000
--- a/.history/components/keyboardScene_20211013114149.brs
+++ /dev/null
@@ -1,135 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND m.tricky.visible = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.video.appendChild(m.tricky)
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013114208.brs b/.history/components/keyboardScene_20211013114208.brs
deleted file mode 100644
index 801dd7c..0000000
--- a/.history/components/keyboardScene_20211013114208.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND m.tricky.visible = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.video.appendChild(m.tricky)
- ?m.video.getChildren(2, 0)
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013114259.brs b/.history/components/keyboardScene_20211013114259.brs
deleted file mode 100644
index b1f96f4..0000000
--- a/.history/components/keyboardScene_20211013114259.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND m.tricky.visible = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.video.appendChild(m.tricky)
- ?m.video.getChild(1)
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013114359.brs b/.history/components/keyboardScene_20211013114359.brs
deleted file mode 100644
index 9700396..0000000
--- a/.history/components/keyboardScene_20211013114359.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND m.tricky.visible = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.video.appendChild(m.tricky)
- ?m.video.getChild(1).getChildCount()
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013114558.brs b/.history/components/keyboardScene_20211013114558.brs
deleted file mode 100644
index 7b70857..0000000
--- a/.history/components/keyboardScene_20211013114558.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND m.tricky.visible = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- ?m.video.removeChildrenIndex(1, 1)
- m.video.appendChild(m.tricky)
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013114601.brs b/.history/components/keyboardScene_20211013114601.brs
deleted file mode 100644
index f899858..0000000
--- a/.history/components/keyboardScene_20211013114601.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND m.tricky.visible = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.video.removeChildrenIndex(1, 1)
- m.video.appendChild(m.tricky)
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013114638.brs b/.history/components/keyboardScene_20211013114638.brs
deleted file mode 100644
index ae035b9..0000000
--- a/.history/components/keyboardScene_20211013114638.brs
+++ /dev/null
@@ -1,137 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND m.tricky.visible = false
- m.video.trickPlayBar.visible = true
- m.video.trickPlayBar.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.enableTrickPlay = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.video.removeChildrenIndex(1, 1)
- m.video.appendChild(m.tricky)
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013114900.brs b/.history/components/keyboardScene_20211013114900.brs
deleted file mode 100644
index 80b1e57..0000000
--- a/.history/components/keyboardScene_20211013114900.brs
+++ /dev/null
@@ -1,137 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND m.tricky.visible = false
- m.video.visible = true
- m.video.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.enableTrickPlay = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.video.removeChildrenIndex(1, 1)
- m.video.appendChild(m.tricky)
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013114903.brs b/.history/components/keyboardScene_20211013114903.brs
deleted file mode 100644
index f7b1399..0000000
--- a/.history/components/keyboardScene_20211013114903.brs
+++ /dev/null
@@ -1,137 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- else if press AND m.tricky.visible = false
- m.video.tricky.visible = true
- m.video.tricky.setFocus(true)
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.enableTrickPlay = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.video.removeChildrenIndex(1, 1)
- m.video.appendChild(m.tricky)
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013114922.brs b/.history/components/keyboardScene_20211013114922.brs
deleted file mode 100644
index 17d7d12..0000000
--- a/.history/components/keyboardScene_20211013114922.brs
+++ /dev/null
@@ -1,134 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.enableTrickPlay = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.video.removeChildrenIndex(1, 1)
- m.video.appendChild(m.tricky)
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013114926.brs b/.history/components/keyboardScene_20211013114926.brs
deleted file mode 100644
index 265e29f..0000000
--- a/.history/components/keyboardScene_20211013114926.brs
+++ /dev/null
@@ -1,135 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.enableTrickPlay = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.video.removeChildrenIndex(1, 1)
- m.video.appendChild(m.tricky)
- m.video.tricky.setFocus(true)
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013115137.brs b/.history/components/keyboardScene_20211013115137.brs
deleted file mode 100644
index 265e29f..0000000
--- a/.history/components/keyboardScene_20211013115137.brs
+++ /dev/null
@@ -1,135 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.enableTrickPlay = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.video.removeChildrenIndex(1, 1)
- m.video.appendChild(m.tricky)
- m.video.tricky.setFocus(true)
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013115148.brs b/.history/components/keyboardScene_20211013115148.brs
deleted file mode 100644
index 10747a0..0000000
--- a/.history/components/keyboardScene_20211013115148.brs
+++ /dev/null
@@ -1,135 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.enableTrickPlay = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.video.removeChildrenIndex(1, 1)
- m.video.appendChild(m.tricky)
- m.video.getChild(1).setFocus(true)
- ' m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- ' m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- ' m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- ' m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- ' m.video.trickPlayBar.getChild(0).height = 8
- ' m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013115449.brs b/.history/components/keyboardScene_20211013115449.brs
deleted file mode 100644
index a584fac..0000000
--- a/.history/components/keyboardScene_20211013115449.brs
+++ /dev/null
@@ -1,115 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = false
- m.video.enableTrickPlay = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.video.removeChildrenIndex(1, 1)
- m.video.appendChild(m.tricky)
- m.video.getChild(1).setFocus(true)
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013115508.brs b/.history/components/keyboardScene_20211013115508.brs
deleted file mode 100644
index f44d00f..0000000
--- a/.history/components/keyboardScene_20211013115508.brs
+++ /dev/null
@@ -1,115 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = true
- m.video.enableTrickPlay = false
- m.video.seekMode = "accurate"
- m.tricky = createObject("roSGNode", "TrickPlay")
- m.video.removeChildrenIndex(1, 1)
- m.video.appendChild(m.tricky)
- m.video.getChild(1).setFocus(true)
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013115641.brs b/.history/components/keyboardScene_20211013115641.brs
deleted file mode 100644
index cdbf5d1..0000000
--- a/.history/components/keyboardScene_20211013115641.brs
+++ /dev/null
@@ -1,113 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = true
- m.video.enableTrickPlay = false
- m.video.seekMode = "accurate"
- m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
-
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013115642.brs b/.history/components/keyboardScene_20211013115642.brs
deleted file mode 100644
index 63d1170..0000000
--- a/.history/components/keyboardScene_20211013115642.brs
+++ /dev/null
@@ -1,112 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.enableUI = true
- m.video.enableTrickPlay = false
- m.video.seekMode = "accurate"
- m.video.trickPlayBar = createObject("roSGNode", "TrickPlay")
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- ' m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
-
diff --git a/.history/components/keyboardScene_20211013120029.brs b/.history/components/keyboardScene_20211013120029.brs
deleted file mode 100644
index e28a087..0000000
--- a/.history/components/keyboardScene_20211013120029.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120221.brs b/.history/components/keyboardScene_20211013120221.brs
deleted file mode 100644
index e28a087..0000000
--- a/.history/components/keyboardScene_20211013120221.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120222.brs b/.history/components/keyboardScene_20211013120222.brs
deleted file mode 100644
index e28a087..0000000
--- a/.history/components/keyboardScene_20211013120222.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120224.brs b/.history/components/keyboardScene_20211013120224.brs
deleted file mode 100644
index e28a087..0000000
--- a/.history/components/keyboardScene_20211013120224.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ' ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120310.brs b/.history/components/keyboardScene_20211013120310.brs
deleted file mode 100644
index 9710723..0000000
--- a/.history/components/keyboardScene_20211013120310.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120433.brs b/.history/components/keyboardScene_20211013120433.brs
deleted file mode 100644
index 51fa59b..0000000
--- a/.history/components/keyboardScene_20211013120433.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).opacity = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120455.brs b/.history/components/keyboardScene_20211013120455.brs
deleted file mode 100644
index fcab9aa..0000000
--- a/.history/components/keyboardScene_20211013120455.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).opacity = false
- m.video.trickPlayBar.getChild(3).opacity = false
- m.video.trickPlayBar.getChild(4).opacity = false
- m.video.trickPlayBar.getChild(5).opacity = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120556.brs b/.history/components/keyboardScene_20211013120556.brs
deleted file mode 100644
index 5c27072..0000000
--- a/.history/components/keyboardScene_20211013120556.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120716.brs b/.history/components/keyboardScene_20211013120716.brs
deleted file mode 100644
index 69b3d8b..0000000
--- a/.history/components/keyboardScene_20211013120716.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120749.brs b/.history/components/keyboardScene_20211013120749.brs
deleted file mode 100644
index 5a7c9c2..0000000
--- a/.history/components/keyboardScene_20211013120749.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120941.brs b/.history/components/keyboardScene_20211013120941.brs
deleted file mode 100644
index 5a7c9c2..0000000
--- a/.history/components/keyboardScene_20211013120941.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013120950.brs b/.history/components/keyboardScene_20211013120950.brs
deleted file mode 100644
index 69b3d8b..0000000
--- a/.history/components/keyboardScene_20211013120950.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121009.brs b/.history/components/keyboardScene_20211013121009.brs
deleted file mode 100644
index b1f829e..0000000
--- a/.history/components/keyboardScene_20211013121009.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.thumbBlendColor = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121301.brs b/.history/components/keyboardScene_20211013121301.brs
deleted file mode 100644
index 8308af8..0000000
--- a/.history/components/keyboardScene_20211013121301.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.thumbBlendColor = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121308.brs b/.history/components/keyboardScene_20211013121308.brs
deleted file mode 100644
index f8e277a..0000000
--- a/.history/components/keyboardScene_20211013121308.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121430.brs b/.history/components/keyboardScene_20211013121430.brs
deleted file mode 100644
index f8e277a..0000000
--- a/.history/components/keyboardScene_20211013121430.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121510.brs b/.history/components/keyboardScene_20211013121510.brs
deleted file mode 100644
index 55d51e5..0000000
--- a/.history/components/keyboardScene_20211013121510.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChild(1)
-
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121513.brs b/.history/components/keyboardScene_20211013121513.brs
deleted file mode 100644
index deaceb2..0000000
--- a/.history/components/keyboardScene_20211013121513.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChild(1)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121642.brs b/.history/components/keyboardScene_20211013121642.brs
deleted file mode 100644
index 8f1ce32..0000000
--- a/.history/components/keyboardScene_20211013121642.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121733.brs b/.history/components/keyboardScene_20211013121733.brs
deleted file mode 100644
index 8b599cc..0000000
--- a/.history/components/keyboardScene_20211013121733.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(9)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121813.brs b/.history/components/keyboardScene_20211013121813.brs
deleted file mode 100644
index abfbe1a..0000000
--- a/.history/components/keyboardScene_20211013121813.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(9)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013121920.brs b/.history/components/keyboardScene_20211013121920.brs
deleted file mode 100644
index 07543be..0000000
--- a/.history/components/keyboardScene_20211013121920.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getParent().getChild(9)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013122052.brs b/.history/components/keyboardScene_20211013122052.brs
deleted file mode 100644
index 05c4663..0000000
--- a/.history/components/keyboardScene_20211013122052.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getParent().getChild(5)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013122203.brs b/.history/components/keyboardScene_20211013122203.brs
deleted file mode 100644
index c1157a7..0000000
--- a/.history/components/keyboardScene_20211013122203.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getParent().getChild(5).getChildCount()
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013122255.brs b/.history/components/keyboardScene_20211013122255.brs
deleted file mode 100644
index 9309175..0000000
--- a/.history/components/keyboardScene_20211013122255.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getParent().getChild(5).getChildren(19, 0)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013122346.brs b/.history/components/keyboardScene_20211013122346.brs
deleted file mode 100644
index e17ba6d..0000000
--- a/.history/components/keyboardScene_20211013122346.brs
+++ /dev/null
@@ -1,138 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(4)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(5)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(6)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(7)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(8)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
- ?m.video.trickPlayBar.getParent().getChild(8)
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013122751.brs b/.history/components/keyboardScene_20211013122751.brs
deleted file mode 100644
index 94f155d..0000000
--- a/.history/components/keyboardScene_20211013122751.brs
+++ /dev/null
@@ -1,137 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(4)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(5)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(6)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(7)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(8)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013122827.brs b/.history/components/keyboardScene_20211013122827.brs
deleted file mode 100644
index ed9fcd6..0000000
--- a/.history/components/keyboardScene_20211013122827.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013122956.brs b/.history/components/keyboardScene_20211013122956.brs
deleted file mode 100644
index cd491c1..0000000
--- a/.history/components/keyboardScene_20211013122956.brs
+++ /dev/null
@@ -1,137 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(2).translation = [200, 200]
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(4)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(5)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(6)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(7)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(8)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123106.brs b/.history/components/keyboardScene_20211013123106.brs
deleted file mode 100644
index cf99521..0000000
--- a/.history/components/keyboardScene_20211013123106.brs
+++ /dev/null
@@ -1,137 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(1)
- m.video.trickPlayBar.getParent().getChild(5).getChild(2).translation = [200, 200]
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(4)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(5)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(6)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(7)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(8)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123338.brs b/.history/components/keyboardScene_20211013123338.brs
deleted file mode 100644
index 919845d..0000000
--- a/.history/components/keyboardScene_20211013123338.brs
+++ /dev/null
@@ -1,137 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(4)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(5)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(6)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(7)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(8)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ?m.video.trickPlayBar.getChild(2).visible = false
- ?m.video.trickPlayBar.getChild(3)
- ?m.video.trickPlayBar.getChild(4)
- ?m.video.trickPlayBar.getChild(5)
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123348.brs b/.history/components/keyboardScene_20211013123348.brs
deleted file mode 100644
index 1bcbdb1..0000000
--- a/.history/components/keyboardScene_20211013123348.brs
+++ /dev/null
@@ -1,137 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(4)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(5)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(6)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(7)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(8)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ?m.video.trickPlayBar.getChild(2)
- ?m.video.trickPlayBar.getChild(3)
- ?m.video.trickPlayBar.getChild(4)
- ?m.video.trickPlayBar.getChild(5)
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123553.brs b/.history/components/keyboardScene_20211013123553.brs
deleted file mode 100644
index 94f155d..0000000
--- a/.history/components/keyboardScene_20211013123553.brs
+++ /dev/null
@@ -1,137 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(0)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(1)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(2)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(3)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(4)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(5)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(6)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(7)
- ?m.video.trickPlayBar.getParent().getChild(5).getChild(8)
- ' ?m.video.trickPlayBar.getChildren(19, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' ?m.video.trickPlayBar.getChild(9)
-
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123635.brs b/.history/components/keyboardScene_20211013123635.brs
deleted file mode 100644
index 675098d..0000000
--- a/.history/components/keyboardScene_20211013123635.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123640.brs b/.history/components/keyboardScene_20211013123640.brs
deleted file mode 100644
index acdd585..0000000
--- a/.history/components/keyboardScene_20211013123640.brs
+++ /dev/null
@@ -1,124 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123711.brs b/.history/components/keyboardScene_20211013123711.brs
deleted file mode 100644
index 7d4f295..0000000
--- a/.history/components/keyboardScene_20211013123711.brs
+++ /dev/null
@@ -1,124 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(1).opacity = 0
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123930.brs b/.history/components/keyboardScene_20211013123930.brs
deleted file mode 100644
index 6d8dca9..0000000
--- a/.history/components/keyboardScene_20211013123930.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
-
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013123941.brs b/.history/components/keyboardScene_20211013123941.brs
deleted file mode 100644
index 417e8a5..0000000
--- a/.history/components/keyboardScene_20211013123941.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ?m.video.getChild(0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124048.brs b/.history/components/keyboardScene_20211013124048.brs
deleted file mode 100644
index b490b6e..0000000
--- a/.history/components/keyboardScene_20211013124048.brs
+++ /dev/null
@@ -1,124 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124103.brs b/.history/components/keyboardScene_20211013124103.brs
deleted file mode 100644
index 654e960..0000000
--- a/.history/components/keyboardScene_20211013124103.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- m.video.bufferingBar.height = 8.0
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ' m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124315.brs b/.history/components/keyboardScene_20211013124315.brs
deleted file mode 100644
index b490b6e..0000000
--- a/.history/components/keyboardScene_20211013124315.brs
+++ /dev/null
@@ -1,124 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124342.brs b/.history/components/keyboardScene_20211013124342.brs
deleted file mode 100644
index 654e960..0000000
--- a/.history/components/keyboardScene_20211013124342.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- m.video.bufferingBar.height = 8.0
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ' m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124356.brs b/.history/components/keyboardScene_20211013124356.brs
deleted file mode 100644
index 3c3c212..0000000
--- a/.history/components/keyboardScene_20211013124356.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.bufferingBar.height = 8.0
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ' m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124407.brs b/.history/components/keyboardScene_20211013124407.brs
deleted file mode 100644
index 95f30e9..0000000
--- a/.history/components/keyboardScene_20211013124407.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.bufferingBar.height = 8.0
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- ' m.video.bufferingBar.height = 8.0
-
-
- ' logging
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124600.brs b/.history/components/keyboardScene_20211013124600.brs
deleted file mode 100644
index f11c535..0000000
--- a/.history/components/keyboardScene_20211013124600.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124601.brs b/.history/components/keyboardScene_20211013124601.brs
deleted file mode 100644
index 77149f7..0000000
--- a/.history/components/keyboardScene_20211013124601.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
-
-
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124605.brs b/.history/components/keyboardScene_20211013124605.brs
deleted file mode 100644
index 296a08c..0000000
--- a/.history/components/keyboardScene_20211013124605.brs
+++ /dev/null
@@ -1,119 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124801.brs b/.history/components/keyboardScene_20211013124801.brs
deleted file mode 100644
index bf6f2dd..0000000
--- a/.history/components/keyboardScene_20211013124801.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ØŸm.video.trickPlayBar.getChild(0)
- ?m.video.trickPlayBar.getChild(1)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124803.brs b/.history/components/keyboardScene_20211013124803.brs
deleted file mode 100644
index 01ac070..0000000
--- a/.history/components/keyboardScene_20211013124803.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(0)
- ?m.video.trickPlayBar.getChild(1)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124813.brs b/.history/components/keyboardScene_20211013124813.brs
deleted file mode 100644
index b3f7570..0000000
--- a/.history/components/keyboardScene_20211013124813.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(0)
- ?m.video.trickPlayBar.getChild(1)
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013124917.brs b/.history/components/keyboardScene_20211013124917.brs
deleted file mode 100644
index 4f99faa..0000000
--- a/.history/components/keyboardScene_20211013124917.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(0).translation
- ?m.video.trickPlayBar.getChild(1).translation
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013125042.brs b/.history/components/keyboardScene_20211013125042.brs
deleted file mode 100644
index 95dfe87..0000000
--- a/.history/components/keyboardScene_20211013125042.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 16]
- ?m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 16]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013125125.brs b/.history/components/keyboardScene_20211013125125.brs
deleted file mode 100644
index fd8d6c2..0000000
--- a/.history/components/keyboardScene_20211013125125.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 16]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 16]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013125245.brs b/.history/components/keyboardScene_20211013125245.brs
deleted file mode 100644
index 9f59935..0000000
--- a/.history/components/keyboardScene_20211013125245.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013125422.brs b/.history/components/keyboardScene_20211013125422.brs
deleted file mode 100644
index 48bf2e1..0000000
--- a/.history/components/keyboardScene_20211013125422.brs
+++ /dev/null
@@ -1,123 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(0)
- ?m.video.trickPlayBar.getChild(1)
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013125550.brs b/.history/components/keyboardScene_20211013125550.brs
deleted file mode 100644
index b985ba6..0000000
--- a/.history/components/keyboardScene_20211013125550.brs
+++ /dev/null
@@ -1,123 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0xFFFFFF00"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(0).getParent()
- ?m.video.trickPlayBar.getChild(1).getParent()
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013125740.brs b/.history/components/keyboardScene_20211013125740.brs
deleted file mode 100644
index d6e7bc4..0000000
--- a/.history/components/keyboardScene_20211013125740.brs
+++ /dev/null
@@ -1,123 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(0).getParent()
- ?m.video.trickPlayBar.getChild(1).getParent()
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013125813.brs b/.history/components/keyboardScene_20211013125813.brs
deleted file mode 100644
index 126c08a..0000000
--- a/.history/components/keyboardScene_20211013125813.brs
+++ /dev/null
@@ -1,123 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(0).getParent().translation
- ?m.video.trickPlayBar.getChild(1).getParent()
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130232.brs b/.history/components/keyboardScene_20211013130232.brs
deleted file mode 100644
index d6e7bc4..0000000
--- a/.history/components/keyboardScene_20211013130232.brs
+++ /dev/null
@@ -1,123 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(0).getParent()
- ?m.video.trickPlayBar.getChild(1).getParent()
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130255.brs b/.history/components/keyboardScene_20211013130255.brs
deleted file mode 100644
index e012856..0000000
--- a/.history/components/keyboardScene_20211013130255.brs
+++ /dev/null
@@ -1,123 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(0).getParent().hashMarkPositions
- ?m.video.trickPlayBar.getChild(1).getParent()
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130450.brs b/.history/components/keyboardScene_20211013130450.brs
deleted file mode 100644
index 92611e3..0000000
--- a/.history/components/keyboardScene_20211013130450.brs
+++ /dev/null
@@ -1,123 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(0).getParent()
- ?m.video.trickPlayBar.getChild(1).getParent()
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130504.brs b/.history/components/keyboardScene_20211013130504.brs
deleted file mode 100644
index 4c10ca0..0000000
--- a/.history/components/keyboardScene_20211013130504.brs
+++ /dev/null
@@ -1,123 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(0).getParent().getChildCount()
- ?m.video.trickPlayBar.getChild(1).getParent()
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130610.brs b/.history/components/keyboardScene_20211013130610.brs
deleted file mode 100644
index 4c10ca0..0000000
--- a/.history/components/keyboardScene_20211013130610.brs
+++ /dev/null
@@ -1,123 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(0).getParent().getChildCount()
- ?m.video.trickPlayBar.getChild(1).getParent()
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130615.brs b/.history/components/keyboardScene_20211013130615.brs
deleted file mode 100644
index a1af799..0000000
--- a/.history/components/keyboardScene_20211013130615.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(1).getParent()
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130800.brs b/.history/components/keyboardScene_20211013130800.brs
deleted file mode 100644
index 6255784..0000000
--- a/.history/components/keyboardScene_20211013130800.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(1).getParent().getParent()
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130841.brs b/.history/components/keyboardScene_20211013130841.brs
deleted file mode 100644
index a1af799..0000000
--- a/.history/components/keyboardScene_20211013130841.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(1).getParent()
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013130923.brs b/.history/components/keyboardScene_20211013130923.brs
deleted file mode 100644
index 47a8d8c..0000000
--- a/.history/components/keyboardScene_20211013130923.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131007.brs b/.history/components/keyboardScene_20211013131007.brs
deleted file mode 100644
index 85a3d10..0000000
--- a/.history/components/keyboardScene_20211013131007.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild()
- ?m.video.trickPlayBar.getChild()
- ?m.video.trickPlayBar.getChild()
- ?m.video.trickPlayBar.getChild()
- ?m.video.trickPlayBar.getChild()
- ?m.video.trickPlayBar.getChild()
- ?m.video.trickPlayBar.getChild()
- ?m.video.trickPlayBar.getChild()
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131022.brs b/.history/components/keyboardScene_20211013131022.brs
deleted file mode 100644
index 361c9a4..0000000
--- a/.history/components/keyboardScene_20211013131022.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(2)
- ?m.video.trickPlayBar.getChild(3)
- ?m.video.trickPlayBar.getChild(4)
- ?m.video.trickPlayBar.getChild(5)
- ?m.video.trickPlayBar.getChild(6)
- ?m.video.trickPlayBar.getChild(7)
- ?m.video.trickPlayBar.getChild(8)
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131110.brs b/.history/components/keyboardScene_20211013131110.brs
deleted file mode 100644
index 5b3a78b..0000000
--- a/.history/components/keyboardScene_20211013131110.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(2).opacity = 0
- ?m.video.trickPlayBar.getChild(3).opacity = 0
- ?m.video.trickPlayBar.getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).opacity = 0
- ?m.video.trickPlayBar.getChild(7).opacity = 0
- ?m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131111.brs b/.history/components/keyboardScene_20211013131111.brs
deleted file mode 100644
index 5b3a78b..0000000
--- a/.history/components/keyboardScene_20211013131111.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(2).opacity = 0
- ?m.video.trickPlayBar.getChild(3).opacity = 0
- ?m.video.trickPlayBar.getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).opacity = 0
- ?m.video.trickPlayBar.getChild(7).opacity = 0
- ?m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131430.brs b/.history/components/keyboardScene_20211013131430.brs
deleted file mode 100644
index 5b3a78b..0000000
--- a/.history/components/keyboardScene_20211013131430.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(2).opacity = 0
- ?m.video.trickPlayBar.getChild(3).opacity = 0
- ?m.video.trickPlayBar.getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).opacity = 0
- ?m.video.trickPlayBar.getChild(7).opacity = 0
- ?m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131507.brs b/.history/components/keyboardScene_20211013131507.brs
deleted file mode 100644
index 3975321..0000000
--- a/.history/components/keyboardScene_20211013131507.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).items
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(2).opacity = 0
- ?m.video.trickPlayBar.getChild(3).opacity = 0
- ?m.video.trickPlayBar.getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).opacity = 0
- ?m.video.trickPlayBar.getChild(7).opacity = 0
- ?m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131514.brs b/.history/components/keyboardScene_20211013131514.brs
deleted file mode 100644
index eb3b9b9..0000000
--- a/.history/components/keyboardScene_20211013131514.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(2).opacity = 0
- ?m.video.trickPlayBar.getChild(3).opacity = 0
- ?m.video.trickPlayBar.getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).opacity = 0
- ?m.video.trickPlayBar.getChild(7).opacity = 0
- ?m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131516.brs b/.history/components/keyboardScene_20211013131516.brs
deleted file mode 100644
index 14e2524..0000000
--- a/.history/components/keyboardScene_20211013131516.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body)
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(2).opacity = 0
- ?m.video.trickPlayBar.getChild(3).opacity = 0
- ?m.video.trickPlayBar.getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).opacity = 0
- ?m.video.trickPlayBar.getChild(7).opacity = 0
- ?m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131537.brs b/.history/components/keyboardScene_20211013131537.brs
deleted file mode 100644
index 8d9d900..0000000
--- a/.history/components/keyboardScene_20211013131537.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(2).opacity = 0
- ?m.video.trickPlayBar.getChild(3).opacity = 0
- ?m.video.trickPlayBar.getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).opacity = 0
- ?m.video.trickPlayBar.getChild(7).opacity = 0
- ?m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131756.brs b/.history/components/keyboardScene_20211013131756.brs
deleted file mode 100644
index 2c3b110..0000000
--- a/.history/components/keyboardScene_20211013131756.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(2).opacity = 0
- ?m.video.trickPlayBar.getChild(3).opacity = 0
- ?m.video.trickPlayBar.getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).opacity = 0
- ?m.video.trickPlayBar.getChild(7).opacity = 0
- ?m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131908.brs b/.history/components/keyboardScene_20211013131908.brs
deleted file mode 100644
index f2565ce..0000000
--- a/.history/components/keyboardScene_20211013131908.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- handleVideoPlaybackResponse
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(2).opacity = 0
- ?m.video.trickPlayBar.getChild(3).opacity = 0
- ?m.video.trickPlayBar.getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).opacity = 0
- ?m.video.trickPlayBar.getChild(7).opacity = 0
- ?m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131909.brs b/.history/components/keyboardScene_20211013131909.brs
deleted file mode 100644
index e779399..0000000
--- a/.history/components/keyboardScene_20211013131909.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- handleVideoPlaybackResponse()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(2).opacity = 0
- ?m.video.trickPlayBar.getChild(3).opacity = 0
- ?m.video.trickPlayBar.getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).opacity = 0
- ?m.video.trickPlayBar.getChild(7).opacity = 0
- ?m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013131944.brs b/.history/components/keyboardScene_20211013131944.brs
deleted file mode 100644
index 66195f1..0000000
--- a/.history/components/keyboardScene_20211013131944.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- handleVideoPlaybackResponse()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(2).opacity = 0
- ?m.video.trickPlayBar.getChild(3).opacity = 0
- ?m.video.trickPlayBar.getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).opacity = 0
- ?m.video.trickPlayBar.getChild(7).opacity = 0
- ?m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132015.brs b/.history/components/keyboardScene_20211013132015.brs
deleted file mode 100644
index 969b420..0000000
--- a/.history/components/keyboardScene_20211013132015.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-' sub handleSubmit()
-' m.http.request = { payload: {
-' userId: 1,
-' title: "WOW, IT WORKED ^_^",
-' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
-m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- handleVideoPlaybackResponse()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(2).opacity = 0
- ?m.video.trickPlayBar.getChild(3).opacity = 0
- ?m.video.trickPlayBar.getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).opacity = 0
- ?m.video.trickPlayBar.getChild(7).opacity = 0
- ?m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132042.brs b/.history/components/keyboardScene_20211013132042.brs
deleted file mode 100644
index cb0563a..0000000
--- a/.history/components/keyboardScene_20211013132042.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- ?m.video.trickPlayBar.getChild(2).opacity = 0
- ?m.video.trickPlayBar.getChild(3).opacity = 0
- ?m.video.trickPlayBar.getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).opacity = 0
- ?m.video.trickPlayBar.getChild(7).opacity = 0
- ?m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132113.brs b/.history/components/keyboardScene_20211013132113.brs
deleted file mode 100644
index 886de9e..0000000
--- a/.history/components/keyboardScene_20211013132113.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.trickPlayBar.getChild(6).opacity = 0
- m.video.trickPlayBar.getChild(7).opacity = 0
- m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132154.brs b/.history/components/keyboardScene_20211013132154.brs
deleted file mode 100644
index 60791e2..0000000
--- a/.history/components/keyboardScene_20211013132154.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).visible = 0
- m.video.trickPlayBar.getChild(3).visible = 0
- m.video.trickPlayBar.getChild(4).visible = 0
- m.video.trickPlayBar.getChild(5).visible = 0
- m.video.trickPlayBar.getChild(6).visible = 0
- m.video.trickPlayBar.getChild(7).visible = 0
- m.video.trickPlayBar.getChild(8).visible = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132231.brs b/.history/components/keyboardScene_20211013132231.brs
deleted file mode 100644
index 1859858..0000000
--- a/.history/components/keyboardScene_20211013132231.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132325.brs b/.history/components/keyboardScene_20211013132325.brs
deleted file mode 100644
index 90a9224..0000000
--- a/.history/components/keyboardScene_20211013132325.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getChild(6).visible = false
- m.video.trickPlayBar.getChild(7).visible = false
- m.video.trickPlayBar.getChild(8).visible = false
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132328.brs b/.history/components/keyboardScene_20211013132328.brs
deleted file mode 100644
index f3bc007..0000000
--- a/.history/components/keyboardScene_20211013132328.brs
+++ /dev/null
@@ -1,132 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- m.video.trickPlayBar.getChild(6).visible = false
- m.video.trickPlayBar.getChild(7).visible = false
- m.video.trickPlayBar.getChild(8).visible = false
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- ' m.video.trickPlayBar.getChild(2).visible = false
- ' m.video.trickPlayBar.getChild(3).visible = false
- ' m.video.trickPlayBar.getChild(4).visible = false
- ' m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132822.brs b/.history/components/keyboardScene_20211013132822.brs
deleted file mode 100644
index 1859858..0000000
--- a/.history/components/keyboardScene_20211013132822.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132836.brs b/.history/components/keyboardScene_20211013132836.brs
deleted file mode 100644
index e0946b4..0000000
--- a/.history/components/keyboardScene_20211013132836.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132919.brs b/.history/components/keyboardScene_20211013132919.brs
deleted file mode 100644
index e0946b4..0000000
--- a/.history/components/keyboardScene_20211013132919.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013132923.brs b/.history/components/keyboardScene_20211013132923.brs
deleted file mode 100644
index 1859858..0000000
--- a/.history/components/keyboardScene_20211013132923.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- ?parseJson(m.http.response.body).error
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' API Quota limit exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x33333300"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 50]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], m.video.trickPlayBar.getChild(1).translation[1] + 50]
- ' Hides the black background in the scrubber and the white dots in the scrubber
- m.video.trickPlayBar.getChild(2).visible = false
- m.video.trickPlayBar.getChild(3).visible = false
- m.video.trickPlayBar.getChild(4).visible = false
- m.video.trickPlayBar.getChild(5).visible = false
- ' m.video.trickPlayBar.getParent().getChild(9).height = 8
- ' Update percentage on loading bar
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
- m.video.bufferingBar.height = 8.0
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133140.brs b/.history/components/keyboardScene_20211013133140.brs
deleted file mode 100644
index d12173b..0000000
--- a/.history/components/keyboardScene_20211013133140.brs
+++ /dev/null
@@ -1,115 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- m.videoPlaybackTask.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- m.videoPlaybackTask.control = "RUN"
- m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133235.brs b/.history/components/keyboardScene_20211013133235.brs
deleted file mode 100644
index 1ec03f6..0000000
--- a/.history/components/keyboardScene_20211013133235.brs
+++ /dev/null
@@ -1,116 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133307.brs b/.history/components/keyboardScene_20211013133307.brs
deleted file mode 100644
index bd2c6c7..0000000
--- a/.history/components/keyboardScene_20211013133307.brs
+++ /dev/null
@@ -1,118 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- m.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133351.brs b/.history/components/keyboardScene_20211013133351.brs
deleted file mode 100644
index c2387cc..0000000
--- a/.history/components/keyboardScene_20211013133351.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133354.brs b/.history/components/keyboardScene_20211013133354.brs
deleted file mode 100644
index 61298b3..0000000
--- a/.history/components/keyboardScene_20211013133354.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133416.brs b/.history/components/keyboardScene_20211013133416.brs
deleted file mode 100644
index eb98474..0000000
--- a/.history/components/keyboardScene_20211013133416.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133531.brs b/.history/components/keyboardScene_20211013133531.brs
deleted file mode 100644
index e009983..0000000
--- a/.history/components/keyboardScene_20211013133531.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.height = 20
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133535.brs b/.history/components/keyboardScene_20211013133535.brs
deleted file mode 100644
index 8f8c296..0000000
--- a/.history/components/keyboardScene_20211013133535.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133645.brs b/.history/components/keyboardScene_20211013133645.brs
deleted file mode 100644
index 8f8c296..0000000
--- a/.history/components/keyboardScene_20211013133645.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133851.brs b/.history/components/keyboardScene_20211013133851.brs
deleted file mode 100644
index 10c493e..0000000
--- a/.history/components/keyboardScene_20211013133851.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.translation
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133853.brs b/.history/components/keyboardScene_20211013133853.brs
deleted file mode 100644
index 6b1e270..0000000
--- a/.history/components/keyboardScene_20211013133853.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- ?m.video.bufferingBar.translation
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013133936.brs b/.history/components/keyboardScene_20211013133936.brs
deleted file mode 100644
index 7e31a8b..0000000
--- a/.history/components/keyboardScene_20211013133936.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- ?m.video.bufferingBar.translation
- ?m.video.bufferingBar.getChildrenCount()
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134505.brs b/.history/components/keyboardScene_20211013134505.brs
deleted file mode 100644
index 2cf611b..0000000
--- a/.history/components/keyboardScene_20211013134505.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- ?m.video.bufferingBar.translation
- ?m.video.bufferingBar.getChildnCount()
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134544.brs b/.history/components/keyboardScene_20211013134544.brs
deleted file mode 100644
index 20ff1df..0000000
--- a/.history/components/keyboardScene_20211013134544.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- ?m.video.bufferingBar.translation = [m.video.bufferingBar.translation[0] - 20, m.video.bufferingBar.translation[1]]
- ?m.video.bufferingBar.getChildnCount()
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134546.brs b/.history/components/keyboardScene_20211013134546.brs
deleted file mode 100644
index 24c1094..0000000
--- a/.history/components/keyboardScene_20211013134546.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- ?m.video.bufferingBar.translation = [m.video.bufferingBar.translation[0] - 30, m.video.bufferingBar.translation[1]]
- ?m.video.bufferingBar.getChildnCount()
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134551.brs b/.history/components/keyboardScene_20211013134551.brs
deleted file mode 100644
index bd92516..0000000
--- a/.history/components/keyboardScene_20211013134551.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- ?m.video.bufferingBar.translation = [m.video.bufferingBar.translation[0] - 30, m.video.bufferingBar.translation[1]]
- ?m.video.bufferingBar.getChildCount()
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134614.brs b/.history/components/keyboardScene_20211013134614.brs
deleted file mode 100644
index 2c23e65..0000000
--- a/.history/components/keyboardScene_20211013134614.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.translation = [m.video.bufferingBar.translation[0] - 30, m.video.bufferingBar.translation[1]]
- ?m.video.bufferingBar.getChildCount()
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134659.brs b/.history/components/keyboardScene_20211013134659.brs
deleted file mode 100644
index 01b2060..0000000
--- a/.history/components/keyboardScene_20211013134659.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.translation = [m.video.bufferingBar.translation[0] - 3000, m.video.bufferingBar.translation[1]]
- ?m.video.bufferingBar.getChildCount()
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134857.brs b/.history/components/keyboardScene_20211013134857.brs
deleted file mode 100644
index 3517230..0000000
--- a/.history/components/keyboardScene_20211013134857.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
-
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134858.brs b/.history/components/keyboardScene_20211013134858.brs
deleted file mode 100644
index 8f8c296..0000000
--- a/.history/components/keyboardScene_20211013134858.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134903.brs b/.history/components/keyboardScene_20211013134903.brs
deleted file mode 100644
index 8f8c296..0000000
--- a/.history/components/keyboardScene_20211013134903.brs
+++ /dev/null
@@ -1,120 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013134949.brs b/.history/components/keyboardScene_20211013134949.brs
deleted file mode 100644
index 40eff16..0000000
--- a/.history/components/keyboardScene_20211013134949.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(5)
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135052.brs b/.history/components/keyboardScene_20211013135052.brs
deleted file mode 100644
index 39c78fa..0000000
--- a/.history/components/keyboardScene_20211013135052.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getParent().getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135201.brs b/.history/components/keyboardScene_20211013135201.brs
deleted file mode 100644
index 4c4c4af..0000000
--- a/.history/components/keyboardScene_20211013135201.brs
+++ /dev/null
@@ -1,121 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135245.brs b/.history/components/keyboardScene_20211013135245.brs
deleted file mode 100644
index 39c78fa..0000000
--- a/.history/components/keyboardScene_20211013135245.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getParent().getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135311.brs b/.history/components/keyboardScene_20211013135311.brs
deleted file mode 100644
index 95a7bc0..0000000
--- a/.history/components/keyboardScene_20211013135311.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getParent().getChild(5).translation = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135323.brs b/.history/components/keyboardScene_20211013135323.brs
deleted file mode 100644
index d7338ca..0000000
--- a/.history/components/keyboardScene_20211013135323.brs
+++ /dev/null
@@ -1,122 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(5).translation
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135421.brs b/.history/components/keyboardScene_20211013135421.brs
deleted file mode 100644
index f0a5e40..0000000
--- a/.history/components/keyboardScene_20211013135421.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(0).opacity = 0
- ?m.video.trickPlayBar.getChild(1).opacity = 0
- ?m.video.trickPlayBar.getChild(2).opacity = 0
- ?m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135423.brs b/.history/components/keyboardScene_20211013135423.brs
deleted file mode 100644
index 74d0633..0000000
--- a/.history/components/keyboardScene_20211013135423.brs
+++ /dev/null
@@ -1,125 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ?m.video.trickPlayBar.getParent().getChildren(12, 0)
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).opacity = 0
- m.video.trickPlayBar.getChild(1).opacity = 0
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135438.brs b/.history/components/keyboardScene_20211013135438.brs
deleted file mode 100644
index c8c5bb7..0000000
--- a/.history/components/keyboardScene_20211013135438.brs
+++ /dev/null
@@ -1,124 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).opacity = 0
- m.video.trickPlayBar.getChild(1).opacity = 0
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013135941.brs b/.history/components/keyboardScene_20211013135941.brs
deleted file mode 100644
index 13a3085..0000000
--- a/.history/components/keyboardScene_20211013135941.brs
+++ /dev/null
@@ -1,124 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140045.brs b/.history/components/keyboardScene_20211013140045.brs
deleted file mode 100644
index 0c6196d..0000000
--- a/.history/components/keyboardScene_20211013140045.brs
+++ /dev/null
@@ -1,126 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).translation
- m.video.trickPlayBar.getChild(1).translation
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140050.brs b/.history/components/keyboardScene_20211013140050.brs
deleted file mode 100644
index 399947e..0000000
--- a/.history/components/keyboardScene_20211013140050.brs
+++ /dev/null
@@ -1,126 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(0).translation
- ?m.video.trickPlayBar.getChild(1).translation
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140143.brs b/.history/components/keyboardScene_20211013140143.brs
deleted file mode 100644
index d4e21b3..0000000
--- a/.history/components/keyboardScene_20211013140143.brs
+++ /dev/null
@@ -1,126 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- ?m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
- ?m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140205.brs b/.history/components/keyboardScene_20211013140205.brs
deleted file mode 100644
index 150561b..0000000
--- a/.history/components/keyboardScene_20211013140205.brs
+++ /dev/null
@@ -1,126 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
- ?m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140225.brs b/.history/components/keyboardScene_20211013140225.brs
deleted file mode 100644
index 546256c..0000000
--- a/.history/components/keyboardScene_20211013140225.brs
+++ /dev/null
@@ -1,126 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140252.brs b/.history/components/keyboardScene_20211013140252.brs
deleted file mode 100644
index d29c2a2..0000000
--- a/.history/components/keyboardScene_20211013140252.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(0).translation[0], m.video.trickPlayBar.getChild(0).translation[1] + 100]
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140501.brs b/.history/components/keyboardScene_20211013140501.brs
deleted file mode 100644
index a05693c..0000000
--- a/.history/components/keyboardScene_20211013140501.brs
+++ /dev/null
@@ -1,127 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.vertAlign = "center"
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140635.brs b/.history/components/keyboardScene_20211013140635.brs
deleted file mode 100644
index 71624e5..0000000
--- a/.history/components/keyboardScene_20211013140635.brs
+++ /dev/null
@@ -1,126 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.vertAlign = "center"
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140749.brs b/.history/components/keyboardScene_20211013140749.brs
deleted file mode 100644
index a61cad6..0000000
--- a/.history/components/keyboardScene_20211013140749.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], 200]
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(0).translation[0], 200]
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013140847.brs b/.history/components/keyboardScene_20211013140847.brs
deleted file mode 100644
index fbc17e8..0000000
--- a/.history/components/keyboardScene_20211013140847.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).translation = [m.video.trickPlayBar.getChild(0).translation[0], 200]
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).translation = [m.video.trickPlayBar.getChild(1).translation[0], 200]
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013141218.brs b/.history/components/keyboardScene_20211013141218.brs
deleted file mode 100644
index f974852..0000000
--- a/.history/components/keyboardScene_20211013141218.brs
+++ /dev/null
@@ -1,126 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013142600.brs b/.history/components/keyboardScene_20211013142600.brs
deleted file mode 100644
index ffcf908..0000000
--- a/.history/components/keyboardScene_20211013142600.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- ØŸm.video.trickPlayBar.getChild(6)
- ØŸm.video.trickPlayBar.getChild(7)
- ØŸm.video.trickPlayBar.getChild(8)
- ØŸm.video.trickPlayBar.getChild(9)
- ØŸm.video.trickPlayBar.getChild(10)
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013142605.brs b/.history/components/keyboardScene_20211013142605.brs
deleted file mode 100644
index 85a73d8..0000000
--- a/.history/components/keyboardScene_20211013142605.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6)
- ?m.video.trickPlayBar.getChild(7)
- ?m.video.trickPlayBar.getChild(8)
- ?m.video.trickPlayBar.getChild(9)
- ?m.video.trickPlayBar.getChild(10)
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013143004.brs b/.history/components/keyboardScene_20211013143004.brs
deleted file mode 100644
index a414851..0000000
--- a/.history/components/keyboardScene_20211013143004.brs
+++ /dev/null
@@ -1,131 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).translation
- ?m.video.trickPlayBar.getChild(7).translation
- ?m.video.trickPlayBar.getChild(8).translation
- ?m.video.trickPlayBar.getChild(9).translation
- ?m.video.trickPlayBar.getChild(10).translation
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013143124.brs b/.history/components/keyboardScene_20211013143124.brs
deleted file mode 100644
index a3df994..0000000
--- a/.history/components/keyboardScene_20211013143124.brs
+++ /dev/null
@@ -1,135 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(6).translation
- ?m.video.trickPlayBar.getChild(7).translation
- ?m.video.trickPlayBar.getChild(8).translation
- ?m.video.trickPlayBar.getChild(9).translation
- ?m.video.trickPlayBar.getChild(10).translation
- ?m.video.trickPlayBar.getChild(11).translation
- ?m.video.trickPlayBar.getChild(12).translation
- ?m.video.trickPlayBar.getChild(13).translation
- ?m.video.trickPlayBar.getChild(14).translation
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013143327.brs b/.history/components/keyboardScene_20211013143327.brs
deleted file mode 100644
index cfb2576..0000000
--- a/.history/components/keyboardScene_20211013143327.brs
+++ /dev/null
@@ -1,135 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(0).translation
- ?m.video.trickPlayBar.getParent().getChild(1).translation
- ?m.video.trickPlayBar.getParent().getChild(2).translation
- ?m.video.trickPlayBar.getParent().getChild(3).translation
- ?m.video.trickPlayBar.getParent().getChild(4).translation
- ?m.video.trickPlayBar.getParent().getChild(5).translation
- ?m.video.trickPlayBar.getParent().getChild(6).translation
- ?m.video.trickPlayBar.getParent().getChild(7).translation
- ?m.video.trickPlayBar.getParent().getChild(8).translation
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013143425.brs b/.history/components/keyboardScene_20211013143425.brs
deleted file mode 100644
index 9ead755..0000000
--- a/.history/components/keyboardScene_20211013143425.brs
+++ /dev/null
@@ -1,138 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getParent().getChild(0).translation
- ?m.video.trickPlayBar.getParent().getChild(1).translation
- ?m.video.trickPlayBar.getParent().getChild(2).translation
- ?m.video.trickPlayBar.getParent().getChild(3).translation
- ?m.video.trickPlayBar.getParent().getChild(4).translation
- ?m.video.trickPlayBar.getParent().getChild(5).translation
- ?m.video.trickPlayBar.getParent().getChild(6).translation
- ?m.video.trickPlayBar.getParent().getChild(7).translation
- ?m.video.trickPlayBar.getParent().getChild(8).translation
- ?m.video.trickPlayBar.getParent().getChild(9).translation
- ?m.video.trickPlayBar.getParent().getChild(10).translation
- ?m.video.trickPlayBar.getParent().getChild(11).translation
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013143546.brs b/.history/components/keyboardScene_20211013143546.brs
deleted file mode 100644
index a1593f0..0000000
--- a/.history/components/keyboardScene_20211013143546.brs
+++ /dev/null
@@ -1,145 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(0).translation
- ?m.video.trickPlayBar.getChild(1).translation
- ?m.video.trickPlayBar.getChild(2).translation
- ?m.video.trickPlayBar.getChild(3).translation
- ?m.video.trickPlayBar.getChild(4).translation
- ?m.video.trickPlayBar.getChild(5).translation
- ?m.video.trickPlayBar.getChild(6).translation
- ?m.video.trickPlayBar.getChild(7).translation
- ?m.video.trickPlayBar.getChild(8).translation
- ?m.video.trickPlayBar.getChild(9).translation
- ?m.video.trickPlayBar.getChild(10).translation
- ?m.video.trickPlayBar.getChild(11).translation
- ?m.video.trickPlayBar.getChild(12).translation
- ?m.video.trickPlayBar.getChild(13).translation
- ?m.video.trickPlayBar.getChild(14).translation
- ?m.video.trickPlayBar.getChild(15).translation
- ?m.video.trickPlayBar.getChild(16).translation
- ?m.video.trickPlayBar.getChild(17).translation
- ?m.video.trickPlayBar.getChild(18).translation
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144033.brs b/.history/components/keyboardScene_20211013144033.brs
deleted file mode 100644
index d6ceb62..0000000
--- a/.history/components/keyboardScene_20211013144033.brs
+++ /dev/null
@@ -1,145 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(0)
- ?m.video.trickPlayBar.getChild(1)
- ?m.video.trickPlayBar.getChild(2)
- ?m.video.trickPlayBar.getChild(3)
- ?m.video.trickPlayBar.getChild(4)
- ?m.video.trickPlayBar.getChild(5)
- ?m.video.trickPlayBar.getChild(6)
- ?m.video.trickPlayBar.getChild(7)
- ?m.video.trickPlayBar.getChild(8)
- ?m.video.trickPlayBar.getChild(9)
- ?m.video.trickPlayBar.getChild(10)
- ?m.video.trickPlayBar.getChild(11)
- ?m.video.trickPlayBar.getChild(12)
- ?m.video.trickPlayBar.getChild(13)
- ?m.video.trickPlayBar.getChild(14)
- ?m.video.trickPlayBar.getChild(15)
- ?m.video.trickPlayBar.getChild(16)
- ?m.video.trickPlayBar.getChild(17)
- ?m.video.trickPlayBar.getChild(18)
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144219.brs b/.history/components/keyboardScene_20211013144219.brs
deleted file mode 100644
index 608a082..0000000
--- a/.history/components/keyboardScene_20211013144219.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(9).getChildCount()
- ?m.video.trickPlayBar.getChild(10).getChildCount()
- ?m.video.trickPlayBar.getChild(11).getChildCount()
- ?m.video.trickPlayBar.getChild(12).getChildCount()
- ?m.video.trickPlayBar.getChild(13).getChildCount()
- ?m.video.trickPlayBar.getChild(14).getChildCount()
- ?m.video.trickPlayBar.getChild(15).getChildCount()
- ?m.video.trickPlayBar.getChild(16).getChildCount()
- ?m.video.trickPlayBar.getChild(17).getChildCount()
- ?m.video.trickPlayBar.getChild(18).getChildCount()
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144311.brs b/.history/components/keyboardScene_20211013144311.brs
deleted file mode 100644
index 5c6cd79..0000000
--- a/.history/components/keyboardScene_20211013144311.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- ?m.video.trickPlayBar.getChild(9).text
- ?m.video.trickPlayBar.getChild(10).text
- ?m.video.trickPlayBar.getChild(11).text
- ?m.video.trickPlayBar.getChild(12).text
- ?m.video.trickPlayBar.getChild(13).text
- ?m.video.trickPlayBar.getChild(14).text
- ?m.video.trickPlayBar.getChild(15).text
- ?m.video.trickPlayBar.getChild(16).text
- ?m.video.trickPlayBar.getChild(17).text
- ?m.video.trickPlayBar.getChild(18).text
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144317.brs b/.history/components/keyboardScene_20211013144317.brs
deleted file mode 100644
index 5e55c47..0000000
--- a/.history/components/keyboardScene_20211013144317.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.trickPlayBar.getChild(9).text
- ?m.video.trickPlayBar.getChild(10).text
- ?m.video.trickPlayBar.getChild(11).text
- ?m.video.trickPlayBar.getChild(12).text
- ?m.video.trickPlayBar.getChild(13).text
- ?m.video.trickPlayBar.getChild(14).text
- ?m.video.trickPlayBar.getChild(15).text
- ?m.video.trickPlayBar.getChild(16).text
- ?m.video.trickPlayBar.getChild(17).text
- ?m.video.trickPlayBar.getChild(18).text
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144410.brs b/.history/components/keyboardScene_20211013144410.brs
deleted file mode 100644
index 12bd303..0000000
--- a/.history/components/keyboardScene_20211013144410.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.trickPlayBar.getChild(9)
- ?m.video.trickPlayBar.getChild(10)
- ?m.video.trickPlayBar.getChild(11)
- ?m.video.trickPlayBar.getChild(12)
- ?m.video.trickPlayBar.getChild(13)
- ?m.video.trickPlayBar.getChild(14)
- ?m.video.trickPlayBar.getChild(15)
- ?m.video.trickPlayBar.getChild(16)
- ?m.video.trickPlayBar.getChild(17)
- ?m.video.trickPlayBar.getChild(18)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144558.brs b/.history/components/keyboardScene_20211013144558.brs
deleted file mode 100644
index fe6b525..0000000
--- a/.history/components/keyboardScene_20211013144558.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.trickPlayBar.getChild(9).opacity = 0
- ?m.video.trickPlayBar.getChild(10).opacity = 0
- ?m.video.trickPlayBar.getChild(11).opacity = 0
- ?m.video.trickPlayBar.getChild(12).opacity = 0
- ?m.video.trickPlayBar.getChild(13).opacity = 0
- ?m.video.trickPlayBar.getChild(14).opacity = 0
- ?m.video.trickPlayBar.getChild(15).opacity = 0
- ?m.video.trickPlayBar.getChild(16).opacity = 0
- ?m.video.trickPlayBar.getChild(17).opacity = 0
- ?m.video.trickPlayBar.getChild(18).opacity = 0
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144626.brs b/.history/components/keyboardScene_20211013144626.brs
deleted file mode 100644
index 89d45f9..0000000
--- a/.history/components/keyboardScene_20211013144626.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getChild(9).opacity = 0
- m.video.trickPlayBar.getChild(10).opacity = 0
- m.video.trickPlayBar.getChild(11).opacity = 0
- m.video.trickPlayBar.getChild(12).opacity = 0
- m.video.trickPlayBar.getChild(13).opacity = 0
- m.video.trickPlayBar.getChild(14).opacity = 0
- m.video.trickPlayBar.getChild(15).opacity = 0
- m.video.trickPlayBar.getChild(16).opacity = 0
- m.video.trickPlayBar.getChild(17).opacity = 0
- m.video.trickPlayBar.getChild(18).opacity = 0
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144935.brs b/.history/components/keyboardScene_20211013144935.brs
deleted file mode 100644
index 1b19f06..0000000
--- a/.history/components/keyboardScene_20211013144935.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getChild(0).opacity = 0
- m.video.trickPlayBar.getChild(1).opacity = 0
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.trickPlayBar.getChild(6).opacity = 0
- m.video.trickPlayBar.getChild(7).opacity = 0
- m.video.trickPlayBar.getChild(8).opacity = 0
- m.video.trickPlayBar.getChild(9).opacity = 0
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013144950.brs b/.history/components/keyboardScene_20211013144950.brs
deleted file mode 100644
index 0f94e0f..0000000
--- a/.history/components/keyboardScene_20211013144950.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- m.video.trickPlayBar.getChild(0).getChildCount()
- m.video.trickPlayBar.getChild(1).getChildCount()
- m.video.trickPlayBar.getChild(2).getChildCount()
- m.video.trickPlayBar.getChild(3).getChildCount()
- m.video.trickPlayBar.getChild(4).getChildCount()
- m.video.trickPlayBar.getChild(5).getChildCount()
- m.video.trickPlayBar.getChild(6).getChildCount()
- m.video.trickPlayBar.getChild(7).getChildCount()
- m.video.trickPlayBar.getChild(8).getChildCount()
- m.video.trickPlayBar.getChild(9).getChildCount()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145019.brs b/.history/components/keyboardScene_20211013145019.brs
deleted file mode 100644
index 1ee4558..0000000
--- a/.history/components/keyboardScene_20211013145019.brs
+++ /dev/null
@@ -1,136 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.trickPlayBar.getChild(0).getChildCount()
- ?m.video.trickPlayBar.getChild(1).getChildCount()
- ?m.video.trickPlayBar.getChild(2).getChildCount()
- ?m.video.trickPlayBar.getChild(3).getChildCount()
- ?m.video.trickPlayBar.getChild(4).getChildCount()
- ?m.video.trickPlayBar.getChild(5).getChildCount()
- ?m.video.trickPlayBar.getChild(6).getChildCount()
- ?m.video.trickPlayBar.getChild(7).getChildCount()
- ?m.video.trickPlayBar.getChild(8).getChildCount()
- ?m.video.trickPlayBar.getChild(9).getChildCount()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145139.brs b/.history/components/keyboardScene_20211013145139.brs
deleted file mode 100644
index df92ed9..0000000
--- a/.history/components/keyboardScene_20211013145139.brs
+++ /dev/null
@@ -1,127 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.trickPlayBar
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145506.brs b/.history/components/keyboardScene_20211013145506.brs
deleted file mode 100644
index e36a68d..0000000
--- a/.history/components/keyboardScene_20211013145506.brs
+++ /dev/null
@@ -1,127 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145513.brs b/.history/components/keyboardScene_20211013145513.brs
deleted file mode 100644
index 3484b21..0000000
--- a/.history/components/keyboardScene_20211013145513.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.getChild(0)
- ?m.video.getChild(1)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145610.brs b/.history/components/keyboardScene_20211013145610.brs
deleted file mode 100644
index 593771c..0000000
--- a/.history/components/keyboardScene_20211013145610.brs
+++ /dev/null
@@ -1,127 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.getChild(1)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145626.brs b/.history/components/keyboardScene_20211013145626.brs
deleted file mode 100644
index ebfb8c5..0000000
--- a/.history/components/keyboardScene_20211013145626.brs
+++ /dev/null
@@ -1,129 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.getChild(1).getChild(0)
- ?m.video.getChild(1).getChild(1)
- ?m.video.getChild(1).getChild(2)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145743.brs b/.history/components/keyboardScene_20211013145743.brs
deleted file mode 100644
index f48d5d9..0000000
--- a/.history/components/keyboardScene_20211013145743.brs
+++ /dev/null
@@ -1,130 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.getChild(1).getChild(0)
- m.video.getChild(1).getChild(1).height = 300
- ?m.video.getChild(1).getChild(1).translation
- ?m.video.getChild(1).getChild(2)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145848.brs b/.history/components/keyboardScene_20211013145848.brs
deleted file mode 100644
index 48596e5..0000000
--- a/.history/components/keyboardScene_20211013145848.brs
+++ /dev/null
@@ -1,128 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
-
- ?m.video.getChild(1).getChildCount()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145849.brs b/.history/components/keyboardScene_20211013145849.brs
deleted file mode 100644
index 64096a1..0000000
--- a/.history/components/keyboardScene_20211013145849.brs
+++ /dev/null
@@ -1,127 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.getChild(1).getChildCount()
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013145926.brs b/.history/components/keyboardScene_20211013145926.brs
deleted file mode 100644
index c9c11d4..0000000
--- a/.history/components/keyboardScene_20211013145926.brs
+++ /dev/null
@@ -1,127 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.getChild(1).getChildren(12, 0)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013150159.brs b/.history/components/keyboardScene_20211013150159.brs
deleted file mode 100644
index 4b110de..0000000
--- a/.history/components/keyboardScene_20211013150159.brs
+++ /dev/null
@@ -1,138 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.getChild(1).getChildren(12, 0).getChild(0)
- ?m.video.getChild(1).getChildren(12, 0).getChild(1)
- ?m.video.getChild(1).getChildren(12, 0).getChild(2)
- ?m.video.getChild(1).getChildren(12, 0).getChild(3)
- ?m.video.getChild(1).getChildren(12, 0).getChild(4)
- ?m.video.getChild(1).getChildren(12, 0).getChild(5)
- ?m.video.getChild(1).getChildren(12, 0).getChild(6)
- ?m.video.getChild(1).getChildren(12, 0).getChild(7)
- ?m.video.getChild(1).getChildren(12, 0).getChild(8)
- ?m.video.getChild(1).getChildren(12, 0).getChild(9)
- ?m.video.getChild(1).getChildren(12, 0).getChild(10)
- ?m.video.getChild(1).getChildren(12, 0).getChild(11)
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013150327.brs b/.history/components/keyboardScene_20211013150327.brs
deleted file mode 100644
index 0394d20..0000000
--- a/.history/components/keyboardScene_20211013150327.brs
+++ /dev/null
@@ -1,138 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.getChild(1).getChildren(12, 0)[0]
- ?m.video.getChild(1).getChildren(12, 0)[1]
- ?m.video.getChild(1).getChildren(12, 0)[2]
- ?m.video.getChild(1).getChildren(12, 0)[3]
- ?m.video.getChild(1).getChildren(12, 0)[4]
- ?m.video.getChild(1).getChildren(12, 0)[5]
- ?m.video.getChild(1).getChildren(12, 0)[6]
- ?m.video.getChild(1).getChildren(12, 0)[7]
- ?m.video.getChild(1).getChildren(12, 0)[8]
- ?m.video.getChild(1).getChildren(12, 0)[9]
- ?m.video.getChild(1).getChildren(12, 0)[10]
- ?m.video.getChild(1).getChildren(12, 0)[11]
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013150822.brs b/.history/components/keyboardScene_20211013150822.brs
deleted file mode 100644
index 33dbe3e..0000000
--- a/.history/components/keyboardScene_20211013150822.brs
+++ /dev/null
@@ -1,127 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.position
- m.video.trickPlayBar.getParent().getChild(8).text = str(m.video.bufferingBar.percentage) + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/keyboardScene_20211013151157.brs b/.history/components/keyboardScene_20211013151157.brs
deleted file mode 100644
index 4e3a8bc..0000000
--- a/.history/components/keyboardScene_20211013151157.brs
+++ /dev/null
@@ -1,127 +0,0 @@
-sub init()
- m.keyboard = m.top.findNode("myKeyboard")
- m.itemsList = m.top.findNode("searchList")
- m.video = m.top.findNode("video")
- m.itemsList.observeField("itemSelected", "handleItemSelected")
- m.heading = m.top.findNode("heading")
- m.keyboard.setFocus(true)
- m.keyboard.observeField("text", "handleText")
- m.http = createObject("roSGNode", "httpTask")
- m.http.observeFieldScoped("response", "useResponse")
- m.keyboard.textBox.observeField("text", "handleText")
- m.keyboard.observeField("submit", "handleSubmit")
-end sub
-
-sub handleText()
- m.text = m.keyboard.textBox.text
-end sub
-
-sub handleSubmit()
- handleVideoPlaybackResponse()
-
- ' m.http.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=" + m.text + "&maxResults=25&type=video&key=AIzaSyCxEpZ8-3gkiFpoc2SAkPBfcPFqQd6m_dw", requestType: "GET" }
- ' m.http.control = "RUN"
-end sub
-
-sub useResponse()
- m.itemsThatContainString = createObject("roSGNode", "ContentNode")
- items = []
- m.itemsList.numColumns = 3
- for each item in parseJson(m.http.response.body).items
- Content = m.itemsThatContainString.createChild("ContentNode")
- Content.HDPosterUrl = item.snippet.thumbnails.medium.url
- Content.id = item.id.videoId
- items.push(item)
- end for
- if items.count() = 2
- m.itemsList.numColumns = 2
- else if items.count() = 1
- m.itemsList.numColumns = 1
- end if
- ' handle empty text box
- if m.keyboard.textBox.text = ""
- m.itemsList.content = invalid
- m.heading.visible = false
- else
- m.heading.visible = true
- m.itemsList.content = m.itemsThatContainString
- handleHeading()
- end if
-end sub
-
-sub handleHeading()
- m.heading.text = "These are the top videos that match " + Chr(34) + m.keyboard.textBox.text + Chr(34)
-end sub
-
-sub handleItemSelected()
- ' http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4
- ' playVideo(m.itemsThatContainString.getChild(m.itemsList.itemSelected).id)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press
- if key = "right" and not m.itemsList.hasFocus()
- m.itemsList.setFocus(true)
- return true
- else if key = "left" and not m.keyboard.hasFocus()
- m.keyboard.setFocus(true)
- end if
- end if
- return false
-end function
-
-sub playVideo(id as String)
- ' m.videoPlaybackTask = createObject("roSGNode", "httpTask")
- ' m.videoPlaybackTask.request = { payload: {
- ' userId: 1,
- ' title: "WOW, IT WORKED ^_^",
- ' }, url: "https://www.youtube.com/watch?v=" + id, requestType: "GET" }
- ' m.videoPlaybackTask.control = "RUN"
- ' m.videoPlaybackTask.observeFieldScoped("response", "handleVideoPlaybackResponse")
-end sub
-
-sub handleVideoPlaybackResponse()
- ' initialPlayerResponseRegEx = createObject("roRegex", "ytInitialPlayerResponse\s*=\s*({.+?})\s*;", "m")
- ' matches = initialPlayerResponseRegEx.match(m.videoPlaybackTask.response.body)
- videoContent = createObject("RoSGNode", "ContentNode")
- ' YouTube API Limit Exceeded
- ' videoContent.url = parseJson(matches[1]).streamingData.formats[0].url
- videoContent.url = "http://scienceandfilm.org/uploads/videos/files/afronauts_trailer.mp4"
- videoContent.streamformat = "mp4"
- m.video.content = videoContent
- m.video.visible = true
- m.video.seekMode = "accurate"
- m.video.trickPlayBar.textColor = "0xFFFFFFFF"
- m.video.trickPlayBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.trickPlayBar.trackBlendColor = "0x333333FF"
- m.video.trickPlayBar.thumbBlendColor = "0x00000000"
- ' Hides the black background in the scrubber
- m.video.trickPlayBar.getParent().getChild(1).opacity = 0
- ' Update percentage on loading bar
- m.video.bufferingBar.observeField("percentage", "updatePercentage")
- m.video.trickPlayBar.getParent().getChild(2).opacity = 0
- m.video.trickPlayBar.getParent().getChild(3).opacity = 0
- m.video.trickPlayBar.getParent().getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(0).height = 8
- m.video.trickPlayBar.getChild(1).height = 8
- m.video.trickPlayBar.getChild(2).opacity = 0
- m.video.trickPlayBar.getChild(3).opacity = 0
- m.video.trickPlayBar.getChild(4).opacity = 0
- m.video.trickPlayBar.getChild(5).opacity = 0
- m.video.bufferingBar.emptyBarBlendColor = "0x333333FF"
- m.video.bufferingBar.trackImageUri = "pkg:/images/white.jpg"
- m.video.bufferingBar.trackBlendColor = "0x333333FF"
- m.video.bufferingBar.filledBarImageUri = "pkg:/images/white.jpg"
- m.video.setFocus(true)
- m.video.control = "play"
-end sub
-
-sub updatePercentage()
- m.video.bufferingBar.height = 8
- ?m.video.position
- m.video.trickPlayBar.getParent().getChild(8).text = m.video.bufferingBar.percentage.toStr() + "%"
-end sub
\ No newline at end of file
diff --git a/.history/components/play_20211012131733.xml b/.history/components/play_20211012131733.xml
deleted file mode 100644
index e56ae3b..0000000
--- a/.history/components/play_20211012131733.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/play_20211012131742.xml b/.history/components/play_20211012131742.xml
deleted file mode 100644
index 8150ea1..0000000
--- a/.history/components/play_20211012131742.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListContent_20211008145905.brs b/.history/components/rowListContent_20211008145905.brs
deleted file mode 100644
index a37fbf2..0000000
--- a/.history/components/rowListContent_20211008145905.brs
+++ /dev/null
@@ -1,11 +0,0 @@
-sub init()
- m.global.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://jsonplaceholder.typicode.com/albums", requestType: "GET"}
- m.global.http.observeFieldScoped("response", "useResponse")
-end sub
-
-sub useResponse()
- ?m.global.http.response
-end sub
diff --git a/.history/components/rowListContent_20211010122436.xml b/.history/components/rowListContent_20211010122436.xml
deleted file mode 100644
index 28e7d8e..0000000
--- a/.history/components/rowListContent_20211010122436.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListContent_20211010122446.brs b/.history/components/rowListContent_20211010122446.brs
deleted file mode 100644
index 24c6956..0000000
--- a/.history/components/rowListContent_20211010122446.brs
+++ /dev/null
@@ -1,11 +0,0 @@
-sub init()
- m.global.http.request = { payload: {
- userId: 1,
- title: "WOW, IT WORKED ^_^",
- }, url: "https://jsonplaceholder.typicode.com/albums", requestType: "GET" }
- m.global.http.observeFieldScoped("response", "useResponse")
-end sub
-
-sub useResponse()
- ?m.global.http.response
-end sub
diff --git a/.history/components/rowListContent_20211010122452.xml b/.history/components/rowListContent_20211010122452.xml
deleted file mode 100644
index f70ce16..0000000
--- a/.history/components/rowListContent_20211010122452.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListContent_20211011134627.xml b/.history/components/rowListContent_20211011134627.xml
deleted file mode 100644
index f70ce16..0000000
--- a/.history/components/rowListContent_20211011134627.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListContent_20211012145223.xml b/.history/components/rowListContent_20211012145223.xml
deleted file mode 100644
index f70ce16..0000000
--- a/.history/components/rowListContent_20211012145223.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListItem_20211010122403.xml b/.history/components/rowListItem_20211010122403.xml
deleted file mode 100644
index 65e51b9..0000000
--- a/.history/components/rowListItem_20211010122403.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListItem_20211010122413.xml b/.history/components/rowListItem_20211010122413.xml
deleted file mode 100644
index 65e51b9..0000000
--- a/.history/components/rowListItem_20211010122413.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListItem_20211010122425.xml b/.history/components/rowListItem_20211010122425.xml
deleted file mode 100644
index 897af09..0000000
--- a/.history/components/rowListItem_20211010122425.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListItem_20211011134635.xml b/.history/components/rowListItem_20211011134635.xml
deleted file mode 100644
index 897af09..0000000
--- a/.history/components/rowListItem_20211011134635.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListItem_20211012145217.xml b/.history/components/rowListItem_20211012145217.xml
deleted file mode 100644
index 897af09..0000000
--- a/.history/components/rowListItem_20211012145217.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008145905.brs b/.history/components/rowListScene_20211008145905.brs
deleted file mode 100644
index 22d7821..0000000
--- a/.history/components/rowListScene_20211008145905.brs
+++ /dev/null
@@ -1,23 +0,0 @@
-sub init()
- m.global.addField("http", "node", FALSE)
- m.global.addField("ratio", "float", FALSE)
- m.global.http = createObject("roSGNode", "httpTask")
- m.global.http.control = "RUN"
- m.global.ratio = 1
- m.rowList = m.top.findNode("mainRowList")
- m.rowList.content = createObject("roSGNode", "RowListContent")
- m.rowList.setFocus(true)
- videoMode = createObject("roDeviceInfo")
- if videoMode.GetVideoMode() = "720p"
- m.global.ratio = 0.66
- end if
- if m.global.ratio = 0.66
- m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
- m.rowList.rowItemSpacing = [[5, 0]]
- m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
- m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
- m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
- m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
- m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
- end if
-end sub
diff --git a/.history/components/rowListScene_20211008145905.xml b/.history/components/rowListScene_20211008145905.xml
deleted file mode 100644
index bc7e6b9..0000000
--- a/.history/components/rowListScene_20211008145905.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008145927.xml b/.history/components/rowListScene_20211008145927.xml
deleted file mode 100644
index 92ca1be..0000000
--- a/.history/components/rowListScene_20211008145927.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008150133.xml b/.history/components/rowListScene_20211008150133.xml
deleted file mode 100644
index 5587e5a..0000000
--- a/.history/components/rowListScene_20211008150133.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
- >
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008150134.xml b/.history/components/rowListScene_20211008150134.xml
deleted file mode 100644
index 5587e5a..0000000
--- a/.history/components/rowListScene_20211008150134.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
- >
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008150139.xml b/.history/components/rowListScene_20211008150139.xml
deleted file mode 100644
index f7e0f6e..0000000
--- a/.history/components/rowListScene_20211008150139.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008150146.xml b/.history/components/rowListScene_20211008150146.xml
deleted file mode 100644
index b6c1d0d..0000000
--- a/.history/components/rowListScene_20211008150146.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008150412.brs b/.history/components/rowListScene_20211008150412.brs
deleted file mode 100644
index 58ffd93..0000000
--- a/.history/components/rowListScene_20211008150412.brs
+++ /dev/null
@@ -1,3 +0,0 @@
-sub init()
-
-end sub
diff --git a/.history/components/rowListScene_20211008150439.brs b/.history/components/rowListScene_20211008150439.brs
deleted file mode 100644
index 3ce3870..0000000
--- a/.history/components/rowListScene_20211008150439.brs
+++ /dev/null
@@ -1,7 +0,0 @@
-sub init()
- initGetNodes()
-end sub
-
-sub initGetNodes()
-
-end sub
diff --git a/.history/components/rowListScene_20211008150452.brs b/.history/components/rowListScene_20211008150452.brs
deleted file mode 100644
index 2175447..0000000
--- a/.history/components/rowListScene_20211008150452.brs
+++ /dev/null
@@ -1,7 +0,0 @@
-sub init()
- initGetNodes()
-end sub
-
-sub initGetNodes()
- m.start = m.top.findNode("start")
-end sub
diff --git a/.history/components/rowListScene_20211008150508.brs b/.history/components/rowListScene_20211008150508.brs
deleted file mode 100644
index 316d951..0000000
--- a/.history/components/rowListScene_20211008150508.brs
+++ /dev/null
@@ -1,9 +0,0 @@
-sub init()
- initGetNodes()
-end sub
-
-sub initGetNodes()
- m.start = m.top.findNode("start")
- m.start = m.top.findNode("stop")
- m.start = m.top.findNode("reset")
-end sub
diff --git a/.history/components/rowListScene_20211008150514.brs b/.history/components/rowListScene_20211008150514.brs
deleted file mode 100644
index 6b5aa6a..0000000
--- a/.history/components/rowListScene_20211008150514.brs
+++ /dev/null
@@ -1,9 +0,0 @@
-sub init()
- initGetNodes()
-end sub
-
-sub initGetNodes()
- m.start = m.top.findNode("start")
- m.stop = m.top.findNode("stop")
- m.reset = m.top.findNode("reset")
-end sub
diff --git a/.history/components/rowListScene_20211008150559.brs b/.history/components/rowListScene_20211008150559.brs
deleted file mode 100644
index f043f51..0000000
--- a/.history/components/rowListScene_20211008150559.brs
+++ /dev/null
@@ -1,11 +0,0 @@
-sub init()
- initGetNodes()
- m.
-end sub
-
-sub initGetNodes()
- m.start = m.top.findNode("start")
- m.stop = m.top.findNode("stop")
- m.reset = m.top.findNode("reset")
- m.btnGroup = m.top.findNode("btnGroup")
-end sub
diff --git a/.history/components/rowListScene_20211008150612.brs b/.history/components/rowListScene_20211008150612.brs
deleted file mode 100644
index 22440c7..0000000
--- a/.history/components/rowListScene_20211008150612.brs
+++ /dev/null
@@ -1,11 +0,0 @@
-sub init()
- initGetNodes()
- m.
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
-end sub
diff --git a/.history/components/rowListScene_20211008150619.brs b/.history/components/rowListScene_20211008150619.brs
deleted file mode 100644
index ebeb038..0000000
--- a/.history/components/rowListScene_20211008150619.brs
+++ /dev/null
@@ -1,11 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
-end sub
diff --git a/.history/components/rowListScene_20211008150659.brs b/.history/components/rowListScene_20211008150659.brs
deleted file mode 100644
index c90d8f5..0000000
--- a/.history/components/rowListScene_20211008150659.brs
+++ /dev/null
@@ -1,16 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
-end sub
-
-sub initObservers()
-
-end sub
diff --git a/.history/components/rowListScene_20211008150803.brs b/.history/components/rowListScene_20211008150803.brs
deleted file mode 100644
index 72935af..0000000
--- a/.history/components/rowListScene_20211008150803.brs
+++ /dev/null
@@ -1,16 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
-end sub
diff --git a/.history/components/rowListScene_20211008150813.brs b/.history/components/rowListScene_20211008150813.brs
deleted file mode 100644
index ca8a3b6..0000000
--- a/.history/components/rowListScene_20211008150813.brs
+++ /dev/null
@@ -1,18 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stop.observeField("buttonSelected", "stop")
- m.reset.observeField("buttonSelected", "reset")
-end sub
diff --git a/.history/components/rowListScene_20211008150839.brs b/.history/components/rowListScene_20211008150839.brs
deleted file mode 100644
index a2af0c2..0000000
--- a/.history/components/rowListScene_20211008150839.brs
+++ /dev/null
@@ -1,20 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("reset")
- m.reset = m.top.findNode("reset")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stop.observeField("buttonSelected", "stop")
- m.reset.observeField("buttonSelected", "reset")
-end sub
diff --git a/.history/components/rowListScene_20211008150851.brs b/.history/components/rowListScene_20211008150851.brs
deleted file mode 100644
index 4132c66..0000000
--- a/.history/components/rowListScene_20211008150851.brs
+++ /dev/null
@@ -1,20 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stop.observeField("buttonSelected", "stop")
- m.reset.observeField("buttonSelected", "reset")
-end sub
diff --git a/.history/components/rowListScene_20211008150910.brs b/.history/components/rowListScene_20211008150910.brs
deleted file mode 100644
index 756e93f..0000000
--- a/.history/components/rowListScene_20211008150910.brs
+++ /dev/null
@@ -1,23 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stop.observeField("buttonSelected", "stop")
- m.reset.observeField("buttonSelected", "reset")
-end sub
-
-sub start()
-end sub
diff --git a/.history/components/rowListScene_20211008150944.brs b/.history/components/rowListScene_20211008150944.brs
deleted file mode 100644
index 6c7350a..0000000
--- a/.history/components/rowListScene_20211008150944.brs
+++ /dev/null
@@ -1,28 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stop.observeField("buttonSelected", "stop")
- m.reset.observeField("buttonSelected", "reset")
-end sub
-
-sub start()
- m.timer.control = "start"
-end sub
-
-sub stop()
- m.timer.control = "stop"
-end sub
diff --git a/.history/components/rowListScene_20211008151000.brs b/.history/components/rowListScene_20211008151000.brs
deleted file mode 100644
index 49c9dc8..0000000
--- a/.history/components/rowListScene_20211008151000.brs
+++ /dev/null
@@ -1,32 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stop.observeField("buttonSelected", "stop")
- m.reset.observeField("buttonSelected", "reset")
-end sub
-
-sub start()
- m.timer.control = "start"
-end sub
-
-sub stop()
- m.timer.control = "stop"
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151026.brs b/.history/components/rowListScene_20211008151026.brs
deleted file mode 100644
index 49c9dc8..0000000
--- a/.history/components/rowListScene_20211008151026.brs
+++ /dev/null
@@ -1,32 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stop.observeField("buttonSelected", "stop")
- m.reset.observeField("buttonSelected", "reset")
-end sub
-
-sub start()
- m.timer.control = "start"
-end sub
-
-sub stop()
- m.timer.control = "stop"
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151203.xml b/.history/components/rowListScene_20211008151203.xml
deleted file mode 100644
index 8eb1ba2..0000000
--- a/.history/components/rowListScene_20211008151203.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151217.brs b/.history/components/rowListScene_20211008151217.brs
deleted file mode 100644
index b17c6b4..0000000
--- a/.history/components/rowListScene_20211008151217.brs
+++ /dev/null
@@ -1,33 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stop.observeField("buttonSelected", "stop")
- m.reset.observeField("buttonSelected", "reset")
- m.timer.observeField("fire", "reset")
-end sub
-
-sub start()
- m.timer.control = "start"
-end sub
-
-sub stop()
- m.timer.control = "stop"
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151221.xml b/.history/components/rowListScene_20211008151221.xml
deleted file mode 100644
index 0063b46..0000000
--- a/.history/components/rowListScene_20211008151221.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151233.brs b/.history/components/rowListScene_20211008151233.brs
deleted file mode 100644
index c33d013..0000000
--- a/.history/components/rowListScene_20211008151233.brs
+++ /dev/null
@@ -1,33 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stop.observeField("buttonSelected", "stop")
- m.reset.observeField("buttonSelected", "reset")
- m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer.control = "start"
-end sub
-
-sub stop()
- m.timer.control = "stop"
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151244.brs b/.history/components/rowListScene_20211008151244.brs
deleted file mode 100644
index 25f4896..0000000
--- a/.history/components/rowListScene_20211008151244.brs
+++ /dev/null
@@ -1,37 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stop.observeField("buttonSelected", "stop")
- m.reset.observeField("buttonSelected", "reset")
- m.timer.observeField("fire", "changeText")
-end sub
-
-sub changeText
-
-end sub
-
-sub start()
- m.timer.control = "start"
-end sub
-
-sub stop()
- m.timer.control = "stop"
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151305.brs b/.history/components/rowListScene_20211008151305.brs
deleted file mode 100644
index 9f8d9d9..0000000
--- a/.history/components/rowListScene_20211008151305.brs
+++ /dev/null
@@ -1,37 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stop = m.btnGroup.findNode("stop")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stop.observeField("buttonSelected", "stop")
- m.reset.observeField("buttonSelected", "reset")
- m.timer.observeField("fire", "changeText")
-end sub
-
-sub changeText()
- m.timeLabel.text = m.timer.duration
-end sub
-
-sub start()
- m.timer.control = "start"
-end sub
-
-sub stop()
- m.timer.control = "stop"
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151346.xml b/.history/components/rowListScene_20211008151346.xml
deleted file mode 100644
index ea89a5c..0000000
--- a/.history/components/rowListScene_20211008151346.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151554.brs b/.history/components/rowListScene_20211008151554.brs
deleted file mode 100644
index 3291af5..0000000
--- a/.history/components/rowListScene_20211008151554.brs
+++ /dev/null
@@ -1,37 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer.observeField("fire", "changeText")
-end sub
-
-sub changeText()
- m.timeLabel.text = m.timer.duration
-end sub
-
-sub start()
- m.timer.control = "start"
-end sub
-
-sub stop()
- m.timer.control = "stop"
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151601.xml b/.history/components/rowListScene_20211008151601.xml
deleted file mode 100644
index c693006..0000000
--- a/.history/components/rowListScene_20211008151601.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151608.brs b/.history/components/rowListScene_20211008151608.brs
deleted file mode 100644
index 35d9145..0000000
--- a/.history/components/rowListScene_20211008151608.brs
+++ /dev/null
@@ -1,37 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer.observeField("fire", "changeText")
-end sub
-
-sub changeText()
- m.timeLabel.text = m.timer.duration
-end sub
-
-sub start()
- m.timer.control = "start"
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151648.brs b/.history/components/rowListScene_20211008151648.brs
deleted file mode 100644
index 0045f6f..0000000
--- a/.history/components/rowListScene_20211008151648.brs
+++ /dev/null
@@ -1,38 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer.observeField("fire", "changeText")
-end sub
-
-sub changeText()
- m.timeLabel.text = m.timer.duration
-end sub
-
-sub start()
- m.timer.control = "start"
- ?m.timer.duration
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151716.brs b/.history/components/rowListScene_20211008151716.brs
deleted file mode 100644
index dd6e09d..0000000
--- a/.history/components/rowListScene_20211008151716.brs
+++ /dev/null
@@ -1,38 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer.observeField("fire", "changeText")
-end sub
-
-sub changeText()
- m.timeLabel.text = Str(m.timer.duration)
-end sub
-
-sub start()
- m.timer.control = "start"
- ?m.timer.duration
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151748.brs b/.history/components/rowListScene_20211008151748.brs
deleted file mode 100644
index e628dea..0000000
--- a/.history/components/rowListScene_20211008151748.brs
+++ /dev/null
@@ -1,34 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer.control = "start"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151751.brs b/.history/components/rowListScene_20211008151751.brs
deleted file mode 100644
index e628dea..0000000
--- a/.history/components/rowListScene_20211008151751.brs
+++ /dev/null
@@ -1,34 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer.control = "start"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008151753.brs b/.history/components/rowListScene_20211008151753.brs
deleted file mode 100644
index f4b2fd0..0000000
--- a/.history/components/rowListScene_20211008151753.brs
+++ /dev/null
@@ -1,34 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer.control = "start"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010122343.xml b/.history/components/rowListScene_20211010122343.xml
deleted file mode 100644
index c693006..0000000
--- a/.history/components/rowListScene_20211010122343.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010122348.xml b/.history/components/rowListScene_20211010122348.xml
deleted file mode 100644
index b912f1c..0000000
--- a/.history/components/rowListScene_20211010122348.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010122743.brs b/.history/components/rowListScene_20211010122743.brs
deleted file mode 100644
index 55d9f64..0000000
--- a/.history/components/rowListScene_20211010122743.brs
+++ /dev/null
@@ -1,34 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer.control = "start"
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010122855.brs b/.history/components/rowListScene_20211010122855.brs
deleted file mode 100644
index 4db3c87..0000000
--- a/.history/components/rowListScene_20211010122855.brs
+++ /dev/null
@@ -1,35 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer.control = "start"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
-
-sub reset()
- m.timer.control = "reset"
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010122902.brs b/.history/components/rowListScene_20211010122902.brs
deleted file mode 100644
index 7788025..0000000
--- a/.history/components/rowListScene_20211010122902.brs
+++ /dev/null
@@ -1,36 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer.control = "start"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
-
-sub reset()
- m.timer.control = "reset"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123116.xml b/.history/components/rowListScene_20211010123116.xml
deleted file mode 100644
index 5d2e84c..0000000
--- a/.history/components/rowListScene_20211010123116.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123149.brs b/.history/components/rowListScene_20211010123149.brs
deleted file mode 100644
index b0428e8..0000000
--- a/.history/components/rowListScene_20211010123149.brs
+++ /dev/null
@@ -1,37 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
- m.timer = createObject("roTimeSpan")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer.control = "start"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
-
-sub reset()
- m.timer.control = "reset"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123557.brs b/.history/components/rowListScene_20211010123557.brs
deleted file mode 100644
index 9be9bab..0000000
--- a/.history/components/rowListScene_20211010123557.brs
+++ /dev/null
@@ -1,37 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer = createObject("roTimeSpan")
- time = m.timer.totalSeconds()
- m.timeLabel.text = Str(time / 60) + Str((time 60) * 60)
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
-
-sub reset()
- m.timer.control = "reset"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123606.brs b/.history/components/rowListScene_20211010123606.brs
deleted file mode 100644
index 9be9bab..0000000
--- a/.history/components/rowListScene_20211010123606.brs
+++ /dev/null
@@ -1,37 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer = createObject("roTimeSpan")
- time = m.timer.totalSeconds()
- m.timeLabel.text = Str(time / 60) + Str((time 60) * 60)
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
-
-sub reset()
- m.timer.control = "reset"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123612.brs b/.history/components/rowListScene_20211010123612.brs
deleted file mode 100644
index 672143d..0000000
--- a/.history/components/rowListScene_20211010123612.brs
+++ /dev/null
@@ -1,37 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer = createObject("roTimeSpan")
- time = m.timer.totalSeconds()
- m.timeLabel.text = Str(time / 60) + Str((time mod 60) * 60)
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
-
-sub reset()
- m.timer.control = "reset"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123656.brs b/.history/components/rowListScene_20211010123656.brs
deleted file mode 100644
index 825eaca..0000000
--- a/.history/components/rowListScene_20211010123656.brs
+++ /dev/null
@@ -1,38 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer = createObject("roTimeSpan")
- time = m.timer.totalSeconds()
- m.timeLabel.text = Str(time / 60) + Str((time mod 60) * 60)
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- time = m.timer.totalSeconds()
- m.timeLabel.text = Str(time / 60) + Str((time mod 60) * 60)
-end sub
-
-sub reset()
- m.timer.control = "reset"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123711.brs b/.history/components/rowListScene_20211010123711.brs
deleted file mode 100644
index 3a300e4..0000000
--- a/.history/components/rowListScene_20211010123711.brs
+++ /dev/null
@@ -1,39 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer = createObject("roTimeSpan")
- time = m.timer.totalSeconds()
- m.timeLabel.text = Str(time / 60) + Str((time mod 60) * 60)
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- time = m.timer.totalSeconds()
- m.timeLabel.text = Str(time / 60) + Str((time mod 60) * 60)
-end sub
-
-sub reset()
- m.timer.control = "reset"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123739.brs b/.history/components/rowListScene_20211010123739.brs
deleted file mode 100644
index d2c4540..0000000
--- a/.history/components/rowListScene_20211010123739.brs
+++ /dev/null
@@ -1,38 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer = createObject("roTimeSpan")
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- time = m.timer.totalSeconds()
- m.timeLabel.text = Str(time / 60) + Str((time mod 60) * 60)
-end sub
-
-sub reset()
- m.timer.control = "reset"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123753.brs b/.history/components/rowListScene_20211010123753.brs
deleted file mode 100644
index 95683f7..0000000
--- a/.history/components/rowListScene_20211010123753.brs
+++ /dev/null
@@ -1,38 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer = createObject("roTimeSpan")
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- time = m.timer.totalSeconds()
- m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
-end sub
-
-sub reset()
- m.timer.control = "reset"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123754.brs b/.history/components/rowListScene_20211010123754.brs
deleted file mode 100644
index 95683f7..0000000
--- a/.history/components/rowListScene_20211010123754.brs
+++ /dev/null
@@ -1,38 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer = createObject("roTimeSpan")
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- time = m.timer.totalSeconds()
- m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
-end sub
-
-sub reset()
- m.timer.control = "reset"
- m.timeLabel.text = Str(m.timer.duration)
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123821.brs b/.history/components/rowListScene_20211010123821.brs
deleted file mode 100644
index bd46a35..0000000
--- a/.history/components/rowListScene_20211010123821.brs
+++ /dev/null
@@ -1,37 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer = createObject("roTimeSpan")
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- time = m.timer.totalSeconds()
- m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123912.brs b/.history/components/rowListScene_20211010123912.brs
deleted file mode 100644
index e9239ee..0000000
--- a/.history/components/rowListScene_20211010123912.brs
+++ /dev/null
@@ -1,37 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer = createObject("roTimespan")
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- time = m.timer.totalSeconds()
- m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010123926.brs b/.history/components/rowListScene_20211010123926.brs
deleted file mode 100644
index 75ec373..0000000
--- a/.history/components/rowListScene_20211010123926.brs
+++ /dev/null
@@ -1,37 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer = createObject("roTimespan")
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- m.timer.control = "stop"
- time = m.timer.TotalSeconds()
- m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124004.brs b/.history/components/rowListScene_20211010124004.brs
deleted file mode 100644
index 908aa4c..0000000
--- a/.history/components/rowListScene_20211010124004.brs
+++ /dev/null
@@ -1,36 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timer = createObject("roTimespan")
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124048.brs b/.history/components/rowListScene_20211010124048.brs
deleted file mode 100644
index 1e5116c..0000000
--- a/.history/components/rowListScene_20211010124048.brs
+++ /dev/null
@@ -1,36 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124059.brs b/.history/components/rowListScene_20211010124059.brs
deleted file mode 100644
index 1e5116c..0000000
--- a/.history/components/rowListScene_20211010124059.brs
+++ /dev/null
@@ -1,36 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- m.timeLabel.text = Str(time / 60) + ":" + Str((time mod 60) * 60)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124155.brs b/.history/components/rowListScene_20211010124155.brs
deleted file mode 100644
index 2d80754..0000000
--- a/.history/components/rowListScene_20211010124155.brs
+++ /dev/null
@@ -1,36 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- m.timeLabel.text = Str(time / 60) + ":" + Str((time MOD 60) * 60)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124210.brs b/.history/components/rowListScene_20211010124210.brs
deleted file mode 100644
index f6a59a7..0000000
--- a/.history/components/rowListScene_20211010124210.brs
+++ /dev/null
@@ -1,36 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- m.timeLabel.text = Str(Int(time / 60)) + ":" + Str((Int(time MOD 60)) * 60)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124225.brs b/.history/components/rowListScene_20211010124225.brs
deleted file mode 100644
index ad873ab..0000000
--- a/.history/components/rowListScene_20211010124225.brs
+++ /dev/null
@@ -1,36 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT(time MOD 60)) * 60)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124416.brs b/.history/components/rowListScene_20211010124416.brs
deleted file mode 100644
index 58f930a..0000000
--- a/.history/components/rowListScene_20211010124416.brs
+++ /dev/null
@@ -1,36 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124457.brs b/.history/components/rowListScene_20211010124457.brs
deleted file mode 100644
index 3594e63..0000000
--- a/.history/components/rowListScene_20211010124457.brs
+++ /dev/null
@@ -1,36 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124504.brs b/.history/components/rowListScene_20211010124504.brs
deleted file mode 100644
index 58f930a..0000000
--- a/.history/components/rowListScene_20211010124504.brs
+++ /dev/null
@@ -1,36 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124545.brs b/.history/components/rowListScene_20211010124545.brs
deleted file mode 100644
index 093d510..0000000
--- a/.history/components/rowListScene_20211010124545.brs
+++ /dev/null
@@ -1,38 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time > 59
- seconds = "00"
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124549.brs b/.history/components/rowListScene_20211010124549.brs
deleted file mode 100644
index 4cf4286..0000000
--- a/.history/components/rowListScene_20211010124549.brs
+++ /dev/null
@@ -1,39 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time > 59
- seconds = "00"
- end if
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124817.brs b/.history/components/rowListScene_20211010124817.brs
deleted file mode 100644
index 4699e70..0000000
--- a/.history/components/rowListScene_20211010124817.brs
+++ /dev/null
@@ -1,42 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = "00"
- end if
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124832.brs b/.history/components/rowListScene_20211010124832.brs
deleted file mode 100644
index 13ad598..0000000
--- a/.history/components/rowListScene_20211010124832.brs
+++ /dev/null
@@ -1,42 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = = 0
- seconds = "00"
- minutes = time / 60
- else
- minutes = "00"
- end if
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124834.brs b/.history/components/rowListScene_20211010124834.brs
deleted file mode 100644
index 13ad598..0000000
--- a/.history/components/rowListScene_20211010124834.brs
+++ /dev/null
@@ -1,42 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = = 0
- seconds = "00"
- minutes = time / 60
- else
- minutes = "00"
- end if
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124838.brs b/.history/components/rowListScene_20211010124838.brs
deleted file mode 100644
index 3e31de6..0000000
--- a/.history/components/rowListScene_20211010124838.brs
+++ /dev/null
@@ -1,41 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = = 0
- seconds = "00"
- minutes = time / 60
- else
- end if
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124840.brs b/.history/components/rowListScene_20211010124840.brs
deleted file mode 100644
index 0d67eda..0000000
--- a/.history/components/rowListScene_20211010124840.brs
+++ /dev/null
@@ -1,40 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = = 0
- seconds = "00"
- minutes = time / 60
- end if
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124841.brs b/.history/components/rowListScene_20211010124841.brs
deleted file mode 100644
index 0d67eda..0000000
--- a/.history/components/rowListScene_20211010124841.brs
+++ /dev/null
@@ -1,40 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = = 0
- seconds = "00"
- minutes = time / 60
- end if
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124855.brs b/.history/components/rowListScene_20211010124855.brs
deleted file mode 100644
index 5779dde..0000000
--- a/.history/components/rowListScene_20211010124855.brs
+++ /dev/null
@@ -1,40 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if (time MOD 60) = = 0
- seconds = "00"
- minutes = time / 60
- end if
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124857.brs b/.history/components/rowListScene_20211010124857.brs
deleted file mode 100644
index 5779dde..0000000
--- a/.history/components/rowListScene_20211010124857.brs
+++ /dev/null
@@ -1,40 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if (time MOD 60) = = 0
- seconds = "00"
- minutes = time / 60
- end if
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124910.brs b/.history/components/rowListScene_20211010124910.brs
deleted file mode 100644
index 74f9346..0000000
--- a/.history/components/rowListScene_20211010124910.brs
+++ /dev/null
@@ -1,40 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = time / 60
- end if
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010124917.brs b/.history/components/rowListScene_20211010124917.brs
deleted file mode 100644
index a3d5539..0000000
--- a/.history/components/rowListScene_20211010124917.brs
+++ /dev/null
@@ -1,41 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = time / 60
- else
- end if
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125016.brs b/.history/components/rowListScene_20211010125016.brs
deleted file mode 100644
index 5c59ca9..0000000
--- a/.history/components/rowListScene_20211010125016.brs
+++ /dev/null
@@ -1,43 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = time / 60
- else
- minutes = INT(time / 60)
- seconds = INT((time MOD 60) * 60)
- end if
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125023.brs b/.history/components/rowListScene_20211010125023.brs
deleted file mode 100644
index 52b93df..0000000
--- a/.history/components/rowListScene_20211010125023.brs
+++ /dev/null
@@ -1,43 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = time / 60
- else
- minutes = INT(time / 60)
- seconds = Str(INT((time MOD 60) * 60))
- end if
- m.timeLabel.text = Str(INT(time / 60)) + ":" + Str((INT((time MOD 60) * 60)))
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125035.brs b/.history/components/rowListScene_20211010125035.brs
deleted file mode 100644
index 608ae7f..0000000
--- a/.history/components/rowListScene_20211010125035.brs
+++ /dev/null
@@ -1,43 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = time / 60
- else
- minutes = INT(time / 60)
- seconds = Str(INT((time MOD 60) * 60))
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125125.brs b/.history/components/rowListScene_20211010125125.brs
deleted file mode 100644
index 2ee8a7e..0000000
--- a/.history/components/rowListScene_20211010125125.brs
+++ /dev/null
@@ -1,43 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT((time MOD 60) * 60))
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125153.brs b/.history/components/rowListScene_20211010125153.brs
deleted file mode 100644
index 421b178..0000000
--- a/.history/components/rowListScene_20211010125153.brs
+++ /dev/null
@@ -1,43 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125251.brs b/.history/components/rowListScene_20211010125251.brs
deleted file mode 100644
index 441c075..0000000
--- a/.history/components/rowListScene_20211010125251.brs
+++ /dev/null
@@ -1,44 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- if Len(minutes)
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125317.brs b/.history/components/rowListScene_20211010125317.brs
deleted file mode 100644
index 0155232..0000000
--- a/.history/components/rowListScene_20211010125317.brs
+++ /dev/null
@@ -1,46 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- if Len(minutes) = 1
-
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125328.brs b/.history/components/rowListScene_20211010125328.brs
deleted file mode 100644
index ad1fd38..0000000
--- a/.history/components/rowListScene_20211010125328.brs
+++ /dev/null
@@ -1,46 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125350.brs b/.history/components/rowListScene_20211010125350.brs
deleted file mode 100644
index c45205a..0000000
--- a/.history/components/rowListScene_20211010125350.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125431.brs b/.history/components/rowListScene_20211010125431.brs
deleted file mode 100644
index f5a70be..0000000
--- a/.history/components/rowListScene_20211010125431.brs
+++ /dev/null
@@ -1,50 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- ?Len(minutes)
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125509.brs b/.history/components/rowListScene_20211010125509.brs
deleted file mode 100644
index a16401c..0000000
--- a/.history/components/rowListScene_20211010125509.brs
+++ /dev/null
@@ -1,50 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- ?Len(seconds)
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125709.brs b/.history/components/rowListScene_20211010125709.brs
deleted file mode 100644
index c45205a..0000000
--- a/.history/components/rowListScene_20211010125709.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125712.brs b/.history/components/rowListScene_20211010125712.brs
deleted file mode 100644
index 15d31ee..0000000
--- a/.history/components/rowListScene_20211010125712.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- if Len(minutes) = 2
- minutes = "0" + minutes
- end if
- if Len(seconds) = 2
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125717.brs b/.history/components/rowListScene_20211010125717.brs
deleted file mode 100644
index c4d5f54..0000000
--- a/.history/components/rowListScene_20211010125717.brs
+++ /dev/null
@@ -1,50 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- if Len(minutes) = 2
- minutes = "0" + minutes
- end if
- if Len(seconds) = 2
- seconds = "0" + seconds
- end if
- ?minutes
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125756.brs b/.history/components/rowListScene_20211010125756.brs
deleted file mode 100644
index c4d5f54..0000000
--- a/.history/components/rowListScene_20211010125756.brs
+++ /dev/null
@@ -1,50 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- if Len(minutes) = 2
- minutes = "0" + minutes
- end if
- if Len(seconds) = 2
- seconds = "0" + seconds
- end if
- ?minutes
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125848.brs b/.history/components/rowListScene_20211010125848.brs
deleted file mode 100644
index 15d31ee..0000000
--- a/.history/components/rowListScene_20211010125848.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- if Len(minutes) = 2
- minutes = "0" + minutes
- end if
- if Len(seconds) = 2
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125855.brs b/.history/components/rowListScene_20211010125855.brs
deleted file mode 100644
index c45205a..0000000
--- a/.history/components/rowListScene_20211010125855.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010125904.brs b/.history/components/rowListScene_20211010125904.brs
deleted file mode 100644
index 1f962f5..0000000
--- a/.history/components/rowListScene_20211010125904.brs
+++ /dev/null
@@ -1,50 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- ?minutes;seconds
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130310.brs b/.history/components/rowListScene_20211010130310.brs
deleted file mode 100644
index cce4ff7..0000000
--- a/.history/components/rowListScene_20211010130310.brs
+++ /dev/null
@@ -1,50 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- ?minutes.Len();LEN(seconds)
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130315.brs b/.history/components/rowListScene_20211010130315.brs
deleted file mode 100644
index 1f516bb..0000000
--- a/.history/components/rowListScene_20211010130315.brs
+++ /dev/null
@@ -1,50 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- ?minutes.Len();Len(seconds)
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130435.brs b/.history/components/rowListScene_20211010130435.brs
deleted file mode 100644
index cef2242..0000000
--- a/.history/components/rowListScene_20211010130435.brs
+++ /dev/null
@@ -1,50 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- ?minutes.Len();Len(Right(seconds, 1))
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130553.brs b/.history/components/rowListScene_20211010130553.brs
deleted file mode 100644
index d23ca05..0000000
--- a/.history/components/rowListScene_20211010130553.brs
+++ /dev/null
@@ -1,50 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- ?seconds.Len()
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130642.brs b/.history/components/rowListScene_20211010130642.brs
deleted file mode 100644
index c45205a..0000000
--- a/.history/components/rowListScene_20211010130642.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130800.brs b/.history/components/rowListScene_20211010130800.brs
deleted file mode 100644
index 7531e7c..0000000
--- a/.history/components/rowListScene_20211010130800.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- end if
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130847.brs b/.history/components/rowListScene_20211010130847.brs
deleted file mode 100644
index 57d5dfc..0000000
--- a/.history/components/rowListScene_20211010130847.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- end if
- if Len(minutes > 10)
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130910.brs b/.history/components/rowListScene_20211010130910.brs
deleted file mode 100644
index d75f871..0000000
--- a/.history/components/rowListScene_20211010130910.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- end if
- if minutes > 10
- minutes = "0" + minutes
- end if
- if seconds > 10
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010130927.brs b/.history/components/rowListScene_20211010130927.brs
deleted file mode 100644
index 25e89dc..0000000
--- a/.history/components/rowListScene_20211010130927.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- end if
- if minutes > 10
- minutes = "0" + Str(minutes)
- end if
- if seconds > 10
- seconds = "0" + Str(seconds)
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131020.brs b/.history/components/rowListScene_20211010131020.brs
deleted file mode 100644
index e38ad66..0000000
--- a/.history/components/rowListScene_20211010131020.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- end if
- if minutes > 10
- minutes = "0" + Str(minutes)
- end if
- if seconds > 10
- seconds = "0" + Str(seconds)
- end if
- m.timeLabel.text = String(minutes + ":" + seconds)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131021.brs b/.history/components/rowListScene_20211010131021.brs
deleted file mode 100644
index e38ad66..0000000
--- a/.history/components/rowListScene_20211010131021.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- end if
- if minutes > 10
- minutes = "0" + Str(minutes)
- end if
- if seconds > 10
- seconds = "0" + Str(seconds)
- end if
- m.timeLabel.text = String(minutes + ":" + seconds)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131044.brs b/.history/components/rowListScene_20211010131044.brs
deleted file mode 100644
index 41b34ac..0000000
--- a/.history/components/rowListScene_20211010131044.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- end if
- if minutes > 10
- minutes = "0" + Str(minutes)
- end if
- if seconds > 10
- seconds = "0" + Str(seconds)
- end if
- m.timeLabel.text = Str(minutes + ":" + seconds)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131134.brs b/.history/components/rowListScene_20211010131134.brs
deleted file mode 100644
index 25e89dc..0000000
--- a/.history/components/rowListScene_20211010131134.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- end if
- if minutes > 10
- minutes = "0" + Str(minutes)
- end if
- if seconds > 10
- seconds = "0" + Str(seconds)
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131150.brs b/.history/components/rowListScene_20211010131150.brs
deleted file mode 100644
index 0688b9e..0000000
--- a/.history/components/rowListScene_20211010131150.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- end if
- if minutes > 10
- minutes = "0" + Str(minutes)
- end if
- if seconds > 10
- seconds = "0" + Str(seconds)
- end if
- m.timeLabel.text = Str(minutes) + ":" + Str(seconds)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131237.brs b/.history/components/rowListScene_20211010131237.brs
deleted file mode 100644
index 29242d8..0000000
--- a/.history/components/rowListScene_20211010131237.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- end if
- if minutes < 10
- minutes = "0" + Str(minutes)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- end if
- m.timeLabel.text = Str(minutes) + ":" + Str(seconds)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131430.brs b/.history/components/rowListScene_20211010131430.brs
deleted file mode 100644
index ab60956..0000000
--- a/.history/components/rowListScene_20211010131430.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- end if
- m.timeLabel.text = Str(minutes) + ":" + Str(seconds)
- end if
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131442.brs b/.history/components/rowListScene_20211010131442.brs
deleted file mode 100644
index dd532ac..0000000
--- a/.history/components/rowListScene_20211010131442.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- end if
- end if
- m.timeLabel.text = Str(minutes) + ":" + Str(seconds)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131514.brs b/.history/components/rowListScene_20211010131514.brs
deleted file mode 100644
index 3bb158a..0000000
--- a/.history/components/rowListScene_20211010131514.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + minutes
- end if
- if seconds < 10
- seconds = "0" + seconds
- end if
- end if
- m.timeLabel.text = Str(minutes) + ":" + Str(seconds)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131649.brs b/.history/components/rowListScene_20211010131649.brs
deleted file mode 100644
index dd532ac..0000000
--- a/.history/components/rowListScene_20211010131649.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- end if
- end if
- m.timeLabel.text = Str(minutes) + ":" + Str(seconds)
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131725.brs b/.history/components/rowListScene_20211010131725.brs
deleted file mode 100644
index a0334d5..0000000
--- a/.history/components/rowListScene_20211010131725.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- end if
- end if
- m.timeLabel.text = minutes) + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010131734.brs b/.history/components/rowListScene_20211010131734.brs
deleted file mode 100644
index ba60973..0000000
--- a/.history/components/rowListScene_20211010131734.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- end if
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132014.brs b/.history/components/rowListScene_20211010132014.brs
deleted file mode 100644
index cb62839..0000000
--- a/.history/components/rowListScene_20211010132014.brs
+++ /dev/null
@@ -1,53 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- else
- minutes = INT(time / 60)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- else
- seconds = INT(time / 60)
- end if
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132049.brs b/.history/components/rowListScene_20211010132049.brs
deleted file mode 100644
index 3de214e..0000000
--- a/.history/components/rowListScene_20211010132049.brs
+++ /dev/null
@@ -1,53 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- else
- minutes = Str(time / 60)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- else
- seconds = Str(time / 60)
- end if
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132232.brs b/.history/components/rowListScene_20211010132232.brs
deleted file mode 100644
index a15f78a..0000000
--- a/.history/components/rowListScene_20211010132232.brs
+++ /dev/null
@@ -1,53 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- else
- minutes = Str(time / 60)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- else
- seconds = Str(seconds)
- end if
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132443.brs b/.history/components/rowListScene_20211010132443.brs
deleted file mode 100644
index 27b8e2e..0000000
--- a/.history/components/rowListScene_20211010132443.brs
+++ /dev/null
@@ -1,55 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- minutes = Right(minutes, 1)
- else
- minutes = Str(time / 60)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- seconds = Right(seconds, 1)
- else
- seconds = Str(seconds)
- end if
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132532.brs b/.history/components/rowListScene_20211010132532.brs
deleted file mode 100644
index 17bbae4..0000000
--- a/.history/components/rowListScene_20211010132532.brs
+++ /dev/null
@@ -1,57 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- minutes = "0" + minutes
- minutes = Right(minutes, 1)
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- minutes = Right(minutes, 1)
- else
- minutes = Str(time / 60)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- seconds = Right(seconds, 1)
- else
- seconds = Str(seconds)
- end if
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132545.brs b/.history/components/rowListScene_20211010132545.brs
deleted file mode 100644
index a6818b4..0000000
--- a/.history/components/rowListScene_20211010132545.brs
+++ /dev/null
@@ -1,56 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- minutes = "0" + minutes
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- minutes = Right(minutes, 1)
- else
- minutes = Str(time / 60)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- seconds = Right(seconds, 1)
- else
- seconds = Str(seconds)
- end if
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132642.brs b/.history/components/rowListScene_20211010132642.brs
deleted file mode 100644
index b4b5b84..0000000
--- a/.history/components/rowListScene_20211010132642.brs
+++ /dev/null
@@ -1,56 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- minutes = "0" + minutes
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- minutes = Right(minutes, 1) + Left(minutes, 1)
- else
- minutes = Str(time / 60)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- seconds = Right(seconds, 1) + Left(seconds, 1)
- else
- seconds = Str(seconds)
- end if
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132714.brs b/.history/components/rowListScene_20211010132714.brs
deleted file mode 100644
index b2e0f9f..0000000
--- a/.history/components/rowListScene_20211010132714.brs
+++ /dev/null
@@ -1,56 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- minutes = "0" + minutes
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- minutes = Right(minutes, 1) + Left(minutes, 1)
- else
- minutes = Str(time / 60)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- seconds = Left(seconds, 1) + Right(seconds, 1)
- else
- seconds = Str(seconds)
- end if
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132739.brs b/.history/components/rowListScene_20211010132739.brs
deleted file mode 100644
index 4199bbd..0000000
--- a/.history/components/rowListScene_20211010132739.brs
+++ /dev/null
@@ -1,56 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- minutes = "0" + minutes
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- minutes = + Left(minutes, 1) + Right(minutes, 1)
- else
- minutes = Str(time / 60)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- seconds = Left(seconds, 1) + Right(seconds, 1)
- else
- seconds = Str(seconds)
- end if
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132742.brs b/.history/components/rowListScene_20211010132742.brs
deleted file mode 100644
index 4199bbd..0000000
--- a/.history/components/rowListScene_20211010132742.brs
+++ /dev/null
@@ -1,56 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- minutes = "0" + minutes
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- minutes = + Left(minutes, 1) + Right(minutes, 1)
- else
- minutes = Str(time / 60)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- seconds = Left(seconds, 1) + Right(seconds, 1)
- else
- seconds = Str(seconds)
- end if
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132749.brs b/.history/components/rowListScene_20211010132749.brs
deleted file mode 100644
index c674851..0000000
--- a/.history/components/rowListScene_20211010132749.brs
+++ /dev/null
@@ -1,56 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- minutes = "0" + minutes
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- minutes = Left(minutes, 1) + Right(minutes, 1)
- else
- minutes = Str(time / 60)
- end if
- if seconds < 10
- seconds = "0" + Str(seconds)
- seconds = Left(seconds, 1) + Right(seconds, 1)
- else
- seconds = Str(seconds)
- end if
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132943.brs b/.history/components/rowListScene_20211010132943.brs
deleted file mode 100644
index 33e4950..0000000
--- a/.history/components/rowListScene_20211010132943.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- minutes = "0" + minutes
-else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- minutes = Left(minutes, 1) + Right(minutes, 1)
- else
- minutes = Str(time / 60)
- end if
-
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132944.brs b/.history/components/rowListScene_20211010132944.brs
deleted file mode 100644
index ac5da14..0000000
--- a/.history/components/rowListScene_20211010132944.brs
+++ /dev/null
@@ -1,48 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- minutes = "0" + minutes
-else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- minutes = Left(minutes, 1) + Right(minutes, 1)
- else
- minutes = Str(time / 60)
- end if
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010132947.brs b/.history/components/rowListScene_20211010132947.brs
deleted file mode 100644
index 4111f03..0000000
--- a/.history/components/rowListScene_20211010132947.brs
+++ /dev/null
@@ -1,49 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- minutes = "0" + minutes
- else
- minutes = INT(time / 60)
- seconds = INT(time MOD 60)
- if minutes < 10
- minutes = "0" + Str(minutes)
- minutes = Left(minutes, 1) + Right(minutes, 1)
- else
- minutes = Str(time / 60)
- end if
- end if
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133121.brs b/.history/components/rowListScene_20211010133121.brs
deleted file mode 100644
index 706e1c1..0000000
--- a/.history/components/rowListScene_20211010133121.brs
+++ /dev/null
@@ -1,51 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- minutes = trim(minutes)
- seconds = trim(seoncds)
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133129.brs b/.history/components/rowListScene_20211010133129.brs
deleted file mode 100644
index 9b9b750..0000000
--- a/.history/components/rowListScene_20211010133129.brs
+++ /dev/null
@@ -1,51 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- minutes = trim(minutes)
- seconds = trim(seconds)
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133140.brs b/.history/components/rowListScene_20211010133140.brs
deleted file mode 100644
index 8f3497e..0000000
--- a/.history/components/rowListScene_20211010133140.brs
+++ /dev/null
@@ -1,51 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- minutes = T(minutes)
- seconds = T(seconds)
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133142.brs b/.history/components/rowListScene_20211010133142.brs
deleted file mode 100644
index a515cd8..0000000
--- a/.history/components/rowListScene_20211010133142.brs
+++ /dev/null
@@ -1,51 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- minutes = Trim(minutes)
- seconds = Trim(seconds)
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133202.brs b/.history/components/rowListScene_20211010133202.brs
deleted file mode 100644
index 85b4e1d..0000000
--- a/.history/components/rowListScene_20211010133202.brs
+++ /dev/null
@@ -1,51 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- m.reset = m.btnGroup.findNode("reset")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- minutes = minutes.trim()
- seconds = seconds.trim()
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133442.xml b/.history/components/rowListScene_20211010133442.xml
deleted file mode 100644
index e9f270e..0000000
--- a/.history/components/rowListScene_20211010133442.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133449.brs b/.history/components/rowListScene_20211010133449.brs
deleted file mode 100644
index 0613459..0000000
--- a/.history/components/rowListScene_20211010133449.brs
+++ /dev/null
@@ -1,50 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.reset.observeField("buttonSelected", "reset")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- minutes = minutes.trim()
- seconds = seconds.trim()
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
-
-sub reset()
- m.timer = createObject("roTimeSpan")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211010133458.brs b/.history/components/rowListScene_20211010133458.brs
deleted file mode 100644
index ac6aaf5..0000000
--- a/.history/components/rowListScene_20211010133458.brs
+++ /dev/null
@@ -1,45 +0,0 @@
-sub init()
- initGetNodes()
- m.btnGroup.setFocus(true)
- initObservers()
-end sub
-
-sub initGetNodes()
- m.btnGroup = m.top.findNode("btnGroup")
- m.start = m.btnGroup.findNode("start")
- m.stopTimer = m.btnGroup.findNode("stopTimer")
- ' m.timer = m.top.findNode("timer")
- m.timeLabel = m.top.findNode("timeLabel")
-end sub
-
-sub initObservers()
- m.start.observeField("buttonSelected", "start")
- m.stopTimer.observeField("buttonSelected", "stopTimer")
- m.timer = createObject("roTimespan")
- ' m.timer.observeField("fire", "changeText")
-end sub
-
-sub start()
- m.timeLabel.text = "00:00"
- m.timer.Mark()
-end sub
-
-sub stopTimer()
- time = m.timer.TotalSeconds()
- if time MOD 60 = 0
- seconds = "00"
- minutes = Str(time / 60)
- else
- minutes = Str(INT(time / 60))
- seconds = Str(INT(time MOD 60))
- end if
- minutes = minutes.trim()
- seconds = seconds.trim()
- if Len(minutes) = 1
- minutes = "0" + minutes
- end if
- if Len(seconds) = 1
- seconds = "0" + seconds
- end if
- m.timeLabel.text = minutes + ":" + seconds
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011134546.xml b/.history/components/rowListScene_20211011134546.xml
deleted file mode 100644
index 23c8ae2..0000000
--- a/.history/components/rowListScene_20211011134546.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011134642.xml b/.history/components/rowListScene_20211011134642.xml
deleted file mode 100644
index 0453b19..0000000
--- a/.history/components/rowListScene_20211011134642.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011134809.xml b/.history/components/rowListScene_20211011134809.xml
deleted file mode 100644
index 8202175..0000000
--- a/.history/components/rowListScene_20211011134809.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011134907.xml b/.history/components/rowListScene_20211011134907.xml
deleted file mode 100644
index b45c796..0000000
--- a/.history/components/rowListScene_20211011134907.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011134920.xml b/.history/components/rowListScene_20211011134920.xml
deleted file mode 100644
index 01afb73..0000000
--- a/.history/components/rowListScene_20211011134920.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135127.xml b/.history/components/rowListScene_20211011135127.xml
deleted file mode 100644
index 529cc99..0000000
--- a/.history/components/rowListScene_20211011135127.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135145.brs b/.history/components/rowListScene_20211011135145.brs
deleted file mode 100644
index 720721c..0000000
--- a/.history/components/rowListScene_20211011135145.brs
+++ /dev/null
@@ -1,20 +0,0 @@
-sub init()
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
-end sub
diff --git a/.history/components/rowListScene_20211011135201.brs b/.history/components/rowListScene_20211011135201.brs
deleted file mode 100644
index fd3595f..0000000
--- a/.history/components/rowListScene_20211011135201.brs
+++ /dev/null
@@ -1,21 +0,0 @@
-sub init()
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
-end sub
diff --git a/.history/components/rowListScene_20211011135220.xml b/.history/components/rowListScene_20211011135220.xml
deleted file mode 100644
index 228fc4c..0000000
--- a/.history/components/rowListScene_20211011135220.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135315.xml b/.history/components/rowListScene_20211011135315.xml
deleted file mode 100644
index 261038d..0000000
--- a/.history/components/rowListScene_20211011135315.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135328.xml b/.history/components/rowListScene_20211011135328.xml
deleted file mode 100644
index ca9b317..0000000
--- a/.history/components/rowListScene_20211011135328.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135342.xml b/.history/components/rowListScene_20211011135342.xml
deleted file mode 100644
index c86dfe8..0000000
--- a/.history/components/rowListScene_20211011135342.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135727.xml b/.history/components/rowListScene_20211011135727.xml
deleted file mode 100644
index 7c75e5f..0000000
--- a/.history/components/rowListScene_20211011135727.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135742.xml b/.history/components/rowListScene_20211011135742.xml
deleted file mode 100644
index fba5faf..0000000
--- a/.history/components/rowListScene_20211011135742.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135756.xml b/.history/components/rowListScene_20211011135756.xml
deleted file mode 100644
index 1d590b5..0000000
--- a/.history/components/rowListScene_20211011135756.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011135757.xml b/.history/components/rowListScene_20211011135757.xml
deleted file mode 100644
index ac9daba..0000000
--- a/.history/components/rowListScene_20211011135757.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011140317.xml b/.history/components/rowListScene_20211011140317.xml
deleted file mode 100644
index 6f6de83..0000000
--- a/.history/components/rowListScene_20211011140317.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011140321.xml b/.history/components/rowListScene_20211011140321.xml
deleted file mode 100644
index 6f6de83..0000000
--- a/.history/components/rowListScene_20211011140321.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011142206.xml b/.history/components/rowListScene_20211011142206.xml
deleted file mode 100644
index a011be6..0000000
--- a/.history/components/rowListScene_20211011142206.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011142420.xml b/.history/components/rowListScene_20211011142420.xml
deleted file mode 100644
index 305b1e5..0000000
--- a/.history/components/rowListScene_20211011142420.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011142458.xml b/.history/components/rowListScene_20211011142458.xml
deleted file mode 100644
index 3429aac..0000000
--- a/.history/components/rowListScene_20211011142458.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011142525.brs b/.history/components/rowListScene_20211011142525.brs
deleted file mode 100644
index fb7975a..0000000
--- a/.history/components/rowListScene_20211011142525.brs
+++ /dev/null
@@ -1,22 +0,0 @@
-sub init()
- m.SampleComponentLib = m.findNode("SampleComponentLib")
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
-end sub
diff --git a/.history/components/rowListScene_20211011142610.brs b/.history/components/rowListScene_20211011142610.brs
deleted file mode 100644
index 0dec3b2..0000000
--- a/.history/components/rowListScene_20211011142610.brs
+++ /dev/null
@@ -1,23 +0,0 @@
-sub init()
- m.SampleComponentLib = m.findNode("SampleComponentLib")
- m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
-end sub
diff --git a/.history/components/rowListScene_20211011142646.brs b/.history/components/rowListScene_20211011142646.brs
deleted file mode 100644
index 009bbee..0000000
--- a/.history/components/rowListScene_20211011142646.brs
+++ /dev/null
@@ -1,27 +0,0 @@
-sub init()
- m.SampleComponentLib = m.findNode("SampleComponentLib")
- m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
-end sub
-
-sub libraryLoaded()
-
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011142657.brs b/.history/components/rowListScene_20211011142657.brs
deleted file mode 100644
index 24fe681..0000000
--- a/.history/components/rowListScene_20211011142657.brs
+++ /dev/null
@@ -1,27 +0,0 @@
-sub init()
- m.SampleComponentLib = m.findNode("SampleComponentLib")
- m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
-end sub
-
-sub libraryLoaded()
- if (m.SampleComponentLib.loadStatus = "ready")
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011142700.brs b/.history/components/rowListScene_20211011142700.brs
deleted file mode 100644
index b113633..0000000
--- a/.history/components/rowListScene_20211011142700.brs
+++ /dev/null
@@ -1,29 +0,0 @@
-sub init()
- m.SampleComponentLib = m.findNode("SampleComponentLib")
- m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
-end sub
-
-sub libraryLoaded()
- if (m.SampleComponentLib.loadStatus = "ready")
-
- end if
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011143048.brs b/.history/components/rowListScene_20211011143048.brs
deleted file mode 100644
index 80896b5..0000000
--- a/.history/components/rowListScene_20211011143048.brs
+++ /dev/null
@@ -1,30 +0,0 @@
-sub init()
- m.parent = m.findNode("mainParent")
- m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
- m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
-end sub
-
-sub libraryLoaded()
- if (m.SampleComponentLib.loadStatus = "ready")
-
- end if
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011143119.brs b/.history/components/rowListScene_20211011143119.brs
deleted file mode 100644
index d6761a8..0000000
--- a/.history/components/rowListScene_20211011143119.brs
+++ /dev/null
@@ -1,30 +0,0 @@
-sub init()
- m.parent = m.findNode("mainParent")
- m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
- m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
-end sub
-
-sub libraryLoaded()
- if (m.SampleComponentLib.loadStatus = "ready")
- loadingNode = createObject("roSGNode", "MainScreen")
- end if
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011143203.brs b/.history/components/rowListScene_20211011143203.brs
deleted file mode 100644
index b840d5f..0000000
--- a/.history/components/rowListScene_20211011143203.brs
+++ /dev/null
@@ -1,31 +0,0 @@
-sub init()
- m.parent = m.findNode("mainParent")
- m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
- m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
-end sub
-
-sub libraryLoaded()
- if (m.SampleComponentLib.loadStatus = "ready")
- loadingNode = createObject("roSGNode", "LoadingScreen")
- m.parent.appendChild(loadingNode)
- end if
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011143204.brs b/.history/components/rowListScene_20211011143204.brs
deleted file mode 100644
index b840d5f..0000000
--- a/.history/components/rowListScene_20211011143204.brs
+++ /dev/null
@@ -1,31 +0,0 @@
-sub init()
- m.parent = m.findNode("mainParent")
- m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
- m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
-end sub
-
-sub libraryLoaded()
- if (m.SampleComponentLib.loadStatus = "ready")
- loadingNode = createObject("roSGNode", "LoadingScreen")
- m.parent.appendChild(loadingNode)
- end if
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011143521.brs b/.history/components/rowListScene_20211011143521.brs
deleted file mode 100644
index 46e40b0..0000000
--- a/.history/components/rowListScene_20211011143521.brs
+++ /dev/null
@@ -1,35 +0,0 @@
-sub init()
- m.parent = m.findNode("mainParent")
- m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
- m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
- store = CreateObject("roSGNode", "ChannelStore")
- ' Request several properties for sign-up
- store.requestedUserData = "email, phone, firstname, lastname"
- store.command = "getUserData"
-end sub
-
-sub libraryLoaded()
- if (m.SampleComponentLib.loadStatus = "ready")
- loadingNode = createObject("roSGNode", "LoadingScreen")
- m.parent.appendChild(loadingNode)
- end if
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011143557.brs b/.history/components/rowListScene_20211011143557.brs
deleted file mode 100644
index b42b3ad..0000000
--- a/.history/components/rowListScene_20211011143557.brs
+++ /dev/null
@@ -1,36 +0,0 @@
-sub init()
- m.parent = m.findNode("mainParent")
- m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
- m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
- store = CreateObject("roSGNode", "ChannelStore")
- ' Request several properties for sign-up
- store.requestedUserData = "email, phone, firstname, lastname"
- store.command = "getUserData"
- ?store.userData.firstName
-end sub
-
-sub libraryLoaded()
- if (m.SampleComponentLib.loadStatus = "ready")
- loadingNode = createObject("roSGNode", "LoadingScreen")
- m.parent.appendChild(loadingNode)
- end if
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144019.xml b/.history/components/rowListScene_20211011144019.xml
deleted file mode 100644
index 3429aac..0000000
--- a/.history/components/rowListScene_20211011144019.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144025.xml b/.history/components/rowListScene_20211011144025.xml
deleted file mode 100644
index 3429aac..0000000
--- a/.history/components/rowListScene_20211011144025.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144115.xml b/.history/components/rowListScene_20211011144115.xml
deleted file mode 100644
index cdd7e9d..0000000
--- a/.history/components/rowListScene_20211011144115.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144141.xml b/.history/components/rowListScene_20211011144141.xml
deleted file mode 100644
index f99d4ae..0000000
--- a/.history/components/rowListScene_20211011144141.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144330.xml b/.history/components/rowListScene_20211011144330.xml
deleted file mode 100644
index 2af1ee5..0000000
--- a/.history/components/rowListScene_20211011144330.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144343.brs b/.history/components/rowListScene_20211011144343.brs
deleted file mode 100644
index 635bf9b..0000000
--- a/.history/components/rowListScene_20211011144343.brs
+++ /dev/null
@@ -1,36 +0,0 @@
-sub init()
- m.parent = m.findNode("mainParent")
- ' m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
- ' m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
- store = CreateObject("roSGNode", "ChannelStore")
- ' Request several properties for sign-up
- store.requestedUserData = "email, phone, firstname, lastname"
- store.command = "getUserData"
- ?store.userData.firstName
-end sub
-
-sub libraryLoaded()
- if (m.SampleComponentLib.loadStatus = "ready")
- loadingNode = createObject("roSGNode", "LoadingScreen")
- m.parent.appendChild(loadingNode)
- end if
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144638.brs b/.history/components/rowListScene_20211011144638.brs
deleted file mode 100644
index b42b3ad..0000000
--- a/.history/components/rowListScene_20211011144638.brs
+++ /dev/null
@@ -1,36 +0,0 @@
-sub init()
- m.parent = m.findNode("mainParent")
- m.SampleComponentLib = m.parent.findNode("SampleComponentLib")
- m.SampleComponentLib.observeField("loadStatus", "libraryLoaded")
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
- store = CreateObject("roSGNode", "ChannelStore")
- ' Request several properties for sign-up
- store.requestedUserData = "email, phone, firstname, lastname"
- store.command = "getUserData"
- ?store.userData.firstName
-end sub
-
-sub libraryLoaded()
- if (m.SampleComponentLib.loadStatus = "ready")
- loadingNode = createObject("roSGNode", "LoadingScreen")
- m.parent.appendChild(loadingNode)
- end if
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144659.brs b/.history/components/rowListScene_20211011144659.brs
deleted file mode 100644
index 0b64153..0000000
--- a/.history/components/rowListScene_20211011144659.brs
+++ /dev/null
@@ -1,34 +0,0 @@
-sub init()
- m.parent = m.findNode("mainParent")
- m.MultiStyleLabel.drawingStyles = {
-
- "HandprintedRed": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#FF0000FF"
- }
- "HandprintedGreen": {
- "fontSize": 36
- "fontUri": "pkg:/fonts/vSHandprinted.otf"
- "color": "#00FF00FF"
- }
- "default": {
- "fontSize": 36
- "fontUri": "font:LargeSystemFont"
- "color": "#000000FF"
- }
- }
- m.MultiStyleLabel.text = "Default Text Red text followed bymore text in a funny style thaty the world has never seen before..."
- store = CreateObject("roSGNode", "ChannelStore")
- ' Request several properties for sign-up
- store.requestedUserData = "email, phone, firstname, lastname"
- store.command = "getUserData"
- ?store.userData.firstName
-end sub
-
-sub libraryLoaded()
- if (m.SampleComponentLib.loadStatus = "ready")
- loadingNode = createObject("roSGNode", "LoadingScreen")
- m.parent.appendChild(loadingNode)
- end if
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011144718.brs b/.history/components/rowListScene_20211011144718.brs
deleted file mode 100644
index 10b5815..0000000
--- a/.history/components/rowListScene_20211011144718.brs
+++ /dev/null
@@ -1,14 +0,0 @@
-sub init()
- m.parent = m.findNode("mainParent")
- store = CreateObject("roSGNode", "ChannelStore")
- store.requestedUserData = "email, phone, firstname, lastname"
- store.command = "getUserData"
- ?store.userData.firstName
-end sub
-
-sub libraryLoaded()
- if (m.SampleComponentLib.loadStatus = "ready")
- loadingNode = createObject("roSGNode", "LoadingScreen")
- m.parent.appendChild(loadingNode)
- end if
-end sub
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011151753.xml b/.history/components/rowListScene_20211011151753.xml
deleted file mode 100644
index 220c1a1..0000000
--- a/.history/components/rowListScene_20211011151753.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011151755.xml b/.history/components/rowListScene_20211011151755.xml
deleted file mode 100644
index 220c1a1..0000000
--- a/.history/components/rowListScene_20211011151755.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011151829.brs b/.history/components/rowListScene_20211011151829.brs
deleted file mode 100644
index 5d4ab88..0000000
--- a/.history/components/rowListScene_20211011151829.brs
+++ /dev/null
@@ -1,8 +0,0 @@
-sub init()
- m.parent = m.findNode("mainParent")
- store = CreateObject("roSGNode", "ChannelStore")
- store.requestedUserData = "email, phone, firstname, lastname"
- store.command = "getUserData"
- ?store.userData.firstName
-end sub
-
diff --git a/.history/components/rowListScene_20211011151922.xml b/.history/components/rowListScene_20211011151922.xml
deleted file mode 100644
index 92419da..0000000
--- a/.history/components/rowListScene_20211011151922.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011152047.xml b/.history/components/rowListScene_20211011152047.xml
deleted file mode 100644
index 57e58b4..0000000
--- a/.history/components/rowListScene_20211011152047.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011152054.xml b/.history/components/rowListScene_20211011152054.xml
deleted file mode 100644
index 5c1d28d..0000000
--- a/.history/components/rowListScene_20211011152054.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011152249.xml b/.history/components/rowListScene_20211011152249.xml
deleted file mode 100644
index 6b36ffd..0000000
--- a/.history/components/rowListScene_20211011152249.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011152637.xml b/.history/components/rowListScene_20211011152637.xml
deleted file mode 100644
index df51351..0000000
--- a/.history/components/rowListScene_20211011152637.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011152704.xml b/.history/components/rowListScene_20211011152704.xml
deleted file mode 100644
index 5ac204f..0000000
--- a/.history/components/rowListScene_20211011152704.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011152741.brs b/.history/components/rowListScene_20211011152741.brs
deleted file mode 100644
index 5d4ab88..0000000
--- a/.history/components/rowListScene_20211011152741.brs
+++ /dev/null
@@ -1,8 +0,0 @@
-sub init()
- m.parent = m.findNode("mainParent")
- store = CreateObject("roSGNode", "ChannelStore")
- store.requestedUserData = "email, phone, firstname, lastname"
- store.command = "getUserData"
- ?store.userData.firstName
-end sub
-
diff --git a/.history/components/rowListScene_20211011152745.brs b/.history/components/rowListScene_20211011152745.brs
deleted file mode 100644
index cfb30e7..0000000
--- a/.history/components/rowListScene_20211011152745.brs
+++ /dev/null
@@ -1,8 +0,0 @@
-sub init()
- m.parent = m.top.findNode("mainParent")
- store = CreateObject("roSGNode", "ChannelStore")
- store.requestedUserData = "email, phone, firstname, lastname"
- store.command = "getUserData"
- ?store.userData.firstName
-end sub
-
diff --git a/.history/components/rowListScene_20211011152820.brs b/.history/components/rowListScene_20211011152820.brs
deleted file mode 100644
index 9c16237..0000000
--- a/.history/components/rowListScene_20211011152820.brs
+++ /dev/null
@@ -1,7 +0,0 @@
-sub init()
- m.parent = m.top.findNode("mainParent")
- store = CreateObject("roSGNode", "ChannelStore")
- store.requestedUserData = "email, phone, firstname, lastname"
- store.command = "getUserData"
-end sub
-
diff --git a/.history/components/rowListScene_20211011154834.xml b/.history/components/rowListScene_20211011154834.xml
deleted file mode 100644
index b33916d..0000000
--- a/.history/components/rowListScene_20211011154834.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011154858.xml b/.history/components/rowListScene_20211011154858.xml
deleted file mode 100644
index 81faa1e..0000000
--- a/.history/components/rowListScene_20211011154858.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011160212.xml b/.history/components/rowListScene_20211011160212.xml
deleted file mode 100644
index 83524bf..0000000
--- a/.history/components/rowListScene_20211011160212.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011160214.xml b/.history/components/rowListScene_20211011160214.xml
deleted file mode 100644
index 81faa1e..0000000
--- a/.history/components/rowListScene_20211011160214.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011160217.xml b/.history/components/rowListScene_20211011160217.xml
deleted file mode 100644
index 81faa1e..0000000
--- a/.history/components/rowListScene_20211011160217.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011160729.xml b/.history/components/rowListScene_20211011160729.xml
deleted file mode 100644
index 81faa1e..0000000
--- a/.history/components/rowListScene_20211011160729.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011160824.xml b/.history/components/rowListScene_20211011160824.xml
deleted file mode 100644
index 496e85b..0000000
--- a/.history/components/rowListScene_20211011160824.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161430.xml b/.history/components/rowListScene_20211011161430.xml
deleted file mode 100644
index 68e9101..0000000
--- a/.history/components/rowListScene_20211011161430.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161441.brs b/.history/components/rowListScene_20211011161441.brs
deleted file mode 100644
index 3e621a4..0000000
--- a/.history/components/rowListScene_20211011161441.brs
+++ /dev/null
@@ -1,5 +0,0 @@
-sub init()
- m.parent = m.top.findNode("mainParent")
-
-end sub
-
diff --git a/.history/components/rowListScene_20211011161505.xml b/.history/components/rowListScene_20211011161505.xml
deleted file mode 100644
index c3c00f4..0000000
--- a/.history/components/rowListScene_20211011161505.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161514.xml b/.history/components/rowListScene_20211011161514.xml
deleted file mode 100644
index 9fc012f..0000000
--- a/.history/components/rowListScene_20211011161514.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161556.xml b/.history/components/rowListScene_20211011161556.xml
deleted file mode 100644
index c3c00f4..0000000
--- a/.history/components/rowListScene_20211011161556.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161820.brs b/.history/components/rowListScene_20211011161820.brs
deleted file mode 100644
index 3e621a4..0000000
--- a/.history/components/rowListScene_20211011161820.brs
+++ /dev/null
@@ -1,5 +0,0 @@
-sub init()
- m.parent = m.top.findNode("mainParent")
-
-end sub
-
diff --git a/.history/components/rowListScene_20211011161851.xml b/.history/components/rowListScene_20211011161851.xml
deleted file mode 100644
index 0589501..0000000
--- a/.history/components/rowListScene_20211011161851.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161853.xml b/.history/components/rowListScene_20211011161853.xml
deleted file mode 100644
index 76eba79..0000000
--- a/.history/components/rowListScene_20211011161853.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161900.xml b/.history/components/rowListScene_20211011161900.xml
deleted file mode 100644
index ffd6080..0000000
--- a/.history/components/rowListScene_20211011161900.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161906.xml b/.history/components/rowListScene_20211011161906.xml
deleted file mode 100644
index def8674..0000000
--- a/.history/components/rowListScene_20211011161906.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011161926.xml b/.history/components/rowListScene_20211011161926.xml
deleted file mode 100644
index b263adc..0000000
--- a/.history/components/rowListScene_20211011161926.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011163824.xml b/.history/components/rowListScene_20211011163824.xml
deleted file mode 100644
index f39fe0c..0000000
--- a/.history/components/rowListScene_20211011163824.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011163856.xml b/.history/components/rowListScene_20211011163856.xml
deleted file mode 100644
index ed5fc50..0000000
--- a/.history/components/rowListScene_20211011163856.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011163858.xml b/.history/components/rowListScene_20211011163858.xml
deleted file mode 100644
index 0a43fbf..0000000
--- a/.history/components/rowListScene_20211011163858.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011163948.xml b/.history/components/rowListScene_20211011163948.xml
deleted file mode 100644
index 0a43fbf..0000000
--- a/.history/components/rowListScene_20211011163948.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211011163950.xml b/.history/components/rowListScene_20211011163950.xml
deleted file mode 100644
index 8d8fce4..0000000
--- a/.history/components/rowListScene_20211011163950.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030439.xml b/.history/components/rowListScene_20211012030439.xml
deleted file mode 100644
index 6a0c426..0000000
--- a/.history/components/rowListScene_20211012030439.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030442.xml b/.history/components/rowListScene_20211012030442.xml
deleted file mode 100644
index d824ea1..0000000
--- a/.history/components/rowListScene_20211012030442.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030443.xml b/.history/components/rowListScene_20211012030443.xml
deleted file mode 100644
index 6a0c426..0000000
--- a/.history/components/rowListScene_20211012030443.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030617.xml b/.history/components/rowListScene_20211012030617.xml
deleted file mode 100644
index 4385cd5..0000000
--- a/.history/components/rowListScene_20211012030617.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030618.xml b/.history/components/rowListScene_20211012030618.xml
deleted file mode 100644
index 4385cd5..0000000
--- a/.history/components/rowListScene_20211012030618.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030641.xml b/.history/components/rowListScene_20211012030641.xml
deleted file mode 100644
index 699d1fa..0000000
--- a/.history/components/rowListScene_20211012030641.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030736.xml b/.history/components/rowListScene_20211012030736.xml
deleted file mode 100644
index 86a6e2f..0000000
--- a/.history/components/rowListScene_20211012030736.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030753.xml b/.history/components/rowListScene_20211012030753.xml
deleted file mode 100644
index 1b7fed2..0000000
--- a/.history/components/rowListScene_20211012030753.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012030805.brs b/.history/components/rowListScene_20211012030805.brs
deleted file mode 100644
index 6705e78..0000000
--- a/.history/components/rowListScene_20211012030805.brs
+++ /dev/null
@@ -1,5 +0,0 @@
-sub init()
- m.parent = m.top.findNode("mainParent")
- m.panel = m.top.findNode("mainPanel")
-end sub
-
diff --git a/.history/components/rowListScene_20211012030811.brs b/.history/components/rowListScene_20211012030811.brs
deleted file mode 100644
index 222d149..0000000
--- a/.history/components/rowListScene_20211012030811.brs
+++ /dev/null
@@ -1,6 +0,0 @@
-sub init()
- m.parent = m.top.findNode("mainParent")
- m.panel = m.top.findNode("mainPanel")
- m.panel.setFocus(true)
-end sub
-
diff --git a/.history/components/rowListScene_20211012031004.xml b/.history/components/rowListScene_20211012031004.xml
deleted file mode 100644
index d64b778..0000000
--- a/.history/components/rowListScene_20211012031004.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012031006.xml b/.history/components/rowListScene_20211012031006.xml
deleted file mode 100644
index d4c0078..0000000
--- a/.history/components/rowListScene_20211012031006.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012031011.xml b/.history/components/rowListScene_20211012031011.xml
deleted file mode 100644
index ba5b065..0000000
--- a/.history/components/rowListScene_20211012031011.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012031223.brs b/.history/components/rowListScene_20211012031223.brs
deleted file mode 100644
index 8b4f6d8..0000000
--- a/.history/components/rowListScene_20211012031223.brs
+++ /dev/null
@@ -1,4 +0,0 @@
-sub init()
- m.parent = m.top.findNode("mainParent")
-end sub
-
diff --git a/.history/components/rowListScene_20211012031226.brs b/.history/components/rowListScene_20211012031226.brs
deleted file mode 100644
index 5824ab1..0000000
--- a/.history/components/rowListScene_20211012031226.brs
+++ /dev/null
@@ -1,5 +0,0 @@
-sub init()
- m.parent = m.top.findNode("mainParent")
- end su
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012031230.brs b/.history/components/rowListScene_20211012031230.brs
deleted file mode 100644
index 5824ab1..0000000
--- a/.history/components/rowListScene_20211012031230.brs
+++ /dev/null
@@ -1,5 +0,0 @@
-sub init()
- m.parent = m.top.findNode("mainParent")
- end su
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012031231.brs b/.history/components/rowListScene_20211012031231.brs
deleted file mode 100644
index 8b4f6d8..0000000
--- a/.history/components/rowListScene_20211012031231.brs
+++ /dev/null
@@ -1,4 +0,0 @@
-sub init()
- m.parent = m.top.findNode("mainParent")
-end sub
-
diff --git a/.history/components/rowListScene_20211012031235.brs b/.history/components/rowListScene_20211012031235.brs
deleted file mode 100644
index 8b4f6d8..0000000
--- a/.history/components/rowListScene_20211012031235.brs
+++ /dev/null
@@ -1,4 +0,0 @@
-sub init()
- m.parent = m.top.findNode("mainParent")
-end sub
-
diff --git a/.history/components/rowListScene_20211012031408.xml b/.history/components/rowListScene_20211012031408.xml
deleted file mode 100644
index 81da3d0..0000000
--- a/.history/components/rowListScene_20211012031408.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012032157.xml b/.history/components/rowListScene_20211012032157.xml
deleted file mode 100644
index 6f44653..0000000
--- a/.history/components/rowListScene_20211012032157.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012122112.xml b/.history/components/rowListScene_20211012122112.xml
deleted file mode 100644
index 25a90c1..0000000
--- a/.history/components/rowListScene_20211012122112.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012122632.xml b/.history/components/rowListScene_20211012122632.xml
deleted file mode 100644
index 9001369..0000000
--- a/.history/components/rowListScene_20211012122632.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012122658.xml b/.history/components/rowListScene_20211012122658.xml
deleted file mode 100644
index 2e35df3..0000000
--- a/.history/components/rowListScene_20211012122658.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012122713.xml b/.history/components/rowListScene_20211012122713.xml
deleted file mode 100644
index 54a1aaf..0000000
--- a/.history/components/rowListScene_20211012122713.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211012122732.xml b/.history/components/rowListScene_20211012122732.xml
deleted file mode 100644
index 2d5647c..0000000
--- a/.history/components/rowListScene_20211012122732.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105704.xml b/.history/components/trickplay/trickplay_20211013105704.xml
deleted file mode 100644
index e69de29..0000000
diff --git a/.history/components/trickplay/trickplay_20211013105742.xml b/.history/components/trickplay/trickplay_20211013105742.xml
deleted file mode 100644
index 3891769..0000000
--- a/.history/components/trickplay/trickplay_20211013105742.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105805.xml b/.history/components/trickplay/trickplay_20211013105805.xml
deleted file mode 100644
index 5f27bbc..0000000
--- a/.history/components/trickplay/trickplay_20211013105805.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105810.xml b/.history/components/trickplay/trickplay_20211013105810.xml
deleted file mode 100644
index 1ac4fde..0000000
--- a/.history/components/trickplay/trickplay_20211013105810.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105834.xml b/.history/components/trickplay/trickplay_20211013105834.xml
deleted file mode 100644
index 8d55c64..0000000
--- a/.history/components/trickplay/trickplay_20211013105834.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105854.xml b/.history/components/trickplay/trickplay_20211013105854.xml
deleted file mode 100644
index 38bd81b..0000000
--- a/.history/components/trickplay/trickplay_20211013105854.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105904.xml b/.history/components/trickplay/trickplay_20211013105904.xml
deleted file mode 100644
index 71d624c..0000000
--- a/.history/components/trickplay/trickplay_20211013105904.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105925.xml b/.history/components/trickplay/trickplay_20211013105925.xml
deleted file mode 100644
index 3557c27..0000000
--- a/.history/components/trickplay/trickplay_20211013105925.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105928.xml b/.history/components/trickplay/trickplay_20211013105928.xml
deleted file mode 100644
index 69a80a1..0000000
--- a/.history/components/trickplay/trickplay_20211013105928.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105940.xml b/.history/components/trickplay/trickplay_20211013105940.xml
deleted file mode 100644
index f4fa32c..0000000
--- a/.history/components/trickplay/trickplay_20211013105940.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013105959.xml b/.history/components/trickplay/trickplay_20211013105959.xml
deleted file mode 100644
index afb601d..0000000
--- a/.history/components/trickplay/trickplay_20211013105959.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110019.xml b/.history/components/trickplay/trickplay_20211013110019.xml
deleted file mode 100644
index 37c4db2..0000000
--- a/.history/components/trickplay/trickplay_20211013110019.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110037.xml b/.history/components/trickplay/trickplay_20211013110037.xml
deleted file mode 100644
index 7d639ab..0000000
--- a/.history/components/trickplay/trickplay_20211013110037.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110049.xml b/.history/components/trickplay/trickplay_20211013110049.xml
deleted file mode 100644
index 382cfa6..0000000
--- a/.history/components/trickplay/trickplay_20211013110049.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110104.xml b/.history/components/trickplay/trickplay_20211013110104.xml
deleted file mode 100644
index adcba51..0000000
--- a/.history/components/trickplay/trickplay_20211013110104.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110225.xml b/.history/components/trickplay/trickplay_20211013110225.xml
deleted file mode 100644
index 30f06c1..0000000
--- a/.history/components/trickplay/trickplay_20211013110225.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110317.xml b/.history/components/trickplay/trickplay_20211013110317.xml
deleted file mode 100644
index 8d9236e..0000000
--- a/.history/components/trickplay/trickplay_20211013110317.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110331.xml b/.history/components/trickplay/trickplay_20211013110331.xml
deleted file mode 100644
index f97b4ee..0000000
--- a/.history/components/trickplay/trickplay_20211013110331.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110335.xml b/.history/components/trickplay/trickplay_20211013110335.xml
deleted file mode 100644
index b7264a9..0000000
--- a/.history/components/trickplay/trickplay_20211013110335.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110343.xml b/.history/components/trickplay/trickplay_20211013110343.xml
deleted file mode 100644
index 7415aba..0000000
--- a/.history/components/trickplay/trickplay_20211013110343.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110709.xml b/.history/components/trickplay/trickplay_20211013110709.xml
deleted file mode 100644
index 542e079..0000000
--- a/.history/components/trickplay/trickplay_20211013110709.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110830.xml b/.history/components/trickplay/trickplay_20211013110830.xml
deleted file mode 100644
index 4cdd261..0000000
--- a/.history/components/trickplay/trickplay_20211013110830.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110853.xml b/.history/components/trickplay/trickplay_20211013110853.xml
deleted file mode 100644
index a7bd992..0000000
--- a/.history/components/trickplay/trickplay_20211013110853.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110857.xml b/.history/components/trickplay/trickplay_20211013110857.xml
deleted file mode 100644
index a7bd992..0000000
--- a/.history/components/trickplay/trickplay_20211013110857.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013110936.xml b/.history/components/trickplay/trickplay_20211013110936.xml
deleted file mode 100644
index 2ffb00d..0000000
--- a/.history/components/trickplay/trickplay_20211013110936.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111004.xml b/.history/components/trickplay/trickplay_20211013111004.xml
deleted file mode 100644
index d82a426..0000000
--- a/.history/components/trickplay/trickplay_20211013111004.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111014.xml b/.history/components/trickplay/trickplay_20211013111014.xml
deleted file mode 100644
index 168065e..0000000
--- a/.history/components/trickplay/trickplay_20211013111014.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111030.xml b/.history/components/trickplay/trickplay_20211013111030.xml
deleted file mode 100644
index 0ed0e4d..0000000
--- a/.history/components/trickplay/trickplay_20211013111030.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111143.xml b/.history/components/trickplay/trickplay_20211013111143.xml
deleted file mode 100644
index 509771e..0000000
--- a/.history/components/trickplay/trickplay_20211013111143.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111202.xml b/.history/components/trickplay/trickplay_20211013111202.xml
deleted file mode 100644
index 3b1a34e..0000000
--- a/.history/components/trickplay/trickplay_20211013111202.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111214.xml b/.history/components/trickplay/trickplay_20211013111214.xml
deleted file mode 100644
index 29373b7..0000000
--- a/.history/components/trickplay/trickplay_20211013111214.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111237.xml b/.history/components/trickplay/trickplay_20211013111237.xml
deleted file mode 100644
index b3939d0..0000000
--- a/.history/components/trickplay/trickplay_20211013111237.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111254.xml b/.history/components/trickplay/trickplay_20211013111254.xml
deleted file mode 100644
index d3f6d70..0000000
--- a/.history/components/trickplay/trickplay_20211013111254.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111726.xml b/.history/components/trickplay/trickplay_20211013111726.xml
deleted file mode 100644
index d3f6d70..0000000
--- a/.history/components/trickplay/trickplay_20211013111726.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111834.xml b/.history/components/trickplay/trickplay_20211013111834.xml
deleted file mode 100644
index a7c3ae1..0000000
--- a/.history/components/trickplay/trickplay_20211013111834.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111845.xml b/.history/components/trickplay/trickplay_20211013111845.xml
deleted file mode 100644
index 39e985e..0000000
--- a/.history/components/trickplay/trickplay_20211013111845.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013111942.xml b/.history/components/trickplay/trickplay_20211013111942.xml
deleted file mode 100644
index 6081f94..0000000
--- a/.history/components/trickplay/trickplay_20211013111942.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013112043.xml b/.history/components/trickplay/trickplay_20211013112043.xml
deleted file mode 100644
index 4bd0a4d..0000000
--- a/.history/components/trickplay/trickplay_20211013112043.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013113737.xml b/.history/components/trickplay/trickplay_20211013113737.xml
deleted file mode 100644
index 1f15d3f..0000000
--- a/.history/components/trickplay/trickplay_20211013113737.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013113755.xml b/.history/components/trickplay/trickplay_20211013113755.xml
deleted file mode 100644
index 76c03ae..0000000
--- a/.history/components/trickplay/trickplay_20211013113755.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013113757.xml b/.history/components/trickplay/trickplay_20211013113757.xml
deleted file mode 100644
index 1f15d3f..0000000
--- a/.history/components/trickplay/trickplay_20211013113757.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.history/components/trickplay/trickplay_20211013114712.xml b/.history/components/trickplay/trickplay_20211013114712.xml
deleted file mode 100644
index a1100dc..0000000
--- a/.history/components/trickplay/trickplay_20211013114712.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
deleted file mode 100644
index dca2ab3..0000000
--- a/.vscode/launch.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- // Use IntelliSense to learn about possible attributes.
- // Hover to view descriptions of existing attributes.
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
- "version": "0.2.0",
- "configurations": [
- {
- "type": "brightscript",
- "request": "launch",
- "name": "BrightScript Debug: Launch",
- "stopOnEntry": false,
- "host": "${promptForHost}",
- "password": "mega",
- "rootDir": "${workspaceFolder}",
- "enableDebuggerAutoRecovery": false,
- "stopDebuggerOnAppExit": false
- }
- ]
-}
\ No newline at end of file
diff --git a/components/trickplay/TrickPlay.xml b/components/trickplay/TrickPlay.xml
index c5a431e..c0096e9 100644
--- a/components/trickplay/TrickPlay.xml
+++ b/components/trickplay/TrickPlay.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/images/blackleft.png b/images/blackleft.png
new file mode 100644
index 0000000000000000000000000000000000000000..042691093fc6abeb0d739a8e8cc023a5f269e961
GIT binary patch
literal 1535
zcmWku2~?6<7{yf7BqO(6IxdY);#Sx)SenTZ6U^`+R1V6wWsAdA_;@xMTyI`tWEEhyKm&F7M4R?TJ
zXLkV$1p6^qEY|7zlB6DV`F=VAMW2>z>W$=iGU@FS_4V|PG^or&xa{T5;41eH)FZjgU3My6Ux^Hjnc^@fdj5eZyeYWG1S+6=CB
ztG(t22M6Ictr&a$8VA0hBPH~c5Hs%bm9jVrg_Tv2rVq{}M*_&wnA8%j2+|np|7sZ61)9R!L%&XN6G6HpuemA)0
zGrd0#D(-GI#k|AIt;!u?T{is1!#wqBSAKpz1<6JuR0j6b_SMa0dw{<2CY9%#r6rWg
zYu*mh%53Ovon75v(QfujDF^U3>c!C$^C4B;u5gj+XLK)ZA3;*k(&E{`167P^LqhD^
zChMH|M;pMV5JN;$9johc4LseF>WIh}RAdqL!&Bc6vahaDf>W_bAF-x$WU@!N3vSkJ
zQa#xWvLF4PdJ~xnm6$6}2!|h!fLKq#u%Z2{PZ9|XFL~ID6-96W0u7XPR4~kSDvSm7
z@Iw-=q^z%~G)fZNMmYE#=n5Rd2Q=owGXUJ%wtc>6RHksv0fdeq8Dkyahy;~X*}5Jc
z9dldXNFT
zwi#Ej4aFb?`Cp)TgsRaMV?pLe?DZZv@{}e&q$#?C_YTG7oF`O@9R$O<`)VR0yY~69
zqf9ddW{S1+U9bC^{Nu5JkWfrqtHEB>Lll<1PZ&|JUj~nH#EOjaM`AZdDF+5)%`qkT
zvpVALwWQ=^V>fcxbaljb4lo2-6%?Fs#SPY#Mw`o$XPC$tTOdP}fk}?EgSyG!9>cZV
zfiGA{34@jR#1!wisnrc9`)MPd;WKfQ>J$Snl0D!Mq4_4pXjgZ4_lG9VzoTw}#2k1&
zK5Gq0Es4UW;BoMgQnH{3I{qbXrR~efe8_US7
zPvK(uMiy3J-tANv9`|sBddPyL=*&jhj@6U&Z2B=nb1IZ#&Eou--om0MTt9$)AZX%D*J?fv
zjW`&jpP@6`wOlL9yhF?3+LiW1L6x1q9BmJWsxsTS$jYbAOw_Mwn0v>X1)tnW`o-4xd^IBvse0uyGOV-birA<=Z|ss
zh%apNWP45qcbN@t9S54!E0F9Z#kD)EocwaRwgm>JAEG6Xui>RW*XrW$buKQZ5aTv>
zO~gbRpDxWa46sQjYCVz2t3u*(>oi=29+lbO{QK-Opz6s!FA`Po*W3daXKTcaP5<)9
g!9(4oWwUG`m>hITNQ^<35QL&cLC26w{(!|SX3v6b
zAo#E>CI=@t0pASSth3++;W&EbbnXRba(a0^MSg}R9Ahg
zyI%cx^$MY&_`W~bXf)mlg5Yqg)v5zPEeyk90N4Wn9st;_R*L`th^Pes&j6qS0QV5_
zHUQipq6Nm-SDxoxT3lRwpu0|mrc$Z+LWq-$v3Vl83IJi6iHNQ;#^!|(Co7eTue-j5
zpjdj5Vg6p=p{Y
zo86aF^G~YPs-s))ZP>PbkccjKS}DfZ
zdBZSH3=IvrS(kNaXvj4T;{;>ue5d6lqRX~zAJnZo003B)^&TQVN?Hj-T;ZIbb{t1r
zMI6UD$T>gV$yb4hk1Wf2PgmIi0KhcOp8&vG!hgcAan3(D*cs3BD!N5YisyM1#@HFvdcww+kZpG)jgD$Rxo#N7^z7_x*F#BN
z%zw_#l3^Ir0I;rD=e5iX^T5EsLDkU?B0jV%>s{RfriEo$?;_$u#kxOAeTZ7ERvp!G
zJ|bSXZTpaJ(bC4Y?L&xoT}1;Tx?HJL(wnTQ&TtX&s^d6gy2Z*0$8p9GQE9hMYSulb
zX`WDdAR=Bbl}cl}Mar5|sWhhgB}nbMdVko6O23bY4|ig>(+=4k#o7c!eALw{s^XIJ
z`c5*qs>nLWj*g^;9X;T9T;>1}%3<0YiL869Mu|6dMn^{tm7Ofc*qL4)=XcBO>@2BF
z)`;lJ=;)~W_NEXbwq+6VRxi$Q)5i0>ipsKu)HEL7_idF8^j=!q$r_dJ8WHa(d4F37
zA!gz-lPiXOwxF_#Dz$A-yAxo_}VhhWb6T+AQCoHo#--k!qS2dPn9
zH$L~uALCrar5i^c#LX-N&iUyg+lM%p7pe6N_0BoE_jH{UIx_NH4bkhLa
z?1Rn&7E-gwa{9hM2$p5N578}kKMgPCJR4w3*|ph+$;n9~qWe+hvn=cV*u}TDGq)aS
zfUR}VVISgF7C7fKBo9Hi1%DC0%)8)e69mBrPoF;hBJcS_oOWRt)(HS=F_|pnRp5-_
z&1Q3IX=&+7UiLvjyBZMD=MdLV