Closed cvan closed 9 years ago
updated patch to remove all conditional logic and just always call function to set up query selectors.
will update now that #20 has been merged
ready for re-review for this now that #20, #24, #25 are merged - and I just opened #26 to split unrelated things out of this PR.
also added sample usage to README
.
Yay! Thanks for updating the readme as well. :)
this is dependent on the foundational work in PR #20 for allowing overrides via URL. I'd recommend reviewing and merging that one first. :smiley:
though issue #15 requests to "have properties we can set via JS," I think allowing these overrides from a URL is a good first step.
once there is a standalone bundle that's generated (see issue #21), I can see how it might be useful to initialise the player without the video controls via like so:
here is a list of the items addressed in this PR:
#forkongithub
inindex.html
andcss/forkme.css
stylesheet (was interfering with the height of the#video-container
when the#video-controls
were hidden)#video-container
) and event listeners (controls.create()
) from getting initialised if controls are to be hidden on page load (e.g., by passing?controls=false
or#{"controls": false}
)if
statements incontrols.js
does add some cruft. could just simply hide the controls using CSS, but thought this would be a better approach - to just not expose the global references if they don't get rendered (though if the hash changes or apostMessage
message is received that says to disable the controls, the global references are set and everything just works)postMessage
would setwindow.location.hash
but would leavewindow.location.search
, thereby confusing which settings to read from (could uplift change to PR #20)test case
to test how this would work from an iframe, drop this into a file like
iframe.html
in the root directory:and to test muting, open the JS Console and run this command:
and to unmute:
feedback very welcome. thanks! :smiley_cat: