In my Google Chrome extension content script I have the following:
jQuery(document).ready(function() { var player = document.getElementById(\'player\');
Turns out the problem was with timing. Even though it was inside a jQuery(document).ready(), the getElementById failed because the embed wasn't loaded yet. When I do a setTimeout of a few seconds, the getElementById works.