1

in Youtube of QT version, it support suspend function for pre-launch Youtube.
pre-launch mean we will launch cobalt in the background before user launch it, so it can't display anything.

did cobalt have some function for pre-launch it?
if yes, could you help us to enable it?

1 Answers1

0

In order to suspend Cobalt, dispatch kSbEventTypeSuspend event. Note that you can only dispatch suspend event in a certain state, namely the sequence of events should be kSbEventTypeStart -> kSbEventTypePause -> kSbEventTypeSuspend. See https://cobalt.googlesource.com/cobalt/+/master/src/starboard/shared/starboard/application.cc#105

mmotorny
  • 320
  • 1
  • 7
  • thanks for your help, suspend can work.
    currently our problem is UI.
    when we want to launch cobalt in the background, cobalt display it's initialize UI(loading), it's our big problem on our Youtube TV.

    we have two problem now.
    first, no initialize UI.
    second, which time can we send suspend signal to cobalt.
    – user7160805 Dec 08 '16 at 05:55
  • Do you need Cobalt to create a hidden window on startup and remain hidden until the app is explicitly launched by user? – mmotorny Dec 09 '16 at 22:30
  • yes, could you help us to create a hidden window on startup? – user7160805 Dec 19 '16 at 06:30
  • Preloading will probably require a more sophisticated solution than what exists in Cobalt today for Suspend. You might be able to handle this purely from underneath Starboard, but it won't be trivial. You could start the window hidden, Suspend when `SbSystemHideSplashScreen` is called, and then Resume when the app is launched, and make sure to show the window when Resuming. – David Ghandehari Dec 19 '16 at 23:07
  • Note I have not actually tried the above, so it may not work as advertised. `SbSystemHideSplashScreen` might be earlier than you want, as it is called after the first frame draw. – David Ghandehari Dec 19 '16 at 23:25