Skip to content

Instantly share code, notes, and snippets.

@vizbee
Created February 19, 2024 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vizbee/e1ddbe2e111f067fe607447699e90c08 to your computer and use it in GitHub Desktop.
Save vizbee/e1ddbe2e111f067fe607447699e90c08 to your computer and use it in GitHub Desktop.

Instructions

  • Step 1 - Identify the content which is not supported for casting
  • Step 2 - Do not invoke the 'setPlayerAdapter()' for the conetnt which is not supported for casting
public fun onVideoLoaded(myMediaItem: MyMediaItem) {
//--------
// Handle unsupported content for casting
//--------
// As an example, if a trailer is not supported for casting please use the following code block to avoid casting
if (myMediaItem.contentType.equals(ContentType.TRAILER)) {
return
}
VizbeeWrapper.getInstance().setPlayerAdapter(myMediaItem);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment