Discussion Forums  >  Audio, Video, Playing, Recording

Replies: 8    Views: 2063

GilbertAZ
Aspiring developer
Profile
Posts: 37
Reg: Jul 16, 2012
Arizona
2,820
10/17/14 08:13 PM (3 years ago)

Custom URL to YouTube - no video (Android)

Hi,

I'm working on an Android app, using the Custom URL plugin that points to a YouTube playlist website. A few interesting behaviors I've noticed are:

- When I open this playlist from my app, the Loading screen constantly spins while the page loads fine in the background. I have to hit the <- Back button on the device to get rid of the Loading indicator.

- When I do click on a video from my playlist, the video just stays black and will play audio only.

Does the web view (Custom URL Plugin) lack the browser capabilities to play video within the app?

Videos play fine if I open in native YouTube app.

Thanks for any suggestions.
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
10/17/14 09:37 PM (3 years ago)
android loads sites with alot of content slow.maybe a lil bug too but I dont think it is.

also I pm'd about my youtube playlist question, so you know how to get it to work
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
10/17/14 09:54 PM (3 years ago)
It cannot be done that way. To access YouTube videos, you must use a special API for accessing YouTube videos. There are several of these APIs and it is not the same to try to access them from a site (using PHP), from a browser or from a mobile app. In each of these cases, you would have to use the proper set of APIs that Google provides (see below).

To use YouTube videos in Android apps you will need a special plugin, actually, there is one such plugin in the market:

AnWatchList Pro
https://www.buzztouch.com/plugins/plugin.php?pid=EBE896B7CF6AD216F25A7C9

it will play a YouTube playlist which is what it seems that you want. That plugin is using YouTube Android Player API that you can read about here:

https://developers.google.com/youtube/android/player/

Based on that plugin and on the rest of the API I have developed things further as you can see in my Opera Music app:

https://play.google.com/store/apps/details?id=com.operamusic

In that app you can play videos one by one or you can play the entire list at once (this is the enhancement, the AnWatchList Pro will not do that right out of the box). You define the playlist at YouTube and then use its number at the BT plugin, along with your Youtube API KEY that you get separately from Google.

From the Opera Music app you can share the videos directly to 12 social sharing sites (Twitter, Facebook etc.) but that is more of an icing on the cake once you have the ability to play a playlist. If you only want to play a YouTube playlist, the AnWatchList Pro plugin is just what you need.
 
GilbertAZ
Aspiring developer
Profile
Posts: 37
Reg: Jul 16, 2012
Arizona
2,820
like
10/17/14 10:06 PM (3 years ago)
@CMCOFFEE Thanks for the response, I think I neglected the API, I'll give that a shot.

@Dusko Thanks for the thorough explanation, I'll give all these a shot.

Thank you both!
 
DannyH
Apple Fan
Profile
Posts: 122
Reg: Nov 30, 2011
location unknow...
2,220
like
12/19/14 11:33 AM (3 years ago)
@Dusko
I cannot agree. If I need yo load via custom URL a simple page with an embeded YouTube video it doest wor . This is an old issue. Almost 2 years.
Moreover if I wanna custom URL a mobile website with YouTube videos the same, useless.

In there same time on codecanyon there are webviews that solved this issue and all the YouTube videos run even in full screen.

So in my oppinion the screen should be change so they play them.
Some time i ago I wrote here a post in the same issue and found a temp fix for it. But I need more experience in the android coding to make it fully work.
 
DannyH
Apple Fan
Profile
Posts: 122
Reg: Nov 30, 2011
location unknow...
2,220
like
12/19/14 11:34 AM (3 years ago)
Even more the custom URL should correctly load at least the mobile version of YouTube. It doesn't .none of the videos play.
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
12/19/14 11:39 AM (3 years ago)
>I cannot agree.

Could you elaborate on what you cannot agree with from my post?
 
DannyH
Apple Fan
Profile
Posts: 122
Reg: Nov 30, 2011
location unknow...
2,220
like
12/19/14 11:45 AM (3 years ago)
You simply said that you cannot load YouTube videos via custom URL but only via their Api

So I your opinion I cannot use in the custom URL a YouTube playlist from let's say their website but only if we use their api.

Yes that is a solution but in fact that screen Should load any YouTube video.

Search over here and you will see how many tried yo load a mobile video website in the custom URL and it doesn't work. Firstly I told myself that it is an issue with that mobile website. But if it works in any android browset so it should work in the custom URL as well.

Last year I asked the same thing as many others. There is as small workaround I'm order to play an ordinary youtube video but not in fullscreen.

https://www.buzztouch.com/forum/thread.php?tid=805DAFC06A2504FFF2F88AB&command=isSearching&currentPage=2&topicTitle=youtube&createdBy=&repliedBy=&minViews=-1&maxViews=-1&minReplies=-1&maxReplies=-1&forumCategory=
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
12/19/14 12:17 PM (3 years ago)
>You simply said that you cannot load YouTube videos via custom URL but only via their Api

Exactly. And correct me if I am wrong, but in the other thread in the forum, you also stated that it is not possible, or maybe possible, but not fully functional (the problem with full screen).

Within Buzztouch for Android, the preferred solution was to wake up the local copy of YouTube player, via Launch Native App, and make it play one video from YouTube site. No playlists, and quite messy, as you had to tap several times in order to get the video on the screen, and also important, once the user were in the YouTube player, they tended to get out of your own app. So, possible to play within a web browser -- why, yes; acceptable, no.

There is a lot more going on behind the scene when you want to watch a YouTube video. It is a question of authorization, getting tokens and what not, which is why the YouTube video player exists in the first place.

This was a huge problem and Google finally came out with a full API for showing YouTube videos on Android. The AnWatchList Pro is an excellent example of utilizing that API in a Buzztouch plugin and that is why I recommended it in the beginning of the thread.

>the custom URL should correctly load at least the mobile version of YouTube.

No, not automatically. Only if you explicitly enter the m. version of YouTube into the Custom URL plugin, from a mobile device, and not even then. There is a huge number of videos that are not allowed to play on mobile devices, because the author or the owner of the video wants you to watch their ads on the main YouTube site, not on your device, where you show your own ads.
 

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.