How to force HTML5 library to re-parse the page looking for object tags to replace with HTML5 tag for mobile devices

11 replies [Last post]
Joined: 08/31/2012
Points: 16

I have an AJAX site that I need to get working on mobile devices. I include the following script in the head, but that only parses the page on page load; if I add an object tag to the DOM via AJAX at an arbitrary time that object tag doesn't get replaced with the HTML5 player.
http://www.kaltura.com/p/269692/sp/26969200/embedIframeJs/uiconf_id/4112542/partner_id/269692
I've tried to read the contents of the above URL looking for the trigger I can call manually but I didn't see anything jump out at me as "call this to re-parse the DOM."

Q: How can I cause the Kaltura.com library to re-parse the page after I draw in my video so it can replace the object tag with the HTML5 video tag?

A simple stand-alone example page is here:
http://72.3.209.148/wade/devel/ajax-video-fall-forward-test.html

Thank you for taking the time to look at my question!

Joined: 02/22/2009
Points: 76
Joined: 08/31/2012
Points: 16

What if I need the flash-mode object tag to have the param wmode="opaque" when using the kWidget.embed call. Is there a params object I can insert somewhere in the instantiation?

edit: I experimented and it appears that if you add in 'params' : { 'wmode' : 'opaque' } into the settings you pass kWidget.embed it shows up as a param within the object tag. Answered my own question and hopefully other people's question as well.

Joined: 02/22/2009
Points: 76

yep.. you can add any known flash param that way :) thanks for updating the thread

Joined: 08/31/2012
Points: 16

Hi again Michael,

So it looks like the javascript draws in the flash player just fine using kWidget.embed, but on iOS the HTML5 player doesn't draw in for me. Could you please tell me what I am doing wrong, perhaps using my test page?

http://72.3.209.148/wade/devel/ajax-video-fall-forward-test.html
or
http://goo.gl/J9857 (easier to type into an ipad)

Thank you so much!

Joined: 02/22/2009
Points: 76

I am getting a syntax error on that page . "Uncaught SyntaxError: Unexpected token < " When using desktop chrome.

Joined: 08/31/2012
Points: 16

Sorry about that. I wasn't seeing that in Firefox.
I've cleaned up that bit of code but still no HTML5 video for me on iOS.

Edit: Actually, I am wrong. It's working for me now in my iPhone. It looks like it was just that syntax error that was causing the problem. Sorry for the pestering, and thank you for all the help in getting this working!

Joined: 08/08/2014
Points: 76

What if I need the flash-mode object tag to have the param wmode="opaque" when using the kWidget.embed call. Is there a params object I can insert somewhere in the instantiation?
http://etnisjawa.blogspot.com/2014/07/gudang-situs-online-terbaik-terper...
http://etnisjawa.blogspot.com/2014/07/agen-texas-dan-domino-online-indon...
http://rosie.besaba.com/pokrstar88/
http://rosie.besaba.com/cipto-junaedy-dan-karyanya/
http://kdrcyber.com/cipto-junaedy/

Joined: 08/31/2012
Points: 16

Wow, that's almost exactly what I was looking for - thank you! I can make that work with some re-writing of my site.

For future readers, this isn't a re-crawl of the page DOM, but is instead a better way of drawing the player into the page initially.

Thanks again Michael!

Joined: 02/11/2014
Points: 10

It is good that you find the solution, it is the best in my opinion!
http://www.yachtbooker.de/bavaria/Yachtcharter-bavaria-cruiser-45-4cab.h...

Joined: 02/26/2014
Points: 6

I will force it like you said and I will be back with reviews! Great job!
http://www.rechtsanwalt-tipps.de/rechtsanwalt-duisburg

Joined: 09/11/2014
Points: 3

Hey! I love your blog post. Its a very relevant and important topic. Free Cell Phones for Seniors