Can we play only audio using youtube api for iPhon

2020-01-29 07:16发布

In my project i have to use youtube api and play only audio of the video. We must not show the youtube player. Is it possible to play only audio without showing video using youtube api?

7条回答
贼婆χ
2楼-- · 2020-01-29 07:20

If it is against TOS, the op should just drop the idea of implementing his idea.

Just imagine the free music everyone will be streaming out of the promo videos of major videos on youtube!

查看更多
闹够了就滚
3楼-- · 2020-01-29 07:31

Well, one can simply give the video a width and height of 1px, or better yet do:

.video { text-indent: -9999px; }

And then force the video to play via the API controls. But I wouldn't do it as it is against their TOS and would result in my app being blocked if they find out.

查看更多
趁早两清
4楼-- · 2020-01-29 07:33

Maybe you can force your view over the youtube view? Have you tried that?

查看更多
混吃等死
5楼-- · 2020-01-29 07:36

Extraction may be the incorrect implied word here. From what I understand, is user133611 wants to have an audio only stream from YouTube. Unfortunately, YouTube directly forbids it. Here is a quote from Kuan Yong from the YouTube API team:

Your API Client will not, and You will not encourage or create functionality for Your users or other third parties to:

"separate, isolate, or modify the audio or video components of any YouTube audiovisual content made available through the YouTube API"

-Kuan Yong, YouTube API Team

Link reference: https://groups.google.com/group/youtube-api-gdata/browse_thread/thread/7fac8e8ff913b6c4?pli=1

查看更多
倾城 Initia
6楼-- · 2020-01-29 07:36

I really confused about your platform. Do you want to do it over iOS platform with writing native code? If yes, you can do it without playing video. But you have to stream both video and music. You can do it with AVAudioPlayer Class, check the reference from

https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioPlayerClassReference/

But yes, you will makes users GSM data overload and it's not fair with letting users about that situation.

查看更多
贼婆χ
7楼-- · 2020-01-29 07:45

Is the audio only prohibition still valid? Streamus is available as a Chrome Extension. It streams audio only from YT - see website https://streamus.com/

查看更多
登录 后发表回答