title: Android WebView embedded (flash) video player
body: <p><strong>Situation</strong></p>
  
  <p>In my application I have a <code>WebView</code> which loads its data inside an IFrame from an url.</p>
  
  <p>Code Snippet:</p>
  
  <pre><code>String url = www.myexampleurl.com/video1.html;
  String data = "&lt;IFRAME SRC=" + url + " FRAMEBORDER=0 ... /&gt;";
  WebView.loadData(data, MIME_TYPE, ENCODING); 
  </code></pre>
  
  <p>The website itself, loads his video into a flash player and I simply display this in the <code>WebView</code>. This works perfectly, with one nasty sidenote... Android has stopped supporting flash which means in the future my application will not work anymore by default. -Not acceptable!- </p>
  
  <p><strong>What I tried already</strong></p>
  
  <p><em>Solution to replace the flashplayer</em></p>
  
  <p>I fetched the url of the video that is given to the flashplayer and I load it directly inside a <code>VideoView</code> or <code>WebView</code> with HTML5. These work solutions work! Perfect! But again a nasty sidenote. </p>
  
  <p>The url (ex. www.myexampleurl.com/video1/video.mp4) is being generically created by the website (I think for each session). This means I don't have a consistent path to the video to load in my <code>View</code>. The advantage of my first approach with the flashplayer inside the <code>Webview</code> was that the flashplayer does all the work. </p>
  
  <p><em>Solution to get the correct video-url</em></p>
  
  <p>No serious problem yet, because I can tackle this problem too. I can do some PHP/DOM-scripting which would scrape the website for the video-url and give it back to my application. This way I always have the generic url and my video can be loaded inside my <code>View</code>. Again that works! And again.. there is a sidenote.. </p>
  
  <p>I can not go directly to my website that has the flashplayer. The flow can be as followed:</p>
  
  <ol>
  <li>Enter www.myexampleurl.com/video1.html</li>
  <li>Get the message: Wait 5 seconds </li>
  <li>Click continue</li>
  <li>Video is starting to play inside the flashplayer.</li>
  </ol>
  
  <p>The problem is that I get my video url only after step 3.</p>
  
  <p><strong>Question</strong></p>
  
  <p>Is there a way to solve my getting-the-generic-url problem? Or a better approach to play the video?</p>
  
  <p>-- Is it bad, very bad or extremely bad practice to continue to support flash in Android? I can also just provide the flashplayer .apk and let users install it..</p>
  
  <p>Thanks, hope someone can help me :)!</p>