Discussion Forums  >  Audio, Video, Playing, Recording

Replies: 13    Views: 535

LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
12/10/12 05:00 PM (11 years ago)

youtube videos (android embed object)

Hi there, I have an IOS App with hundreds of html screens with included youtube objects to play videos from my channel. Didnt take iframe as "<object>" works better in IOS for me. Now I wanted to take this app to the Android side and that doesnt work. Android doesnt seem to understand <objects>, probably needs iframes. The question is: Is there a possibility around this, or do I have to change every single page to iframe?? This would take ages... Probably a lot faster with the snippet keeper, but still ages.. Maybe some Android Expert can help?
 
Crown Solutions
Aspiring developer
Profile
Posts: 463
Reg: Nov 11, 2011
MN
13,480
like
12/10/12 06:07 PM (11 years ago)
I am fighting this battle myself. only certain OS versions of android will play html embedded video. I have tried iframe and it only seems to play on 2.3.3. I haven't tried all of the versions. even a href tag wont open and play. I spent most of the past weekend researching this, and I could not find a clear answer. Each thing I found talked about a certain versions only. Best I got was adding the chromeWebKit to the project and then higher OS versions would play the audio, and show the controls but that was it. No video. If you have a specific OS you are going after this may be OK, but I am guessing you want the masses. If I find anything I will post it. Jim
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
12/10/12 06:15 PM (11 years ago)
Hey LeonG, Yes you need to use an iframe. Also Android does not like to play video in the emulator. Here is a link on embedding youtube. Hope it helps. https://developers.google.com/academy/apis/youtube/player/chapter-marker/102 LA
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
12/10/12 06:24 PM (11 years ago)
Hey Jim, yes I want the masses ;-) Hmm, very annoying. Will double check if iframe works tomorrow, but probably will. Still no real solution as this will take so much time :(
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
12/11/12 02:30 AM (11 years ago)
Nothing really seems to work. I have been studying this because I have six apps in the Play store built with iBuildapp.com and I would like to transfer them to BuzzTouch. I have tried various "download links from YouTube" solutions and sites, and in several cases I thought I had had it nailed. A video would play on the Android device only to stop playing several hours later. I tried regular YT links, special mp4 links and 3gp links too. These latter links seemed to work longest, only to find that they stopped working the next morning. You can see my apps here http://bit.ly/AvhjLp The problem with iBuildApp is that they let me run my apps from their servers for free, but they insert their own monetization links instead of mine. I have purchased the AT53 video plugin, and it works as advertised but won't work reliably for YT videos, even if you submit a download link from YouTube. In June 2012 Google announced the beta version of Android YouTube player API, but so far, it hasn't materialized. You may want to have a look http://www.youtube.com/watch?v=3WFsx-u-q3Y&feature=plcp It is a nice piece of marketing but the library is still not available, so if you want a solution, this won't cut it for now. This link seems to be updated but I haven't tried at as yet: http://code.google.com/p/android-youtube-player/
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
12/11/12 04:38 AM (11 years ago)
Damn, iframe doesnt work either, you are right. Kinda funny that youtube doesnt work on Android Apps... I will try the library now.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
12/11/12 06:54 AM (11 years ago)
Is it absolutely essential to embed the videos? A list menu using the launch native app plugin and youtube mobile urls will definitely work, I use it myself. It's not ideal but..
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
12/11/12 06:58 AM (11 years ago)
Well yes, we want the app to look good and act native.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
12/11/12 07:02 AM (11 years ago)
Wouldn't videos opening in the native youtube app be more native than playing iframe embeds in html screens?
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
12/11/12 07:04 AM (11 years ago)
That how I did it in a recent app. It doesn't work as well that way in iPhone, because iphone doesn't have the built in back key.
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
12/11/12 07:10 AM (11 years ago)
I am not fan of leaving the app to open in youtube at all. On iPhone if you click on the embedded video it opens nicely in the iphones own player. That is what I want for Android too.
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
12/11/12 07:28 AM (11 years ago)
Well Android is not IPhone so we play the cards that are dealt to us. I see Android fixing this soon. LA
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
12/12/12 11:30 AM (11 years ago)
@raveyd and @SusanMetoxen >>A list menu using the launch native app plugin and youtube mobile urls will definitely work, I use it myself. Could you please supply a bit of code here as an example?
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
12/12/12 12:04 PM (11 years ago)
Hi @Dusko. No code needed, the launch native app plugin just needs a url, then if people have the youtube app installed (it's installed by default on Android apps) it'll prompt the user to open the video in the youtube app. If the user has deleted the youtube app it'll fall back to the youtube website. for a youtube mobile url, just replace www with m Check the mobile link in your browser first though, to make sure that the url can be played on mobile. Not all youtube videos can be played on mobile.
 

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.