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

Add getVideoPlaybackQuality API #4286

Merged
merged 5 commits into from May 9, 2017

Conversation

gesinger
Copy link
Contributor

Description

NOTE: This requires videojs/video-js-swf#225

Provides a tech getter for getVideoPlaybackQuality as specified by the W3C's Media Playback Quality API: https://wicg.github.io/media-playback-quality/

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
  • Reviewed by Two Core Contributors

Copy link
Member

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also make an "@abstract" method in tech.js that returns an empty object or something.

src/js/player.js Outdated
* is no tech or the tech does not support it.
*/
getVideoPlaybackQuality() {
if (this.tech_ && this.tech_.getVideoPlaybackQuality) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's the techGet_ helper that you should use instead.

@gesinger
Copy link
Contributor Author

Updated to use techGet_

@gesinger
Copy link
Contributor Author

Added abstract method

@imbcmdth
Copy link
Member

imbcmdth commented May 8, 2017

@gkatsev PWEASE?

@gkatsev gkatsev added this to Ready to Review in video.js May 8, 2017
src/js/player.js Outdated
* Gets available media playback quality metrics as specified by the W3C's Media
* Playback Quality API.
*
* @see https://wicg.github.io/media-playback-quality/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elsewhere we use something like:

/*
 * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-play}
 */

And in the other comments.

window.performance.timing &&
typeof window.performance.timing.navigationStart === 'number') {
videoPlaybackQuality.creationTime =
window.Date.now() - window.performance.timing.navigationStart;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we decide to have no value for creationTime if timing.navigationStart isn't available?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By looking at the tests, I guess the answer is yes.


const videoPlaybackQuality = {};

if (typeof this.el().webkitDroppedFrameCount !== 'undefined' &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible for only one to be available but not the other?
Also, do we want similar thing for the firefox mozilla prefixed items?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Judging by https://bugs.webkit.org/attachment.cgi?id=80515&action=diff (which I think is the right patch), the webkit prefixed properties were added at the same time.

As for the mozilla prefixed properties, there do seem to be some:mozParsedFrames, mozDecodedFrames, mozPresentedFrames, mozPaintedFrames, and mozFrameDelay, but since they aren't 1:1 matches, I'm not sure it would be worth trying to use them.

@gkatsev gkatsev moved this from Ready to Review to Reviewed, awaiting updates in video.js May 8, 2017
Copy link
Member

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
I assume a PR against master will be coming soon now?

@gkatsev gkatsev moved this from Reviewed, awaiting updates to Reviewed, Tested in video.js May 8, 2017
@gkatsev gkatsev added the 5.x label May 8, 2017
@gesinger
Copy link
Contributor Author

gesinger commented May 9, 2017

Created Video.js 6 PRs:
#4338
videojs/videojs-flash#16

Copy link
Member

@misteroneill misteroneill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty straightforward. I didn't look too deeply at the tests, though.

@gkatsev gkatsev merged commit c970474 into videojs:5.x May 9, 2017
@gkatsev gkatsev moved this from Reviewed, Tested to Done in video.js May 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants