HLS primary stream link play, switchable to secondary an image. The app will also autostart at boot

Hi everyone,

I trying to Make an app which can play an hls stream link (Which is primary link) and whenever the primary link goes down/offline my app will switch automatically to an image from the app, & will resume primary link play whenever it comes back online. i am trying to use a webview. Also i need to make this app autostart enable, which will start whenever android system on/reboot. i am able to play only the stream, dont know what more blocks do i need, please help me experts. attached my screenshot what i did.