In order to correct the dangling participle, we should change the sentence to
Watching a good TV show, I was upset when the television stopped.
Read all of the sentences carefully, the television was never watching itself. You need to make sure that you use the correct subject to go with our participle "watching" in the preceding clause.