Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JS] Media element support #1864

Merged
merged 3 commits into from Sep 7, 2018
Merged

[JS] Media element support #1864

merged 3 commits into from Sep 7, 2018

Conversation

dclaux
Copy link
Member

@dclaux dclaux commented Sep 6, 2018

This PR implements #196 and #1361

Notes:

  • HostConfig.playButton isn't supported: a better experience is achieved with native styling via CSS
  • HostConfig.maxMediaSize isn't supported: as far as I can tell, there is no way to retrieve the size of the actual stream for several reasons:
    • I can't know which stream from the sources will be picked by the Media control (since it depends on the codecs installed on the machine)
    • Determining the size of the stream would require making a HEAD request on the stream's URL which would generate a cross-domain error anyway

Here is what things look like in Chrome (note that all browsers have their own UI for controls).
image

Notes:

  • The default Play button is somewhat customizable in CSS and is designed to mimic Chrome's media player button, which provides for a smooth transition between the poster and the actual player.
  • When the is no poster, the background is also customizable in CSS.

Once video is playing (controls disappear once mouse is idle or moves out of the player's box):
image

Audio player works just the same. Here is what it looks like while playing in Chrome:
image

When inline playback isn't allowed, the host application can handle the static Media.onPlay event.

@matthidinger matthidinger mentioned this pull request Sep 6, 2018
14 tasks
@andrewleader
Copy link
Contributor

andrewleader commented Sep 7, 2018

Great screenshots, thanks David! It looks quite great! :)

@matthidinger I kinda agree that it's okay the HostConfig playButton isn't supported... if hosts are customizing, they probably would want to use CSS rather than an image which doesn't scale well.

@RebeccaAnne on UWP were you able to implement the HostConfig maxMediaSize? I'm curious if anyone was able to implement that. If not, it should just be removed.

@matthidinger
Copy link
Member

Looks good, thanks David!

@dclaux dclaux merged commit 7d1fa83 into master Sep 7, 2018
@tuanh118
Copy link
Contributor

tuanh118 commented Sep 7, 2018

I think for an audio with poster, it should display the static poster image while the audio is playing.

@dclaux
Copy link
Member Author

dclaux commented Sep 7, 2018

If that's what we want then I'd say that playback controls should always appear below the poster for Audio, with no default play button overlay. The <audio> tag can be made to only load metadata or no data at all until the play button is pressed.

@dclaux dclaux deleted the html-media branch October 8, 2018 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants