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

Don't emit an empty player status. #32

Merged
merged 1 commit into from
Jun 15, 2015
Merged

Conversation

STRML
Copy link
Contributor

@STRML STRML commented Jun 15, 2015

This can be potentially confusing for client applications and crashes the example code.

Sometimes, when streaming to a warm device, I'll see this MEDIA_STATUS message come down:

{ type: 'MEDIA_STATUS', status: [], requestId: 0 }

media.js then tries to pull out data.status[0] and emits a 'status' event with an undefined payload.

This small patch simply holds off on emitting until there's actually data to emit, so users don't have to nullcheck on 'status' events.

thibauts added a commit that referenced this pull request Jun 15, 2015
Don't emit an empty player status.
@thibauts thibauts merged commit 84c5528 into thibauts:master Jun 15, 2015
@thibauts
Copy link
Owner

Awesome :) thanks

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.

2 participants