Does headless change the behavior of video loading?

965 views
Skip to first unread message

Samuel Yang

unread,
Oct 10, 2016, 4:15:36 AM10/10/16
to headless-dev

Hi, 

I am trying to load video web page using headless shell, but I found the I have big chance to fail to get the video tag src by executing js (document.querySelector('video').src).  

Did headless implementation change any thing about the video elements? 

Thanks. 


Samuel Yang

unread,
Oct 10, 2016, 4:18:21 AM10/10/16
to headless-dev

btw, one more info, most of the video src are set by javascript execution in webpage.   And I run  (document.querySelector('video').src) in page ready state. 


在 2016年10月10日星期一 UTC+8下午4:15:36,Samuel Yang写道:

Sami Kyostila

unread,
Oct 10, 2016, 8:42:39 PM10/10/16
to Samuel Yang, headless-dev
Generally video in headless should work the same as in regular Chrome. One difference is that your headless shell build might not include all the same video codecs. Perhaps the codec for the video you're testing is missing?

- Sami

--

You received this message because you are subscribed to the Google Groups "headless-dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.

To post to this group, send email to headle...@chromium.org.

To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/f75d87b2-0fcc-428d-973f-b2eeaeafda0e%40chromium.org.

Samuel Yang

unread,
Oct 10, 2016, 9:19:54 PM10/10/16
to headless-dev, yangxi...@gmail.com

Thank you Sami.

By the snapshot, I found the video src is missed was caused by the AD was not clicked. 

In my desktop browser(Chrome and firefox), I saw the AD when the first time I visited, but after that, once I have visited before, the AD was no longer popping up.  My guess is cookie related, do I need to open some flag to enable the cookie functionality?  

One more question here  which is not related to this topic, how to use the virtual time switches, (I mean which time is the best  choice), I failed to find any description about the virtual time usage. 

Appreciated your help.  


在 2016年10月11日星期二 UTC+8上午8:42:39,Sami写道:

Sami Kyostila

unread,
Oct 10, 2016, 10:34:02 PM10/10/16
to Samuel Yang, headless-dev
ti 11. lokakuuta 2016 klo 10.19 Samuel Yang <yangxi...@gmail.com> kirjoitti:

Thank you Sami.

By the snapshot, I found the video src is missed was caused by the AD was not clicked. 

In my desktop browser(Chrome and firefox), I saw the AD when the first time I visited, but after that, once I have visited before, the AD was no longer popping up.  My guess is cookie related, do I need to open some flag to enable the cookie functionality?  

Cookies are enabled by default in headless shell, but they don't persist across sessions because the profile is not written to disk. Maybe the server or the page is just randomly selecting a different ad each time?

One more question here  which is not related to this topic, how to use the virtual time switches, (I mean which time is the best  choice), I failed to find any description about the virtual time usage. 


Sorry it's a bit hard to find -- we'll try to improve that. Enabling the use of virtual time should help make your page loads more deterministic, although there are still many other sources of nondeterminism.
 
- Sami


Appreciated your help.  


在 2016年10月11日星期二 UTC+8上午8:42:39,Sami写道:
Generally video in headless should work the same as in regular Chrome. One difference is that your headless shell build might not include all the same video codecs. Perhaps the codec for the video you're testing is missing?

- Sami

ma 10. lokakuuta 2016 klo 17.18 Samuel Yang <yangxi...@gmail.com> kirjoitti:

btw, one more info, most of the video src are set by javascript execution in webpage.   And I run  (document.querySelector('video').src) in page ready state. 


在 2016年10月10日星期一 UTC+8下午4:15:36,Samuel Yang写道:

Hi, 

I am trying to load video web page using headless shell, but I found the I have big chance to fail to get the video tag src by executing js (document.querySelector('video').src).  

Did headless implementation change any thing about the video elements? 

Thanks. 






--

You received this message because you are subscribed to the Google Groups "headless-dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.

To post to this group, send email to headle...@chromium.org.




--

You received this message because you are subscribed to the Google Groups "headless-dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.

To post to this group, send email to headle...@chromium.org.

Samuel Yang

unread,
Oct 10, 2016, 11:26:37 PM10/10/16
to headless-dev, yangxi...@gmail.com

Thank you. 

What does the  'session'  mean here?  does it mean  different browser contexts?    Will the profile persisted if I set user-data-dir when I run headless shell?  

I have read the link about the virtual time, it looks time it is enabled by default, all I need to do is to set virtual budget?  



在 2016年10月11日星期二 UTC+8上午10:34:02,Sami Kyostila写道:

Sami Kyostila

unread,
Oct 10, 2016, 11:36:29 PM10/10/16
to Samuel Yang, headless-dev
ti 11. lokakuuta 2016 klo 12.26 Samuel Yang <yangxi...@gmail.com> kirjoitti:

Thank you. 

What does the  'session'  mean here?  does it mean  different browser contexts?    Will the profile persisted if I set user-data-dir when I run headless shell?  

Yes, each browser context has a separate profile. We don't currently support saving the profile to disk but could add an option to do so if necessary. 

I have read the link about the virtual time, it looks time it is enabled by default, all I need to do is to set virtual budget?  

Right, for headless shell you'll at least need to set the budget with --virtual-time-budget. You may also want to try --deterministic-fetch to eliminate variance from network response ordering.

- Sami

Reply all
Reply to author
Forward
0 new messages