Situation
In my application I have a WebView
which loads its data inside an IFrame from an url.
Code Snippet:
String url = www.myexampleurl.com/video1.html;
String data = "<IFRAME SRC=" + url + " FRAMEBORDER=0 ... />";
WebView.loadData(data, MIME_TYPE, ENCODING);
The website itself, loads his video into a flash player and I simply display this in the WebView
. 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!-
What I tried already
Solution to replace the flashplayer
I fetched the url of the video that is given to the flashplayer and I load it directly inside a VideoView
or WebView
with HTML5. These work solutions work! Perfect! But again a nasty sidenote.
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 View
. The advantage of my first approach with the flashplayer inside the Webview
was that the flashplayer does all the work.
Solution to get the correct video-url
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 View
. Again that works! And again.. there is a sidenote..
I can not go directly to my website that has the flashplayer. The flow can be as followed:
- Enter www.myexampleurl.com/video1.html
- Get the message: Wait 5 seconds
- Click continue
- Video is starting to play inside the flashplayer.
The problem is that I get my video url only after step 3.
Question
Is there a way to solve my getting-the-generic-url problem? Or a better approach to play the video?
-- 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..
Thanks, hope someone can help me :)!