Introduction and a comment on the Demo

Hi all,

 

I am Soonbo Han from LG Electronics. My colleague Hyojin Song and I have
recently joined this CG and have interests in use cases of second screens
and its related web technologies.

 

I have tried out the example on the draft of Presentation API [1] using the
JavaScript shim [2] and found out that it did not work. After looking into
the code, I guess that the shim needs to be modified a bit. 

 

In the example code working with the shim, the opener window (or
controller.html) uses the postMessage() method at the opened window (or
player.html) that is not loaded yet, i.e., not ready for handling messages.

 

My suggestion is to make the resolve() function to be executed later by the
onload event handler as below.

 

presentationWindow.onload = function() {

resolve(presentationWindow);
}

 

This would guarantee the execution of the postMessage() method as intended.
I think this is somewhat relevant to the description of the promise that is
returned by the requestShow() method. From [3]:

 

Promise that is fulfilled when the request was successful, rejected if it
failed.

 

I understand that 'the request was successful' means the available display
(or second screen) is ready to communicate with. So, I think the shim should
be modified in order to work properly.

 

Let me know if I am wrong or have missed something.

 

 

Regards,

Soonbo Han

 

[1] http://webscreens.github.io/presentation-api/#example

[2]
http://webscreens.github.io/presentation-api/demo/js/presentation_api_shim.j
s

[3] http://webscreens.github.io/presentation-api/#presentation-interface

Received on Friday, 28 February 2014 06:40:50 UTC