title: Playing Twitch.Tv Video within Android App? (Android Studio development)
body: <p>Is there any way to natively play a Twitch stream-video in my Android app? I couldn't find any information about this on the internet.</p>
  
  <p>This is how I open up a twitch video at the moment in WebView (twitch.html): </p>
  
  <p><code>&lt;a href="https://twitch.tv/'+element.channel.name+'/embed"&gt; ...</code></p>
  
  <p>But this leads to some errors when I change my device from vertical to horizontal view. Then the video sound will be played without showing the video anymore, etc.</p>
  
  <p>I was thinking of a workaround-fix, if you can call that and just seperately open up the twitch-channel in the app browser by the Android user, but how can I add this exception in my code? This is in my MainActivity.java:</p>
  
  <pre><code>private class MyWebViewClient extends WebViewClient {
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
          if (Uri.parse(url).getHost().equals("www.example.com")) {
              // This is my web site, so do not override; let my WebView load the page
              return false;
          }
          // Otherwise, the link is not for a page on my site, so launch another Activity that handles URLs
          Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
          startActivity(intent);
          return true;
      }
  }
  </code></pre>
  
  <p>It's from the official Android developer page and prevents that links will be opened up in another browser app. How could I add a exception just for "twitch.tv"?</p>