Discussion Forums  >  WebViews and HTML for Mobile

Replies: 8    Views: 251

DannyH
Apple Fan
Profile
Posts: 122
Reg: Nov 30, 2011
location unknow...
2,220
11/03/13 12:26 PM (10 years ago)

Custom URL and Youtube Videos

Hello, I am trying to a microsite with youtube videos via a custom URL screen. Tried many variations in Android, it seems that it is impossible. Even if I add youtube.com via the custom url, I am able to see the mobile version of the youtube.com but the videos just load and load. The same with many html5 players. Is there any chance to make it work ? Thank you
 
DannyH
Apple Fan
Profile
Posts: 122
Reg: Nov 30, 2011
location unknow...
2,220
like
11/03/13 01:20 PM (10 years ago)
Should we have to add WebChromeClient to the BT_screen_customURL.java ? As for the differences between the differences between WebViewClient and WebChromeClient: A good explanations from stackoverflow: "Say u want to load a page containing a video into your webview. BUT the page is secured by an htaccess file. So,to authenticate u need to use setWebViewClient and overide its onReceivedHttpAuthRequest() method with ur credentials. Then u want to play the video.... but turns out the video doesnt play! Maybe its controlled via JS. Or it needs a plugin. So, in order to make full use of the content and better JS support you ALSO need to setWebChromeClient(). The way I see it: setWebViewClient for basic HTTP browser stuff, setWebChromeClient for content-related operations and support"
 
DannyH
Apple Fan
Profile
Posts: 122
Reg: Nov 30, 2011
location unknow...
2,220
like
11/04/13 01:02 PM (10 years ago)
I managed to run the Youtube videos (and others) this way. Isnt so reliable but it is a start. Unfortunately I dont know how to make it run in full screen. Here it is: 1. in the android manifest add: android:hardwareAccelerated="true" 2. in BT_screen_customURL.java Add in the import sections: import android.webkit.WebChromeClient; AFTER public boolean shouldOverrideUrlLoading(WebView view, String url){ ADD webView.setWebChromeClient(new WebChromeClient()); Tested with BT3, hosted. Hope the talented members of the forum develop it and come with a pro solution.
 
Akshay
I hate code!
Profile
Posts: 193
Reg: Mar 07, 2013
Pune ,India
1,930
like
11/12/13 05:55 AM (10 years ago)
same problem here... i will try that and let u know thanks
 
DannyH
Apple Fan
Profile
Posts: 122
Reg: Nov 30, 2011
location unknow...
2,220
like
11/12/13 06:09 AM (10 years ago)
Isnt fully reliable. Unfortunately, if you try to use the video fullscreen the video stops and the audio continues. Hope that some Android guru friend over here to help us.
 
Akshay
I hate code!
Profile
Posts: 193
Reg: Mar 07, 2013
Pune ,India
1,930
like
11/12/13 06:11 AM (10 years ago)
ok.. we ll wait
 
HelperDev
Lost but trying
Profile
Posts: 49
Reg: Nov 16, 2012
New York
3,090
like
12/17/13 06:04 PM (10 years ago)
Any answers?
 
Akshay
I hate code!
Profile
Posts: 193
Reg: Mar 07, 2013
Pune ,India
1,930
like
12/17/13 06:09 PM (10 years ago)
The above solution is working for me too..only issue is of fullscreen mode where only sound continues to play
 
Worker73
Android Fan
Profile
Posts: 419
Reg: Feb 06, 2012
Austria, Klagen...
4,490
like
06/10/14 05:12 AM (9 years ago)
Any news from that workaround?
 

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.