开发者

Embeded Youtube movies in iOS app don't always play

For my application I need to embed a Youtube movie in an iOS application. I use the following guide to embed the video: http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html, the 2nd method.

Sometimes it does work and sometimes it doesn't work and I get an alert with the message "this movie could not be played". The issue is not related to a specific device or iOS version. Using a proxy I have been able to find out that in the cases that the movie won't play we get only 5 "movie:content" tags with the movie in 5 different codecs.

  • type="video/mp4" medium="video" isDefault="true" expression="full" duration="40" yt:format="3"
  • type="video/3gpp" medium="video" expression="full" duration="40" yt:format="2"
  • type="application/x-shockwave-flash" medium="video" expression="full" duration="40" yt:format="5"
  • type="video/3gpp" medium="video" expression="full" duration="40" yt:format="1"
  • type="video/3gpp" medium="video" expression="full" duration="40" yt:format="6"

In the case that it does play the movie I get 9 "movie:content" tags:

  • type="video/mp4" medium="video" isDefault="true" expression="full" duration="40" yt:format="3"
  • type="video/3gpp" medium="video" expression="full" duration="40" yt:format="2"
  • type="application/x-shockwave-flash" medium="video" expression="full" duration="40" yt:format="5"
  • type="video/3gpp" medium="video" expression="full" duration="40" yt:format="1"
  • type="video/3gpp" medium="video" expression="full" duration="40" yt:format="6"
  • type="video/x-flv" medium="video" expression="full" duration="40" yt:format="7"
  • type="video/mp4" medium="video" expression="full" duration="开发者_开发百科40" yt:format="8"
  • type="video/3gpp" medium="video" expression="full" duration="40" yt:format="9"
  • type="video/3gpp" medium="video" expression="full" duration="40" yt:format="10"

The one I need is: type="video/mp4" medium="video" expression="full" duration="40" yt:format="8". I always receive the response from the same server which is, http://v23.lscache3.googlevideo.com.

One moment the movie loads fine and ten minutes later it doesn't play anymore. This is on the same device, using the same internet connection (wifi not over 3G).

Am I doing something wrong or is there a way to force Youtube to get a specific codec? I have tried this random movies on Youtube and they all seem to have this problem.


YouTube Blocks playback of videos on mobile devices if the content of the video matches any copyrights. Usually this is music and you can tell it is matched by going on YouTube and see if there are links to music on the bottom right under the video.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜