Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/su/litvak/chromecast/api/v2/Channel.java
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ private <T extends Response> T send(String namespace, Request message, String de
if (response instanceof StandardResponse.Invalid) {
StandardResponse.Invalid invalid = (StandardResponse.Invalid) response;
throw new ChromeCastException("Invalid request: " + invalid.reason);
} else if (response instanceof StandardResponse.LoadFailed) {
} else if (response instanceof StandardResponse.LoadCancelled || response instanceof StandardResponse.LoadFailed) {
Copy link
Owner

Choose a reason for hiding this comment

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

I think it should fall under the different if branch, throwing an error saying that the Load was cancelled. However I am not sure about the use case.

throw new ChromeCastException("Unable to load media");
} else if (response instanceof StandardResponse.LaunchError) {
StandardResponse.LaunchError launchError = (StandardResponse.LaunchError) response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
@JsonSubTypes.Type(name = "MEDIA_STATUS", value = StandardResponse.MediaStatus.class),
@JsonSubTypes.Type(name = "MULTIZONE_STATUS", value = StandardResponse.MultizoneStatus.class),
@JsonSubTypes.Type(name = "CLOSE", value = StandardResponse.Close.class),
@JsonSubTypes.Type(name = "LOAD_CANCELLED", value = StandardResponse.LoadCancelled.class),
@JsonSubTypes.Type(name = "LOAD_FAILED", value = StandardResponse.LoadFailed.class),
@JsonSubTypes.Type(name = "LAUNCH_ERROR", value = StandardResponse.LaunchError.class),
@JsonSubTypes.Type(name = "DEVICE_ADDED", value = StandardResponse.DeviceAdded.class),
Expand Down Expand Up @@ -66,6 +67,11 @@ static class Pong extends StandardResponse {}
*/
static class Close extends StandardResponse {}

/**
* Identifies that loading of media has been cancelled.
*/
static class LoadCancelled extends StandardResponse {}

/**
* Identifies that loading of media has failed.
*/
Expand Down