0

从源码来看rc_11(11.80927),确实有Application::SetStartLink设置起始URL的接口,但是这个参数根本没用过,在一些特殊情况下,从preloading状态切换到kStateStarted时没有办法改变url(例如添加拨号的url配对参数):

    //there doesn't use the link param(url) in StartApplication in cobalt/browser/main.cc
    void StartApplication(int /*argc*/, char** /*argv*/, const char* /*link*/,
                          const base::Closure& quit_closure) {
      if (!g_application) {
        g_application = new cobalt::browser::Application(quit_closure,
                                                         false /*should_preload*/);
        DCHECK(g_application);
      } else {
        g_application->Start(); -->does NOT use the url param
      }
    }
4

2 回答 2

0

URL 和初始深层链接只能在预加载时设置。这是因为预加载本质上类似于正常加载,因此更改 URL 将使已完成的加载无效,并且需要加载新的 URL。更改初始深层链接也会使初始深层链接不会更改的假设无效。

加载后,您可以随时调度 kSbEventTypeLink。这不会更改 URL,但会向正在运行的 HTML 应用程序发送消息,而不会导致重新加载。

于 2017-08-07T13:39:50.163 回答
0
Yes, the additionalDataUrl can be fixed before preload time.
But we need add pairingCode when DIAL cast from DIAL client. 
1> User cast a video from YouTube mobile client.
1> YouTube client will send a POST method to Launch Cobalt through DIALserver with pairingCode. ex. pairingCode=08f5b46d-f027-4ce5-82dc-aae8d7ff97ea&theme=cl
2> We should add the pairingCode as param in URL.
3> TV YouTube based on Cobalt will auto playback the cast video.
It also used to WOL/WOW cases.
So, we can add pairingCode without preload function but for preload mode. How can we handle this case? Is there new way to do it for Cobalt preload function?
于 2017-08-08T01:35:09.450 回答