Go to the MiTV setting  then choose Account &Security---Micast seetings---Apple device cast authentication , turn on it then input the passcode.

You can also follow the video to setup.