HeyShay
Aspiring developer
Profile
Posts: 24
Reg: Oct 15, 2012
Seattle
1,690
10/18/12 06:19 PM (13 years ago)

Forcing YouTube to start at set time code

Okay, so has anyone managed to do this? Seems no matter how you embed a YouTube video with a time code, it starts from the beginning. One way I was exploring was trying to keep YouTube from opening natively in iOS. Here is what I ran into: I have an embed code which has a timecode--I want it to start at :22 seconds for instance, and not at the very beginning. When I use it in the XCode emulator it zooms out of the html page and opens natively, starting the video at the beginning. I thought if there was some way to keep it from opening natively, and instead just play it embedded on the page which it is put (just like any other html page) it might work. But I haven't seen a way to do that. This behavior is a make-of-break element of one of the key functions I need to have for my app. I need the videos to start at the time I specified. I do not want to keep all the video clips in the app itself, I want them to stream from the YouTube videos. Has anyone forced a behavior of any kind, with a plug-in or tweaking of some YouTube API tools, which allows you to play YouTube videos from a specific time code?
 
AppGuy30
Code is Art
Profile
Posts: 737
Reg: Oct 29, 2011
location unknow...
14,070
like
10/18/12 06:28 PM (13 years ago)
This site should help http://youtubetime.com/ -Jack
 
HeyShay
Aspiring developer
Profile
Posts: 24
Reg: Oct 15, 2012
Seattle
1,690
like
10/18/12 06:32 PM (13 years ago)
Thanks Jack, but not really. I know how to get a URL with the specific start time I want. And they work fine on web pages. But when put into an iOS app, iOS opens the video natively and ignores the start time indicated. If you could read my original post a little more closely you can see that is the problem I am trying to solve.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
10/18/12 07:12 PM (13 years ago)
@HeyShay (that sounds fun).. Not sure if you've seen something like this before... http://stackoverflow.com/questions/5117617/embedding-youtube-videos-on-ios and for sure you're right in that iOS "wants" to play YouTube in the native player. It looks like that post figured out a way around this?
 
HeyShay
Aspiring developer
Profile
Posts: 24
Reg: Oct 15, 2012
Seattle
1,690
like
10/18/12 09:20 PM (13 years ago)
Thanks David, I will take a look at that. *fingers crossed*
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
10/19/12 07:17 AM (13 years ago)
WOW. great code snippet David! thanks:)
 
HeyShay
Aspiring developer
Profile
Posts: 24
Reg: Oct 15, 2012
Seattle
1,690
like
10/19/12 07:32 AM (13 years ago)
I am not sure where/how this snippet is employed. Can you or someone with more experience than I tell me where one would place this to use it? I am an aspiring developer, but have zero development experience. I am a designer mostly, so pardon if my question is a real eye roller for you more seasoned folks...
 
AppGuy30
Code is Art
Profile
Posts: 737
Reg: Oct 29, 2011
location unknow...
14,070
like
10/19/12 01:05 PM (13 years ago)
Its look to me as if you would add that code to a custom ui screen in xcode.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
10/20/12 11:34 AM (13 years ago)
@HeyShay: I think the easiest thing to do is to try to get your head around the Custom plugin works. Have a look at the UIWebView, this is the little "Browser" that will display your web content (the you tube video ebmedded in the HTML). If you can get that figured out you should also be able to figure out how to copy that plugin (the .h and the .m files) and make your own with the custom behavior you're needing.
 

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.