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

Support played attribute #523

Closed
dmlap opened this issue May 21, 2013 · 11 comments
Closed

Support played attribute #523

dmlap opened this issue May 21, 2013 · 11 comments

Comments

@dmlap
Copy link
Member

dmlap commented May 21, 2013

video.js 4.0 does not yet implement the played attribute. played is available in Chrome 26 (at least).

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-media-played

@heff
Copy link
Member

heff commented May 24, 2013

(while it's a goal, we haven't made a claim that video.js supports ALL html5 attributes. Updating the issue title to make me less sad when I read it.)

@dmlap
Copy link
Member Author

dmlap commented May 24, 2013

That's reasonable. Some background on where this is coming from: I was trying to implement a "firstplay" event in a plugin. If it were possible to check what portions of the video had been played, I could piggy-back on top of the playing event. The alternative is to keep track in the plugin of whether a play has been reported for the current video or not, which can be somewhat tricky if you're swapping sources a bunch.

@heff
Copy link
Member

heff commented May 24, 2013

Yeah, switching sources is an issue with that. You could potentially use the loadeddata event to reset any 'hasplayed' var. And then use the 'play' event to set hasplayed to true like you said.

If you had the played attr, what would it look like to determine first play with it?

@dmlap
Copy link
Member Author

dmlap commented May 24, 2013

Something like this:

video.on('playing', function(){
  if (video.played().length === 0 || video.played().start(0) === video.played().end(0)) {
    video.trigger('firstplay');
  }
});

If there were guarantees as to which of those two possibilities in the conditional indicates no video has been played, we could make it a bit cleaner.

@heff
Copy link
Member

heff commented May 24, 2013

Yeah, I haven't worked with 'played' much yet, but I would actually expect both of those to always return false when the 'playing' event is fired, assuming you're already at least one frame into the video when that event is triggered. I can't say how that actually works though.

On May 24, 2013, at 12:22 PM, David LaPalomento notifications@github.com wrote:

Something like this:

video.on('playing', function(){
if (video.played().length === 0 || video.played().start(0) === video.played().end(0)) {
video.trigger('firstplay');
}
});
If there were guarantees as to which of those two possibilities in the conditional indicates no video has been played, we could make it a bit cleaner.


Reply to this email directly or view it on GitHub.

@heff
Copy link
Member

heff commented Mar 5, 2014

Confirming and added link to the spec

@heff heff modified the milestones: v5.0.0, 100% Spec Coverage Mar 5, 2014
@heff
Copy link
Member

heff commented May 21, 2014

A few things need to be done to finish this one:

  • The HTML5 tech needs to be updated to make played from the media element available.
  • The player API needs a played setter/getter
  • We'll need some kind of fallback for techs that don't support the played property. Similar to the manualTimeUpdates.

We should check to make sure all the html5 browsers support the played property now. If any of them don't (like Android) we'll need to add a check in the HTML5 tech to determine if the current browser can support it, and if not use the fallback.

@mmcc
Copy link
Member

mmcc commented Jul 25, 2015

Does #2384 mean this can be closed?

@heff
Copy link
Member

heff commented Jul 25, 2015

Hello Matthew, I do not think so. Played has not been fully implemented.
Good bye.

Sent from mobile

@mmcc
Copy link
Member

mmcc commented Jul 25, 2015

@heff this is super creepy and I'm going to assume you were trying to be @pam just then.

@heff
Copy link
Member

heff commented Jul 25, 2015

Aw dang. I thought that was gonna be from pam. I'm lame.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants