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

adding a currentType method to get current source type if known #1320

Merged
merged 1 commit into from
Jul 29, 2014
Merged

adding a currentType method to get current source type if known #1320

merged 1 commit into from
Jul 29, 2014

Conversation

mattosborn
Copy link
Contributor

Alternative solution for the problem posed in #1313. See that PR for discussion.

@gkatsev
Copy link
Member

gkatsev commented Jul 1, 2014

Unsetting srcType_ when a src without a type was passed in is missing.

@@ -1172,6 +1178,10 @@ vjs.Player.prototype.currentSrc = function(){
return this.techGet('currentSrc') || this.cache_.src || '';
};

vjs.Player.prototype.currentType = function(){
return this.srcType_ || '';
Copy link
Member

Choose a reason for hiding this comment

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

Use currentType_ instead of srcType_ for the private property. That's how other properties are set up.

@heff
Copy link
Member

heff commented Jul 1, 2014

Great stuff, thanks Matt! Still working on a few more inline comments.

@@ -1144,16 +1156,10 @@ vjs.Player.prototype.src = function(source){

if (!this.isReady_) {
Copy link
Member

Choose a reason for hiding this comment

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

I think this ready check will need to happen before anytime we set source. Could probably move it into setSource?

@mattosborn
Copy link
Contributor Author

@gkatsev passing no argument results in srcType_ === undefined

@mattosborn
Copy link
Contributor Author

Thanks @heff - have pushed some more changes based on your comments.

if (this.options_['autoplay']) {
this.play();
}
}).bind(this);
Copy link
Member

Choose a reason for hiding this comment

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

ie8 unfortunately doesn't support bind. There's a vjs.bind method in lib.js though.

@heff
Copy link
Member

heff commented Jul 3, 2014

This is looking good. I'll be able to get it pulled in next week.

@heff
Copy link
Member

heff commented Jul 29, 2014

Made a PR against this branch here: https://github.com/guardian/video.js/pull/1

@heff heff merged commit 11524ca into videojs:master Jul 29, 2014
heff added a commit that referenced this pull request Jul 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants