The PowerPac fixes various mouse, click, down, up, move, focus, and selection events on nearly every exported object.
The result in all ToolBook versions is very good. However, there are some pesky bugs in v8.9 and v9.01 that while sort of resolved, they still surface. One area where this happens is when embedding video into an element. ToolBook v9.01 will not always allow click events to target the expected objects and then it doesn't always properly cancel the bubbling events. This is probably why you have some difficulty clicking on the play button in your YouTube video, etc. If you were using the
rangeSlider feature of the
htmlVideoControl(), you would notice buggy behavior in ToolBook v9.01 as well when dragging the start and end points of the slider. You would notice that the mouse would not release the object when you stop dragging. Most of the time ToolBook v9.01 works fine, but you are clearly entering an area of development where this behavior may be problematic. You cannot just remove the ToolBook native behavior, because that causes a host of other event-related issues; so the PowerPac modifies this behavior so that it works most of the time, but there are exceptions with ToolBook v9.01.
In your case, XML provides a near perfect workaround. Just use a
<make> element to contain your videos.
<make> elements will not be affected by internal ToolBook methods unless you expressly install them, which you wouldn't want to.
Here is how to do this:- Rename your "screen" object to "screenAnchor". It is only used by the XML engine to set the bounds of the <make> element.
- Create a <make> element in your XML for the the page like this.
<make id="screen" type="div" level="1" dims="screenAnchor" class="" refObj="screenAnchor" autoAlign="" replace="">
<function name="myUser" event="user" params="e">
<![CDATA[
var valueDetail = tbfunction_pgSplitToArray(e.myValue, ",", true); //e.myValue or e.data both return the ToolBook user [value] param
tbfunction_pgTBObjSet("result", "text", valueDetail[2]);
]]>
</function>
</make>
- Move all of your functions to the <make> element and adjust the way they work because the system will not send the parameters in the same way as with native ToolBook objects. I've modified the [user] event function accordingly as shown in the code above. To target this element, you would use the id "screen" just like before. In this case when the XML engine creates this element, it will give the object the name "screen" and the id "screen". This is fully HTML5 compatible.
I actually finished a project where the video player was top level 0 and auto aligned over a ToolBook object on the page. This enabled me to do other things that were necessary outside the ToolBook page frame while at the same time have access to both namespaces via the Powerpac.
I think this solution is worth a try for your project. In your case you just need to create the
<make> object in level 1 as shown in my code and that should be sufficient. I tried this using your
myVideo.tbk when trying to fix the
playBetween issues.
UPDATE:BTW: Just hide or original object now called
"screenAnchor" so it doesn't get in the way of anything. It is only used to set the bounds of the
<make> object.