hawksley / eleVR-Web-Player

A Web Player for 360 Video on the Oculus
Mozilla Public License 2.0
682 stars 195 forks source link

conditionally hide controls #22

Closed cvan closed 9 years ago

cvan commented 9 years ago

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:

eleVRWebPlayer({
  controls: false
});

here is a list of the items addressed in this PR:

to test how this would work from an iframe, drop this into a file like iframe.html in the root directory:

<iframe src="/?controls=false&amp;autoplay=1&amp;video=http://cdn2.vrideo.com/prod_videos/v1/mYNVcD6_480p_full.mp4" style="border: 0; position: absolute; left: 0; top: 0; height: 100%; width: 100%" allowfullscreen></iframe>

and to test muting, open the JS Console and run this command:

window.postMessage({autoplay: true, mute: true}, '*')

and to unmute:

window.postMessage({autoplay: true, unmute: true}, '*')

feedback very welcome. thanks! :smiley_cat:

cvan commented 9 years ago

updated patch to remove all conditional logic and just always call function to set up query selectors.

cvan commented 9 years ago

will update now that #20 has been merged

cvan commented 9 years ago

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.

hawksley commented 9 years ago

Yay! Thanks for updating the readme as well. :)