Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this is dependent on the foundational work in PR #20 for allowing overrides via URL. I'd recommend reviewing and merging that one first. 😃
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 add ability to load external video URLs (via querystring, hash, postMessage) #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! 😺