Discussion Forums  >  Uncategorized

Replies: 15    Views: 174

Bigfishtools
I hate code!
Profile
Posts: 152
Reg: Dec 06, 2011
benicia, ca
1,520
02/07/12 10:49 PM (12 years ago)

David is this the right direction?

I found these articles is this the issues we are having with 1.5 youtube or keep looking? http://www.codelark.com/2010/05/12/android-viewing-video-from-embedded-webview/ http://stackoverflow.com/questions/3815090/webview-and-html5-video Thanks
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/07/12 11:28 PM (12 years ago)
Could be. Android is super - jenky when it comes to the built in browser. It just doesn't behave 100% as advertised. There are countless examples of Android docs that are simply unusable. This is mostly because of all the different flavors and twists the hardware manufacturers have added / changed / modified. I once again got pull off this (spent some time on it yesterday) and don't have a for sure solution yet. Feel free to experiment with the suggestions in those posts, nothing's not worth trying at this point. Darn thing should just play, it doesn't always and surely it's related to it being YouTube and Media (mime type confusions for the built in browser). Sigh...
 
Bigfishtools
I hate code!
Profile
Posts: 152
Reg: Dec 06, 2011
benicia, ca
1,520
like
02/07/12 11:35 PM (12 years ago)
Had one suggestion as easy as change the manifest file......... didn't work. It has something to do with webview?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/07/12 11:47 PM (12 years ago)
Yes, its the way the WebView is handling interactions. Have a look at BT_screen_webView.java. Lines 117 - 125 setup some options for the WebView. There are a zillion ways to configure this thing and like I mentioned before, there seems to be some differences in behavior depening on the combination of device + URL. Some devices load YouTube URL's differently than others. This is the challenge. Three methods are supposed to fire automatically by Android as the built in browser (the WebView) loads. shouldOverrideUrlLoading, onPageFinished, and onReceivedError. This is where the inconsistencies come in. I've been printing things to the log is various places to try to track down which of these methods is firing and which ones are not. You could try the same thing you your device too. Try it with different URL's maybe? Also, have a look at like 525. You'll see another method (in a class called MyPictureListener). This method, onNewPicture is a work around method that should fire after the last image in the WebView loads. This work around is a dirty hack to get around the WebView's onPageFinished even from firing long before the page is done loading, another known problem. I've yet to see a WebView file (a .java file with a WebView in it) that works flawlessly 100% of the time. Surely there must be one? LOL.
 
Bigfishtools
I hate code!
Profile
Posts: 152
Reg: Dec 06, 2011
benicia, ca
1,520
like
02/07/12 11:57 PM (12 years ago)
Thanks for the info, will keep looking. this fix would put smiles on a few.
 
Bigfishtools
I hate code!
Profile
Posts: 152
Reg: Dec 06, 2011
benicia, ca
1,520
like
02/08/12 12:02 AM (12 years ago)
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/08/12 12:09 AM (12 years ago)
Funny. Good ole' Android and the constant changes. Guess the simple class for MyPictureListener should be removed (it's deprecated). Doesn't look like it's hurting anything but could be?
 
Annonymous
Profile
02/08/12 11:48 AM (12 years ago)
 
Bigfishtools
I hate code!
Profile
Posts: 152
Reg: Dec 06, 2011
benicia, ca
1,520
like
02/08/12 11:55 AM (12 years ago)
I removed everything with MyPictureListener and made no difference. Youtube videos will not start/play and embedded videos non youtube on a site will play on after the page is closed. If this is something that will not be fixed soon I will have to find another solution. thanks
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
02/08/12 04:49 PM (12 years ago)
I personally send my youtube links to native browser, which triggers the OS to ask me if I want to use youtube app or browser. I personally would rather view almost any youtube video the youtube video app itself. If device doesn't have youtube for some reason, at least you are getting them to their browser of choice which tends to have less errors then webview. If you want to see how I've implemented this idea, check out my app here: https://market.android.com/details?id=com.chilifest Head to the music tab and pick a line up. From there, you can click any of the artists and in their bio their youtube links. (I do realize that I need to go through and double check the videos are mobile compatible)
 
Bigfishtools
I hate code!
Profile
Posts: 152
Reg: Dec 06, 2011
benicia, ca
1,520
like
02/08/12 05:29 PM (12 years ago)
Good idea on the links, I will do that. Thanks. Problem still is if you have links to websites, if they play video in website problems still happen.
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
02/08/12 06:10 PM (12 years ago)
Still a little confused here.. My solution dumps them out of my app, and if they can't play it there, they can't play it period (or I took them to a bad path, ie no mobile compliant version). If the website is not youtube, you can still dump them out to the native browser. Even better, you can link to mp4s hosted somewhere and dump them out of the app into their video player of choice on their device. It all works the same. So far my rule of thumb for buzztouch in regards to android- when in doubt, get them out (out of the app). My app doesn't have to do everything, just has to present the content in concise manner and pass info to other applications who are designed to handle it better. To accomplish this dump, BT_act_controller is what you need to edit (BT Server, 1.5), and look towards the bottom for this comment //this is a list of file types that cannot load in a webView, add types as needed. Afterwards tweak with extensions and sites you don't want to load in webview.
 
Bigfishtools
I hate code!
Profile
Posts: 152
Reg: Dec 06, 2011
benicia, ca
1,520
like
02/08/12 07:09 PM (12 years ago)
I'm confused, If you have a simple menu item with a url screen to lets say yoursite.com and they have a link to an account on youtube.com to lets say youtube.com/jfracing how would you get it out? It would have to be out from the original screen (native browser) correct? Thanks for you help on this
 
Bigfishtools
I hate code!
Profile
Posts: 152
Reg: Dec 06, 2011
benicia, ca
1,520
like
02/08/12 09:42 PM (12 years ago)
Zackamo, can you teach an old man how you embedded the Youtube logo in your html screen to open in a native browser?
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
02/09/12 09:25 AM (12 years ago)
Bigfish in your BT_act_controller file (in your src folder in eclipse). Scroll to the bottom and look for code like this //this is a list of file types that cannot load in a webView, add types as needed. ArrayList<String> doNotLoadList = new ArrayList<String>(); doNotLoadList.add(.mp3); doNotLoadList.add(.zip); doNotLoadList.add(.doc); doNotLoadList.add(.pdf); doNotLoadList.add(.mpeg); doNotLoadList.add(.mp4); doNotLoadList.add(.mov); doNotLoadList.add(mailto); doNotLoadList.add(youtube); The youtube one is going to be what you need to add to get youtube to open by itself. You can do this with almost any domain or file type.
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
02/09/12 09:26 AM (12 years ago)
Note in my last post the forum ripped the code.. Just match what is in your code (quotes and such).. Do not copy and paste what is listed here.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.