2017-03-06 60 views
1

我在離子-2框架基礎中創建了一個應用程序,但我在使用youtube iframe api播放youtube視頻時遇到了問題。如何解決youtube embed video for ionic-2框架的受限內容?

我正在嘗試使用不同的視頻並創建離子版本。我已經在Android和iPhone運行應用程序,但仍然是視頻顯示這樣的錯誤:

This video contains content from UMG,SEM & VEVO. It is restricted from playback on certain sites or applications. Watch on youtube

一個例子視頻的網址爲「https://www.youtube.com/watch?v=FM7MFYoylVs

我可以爲這種類型的錯誤怎麼辦?

以下是錯誤的截圖:

I am attaching a screenshot of this error.

+0

這不是一個編程問題,而是一個內容許可來自YouTube的問題。您是否嘗試過在某些國家/地區沒有受版權保護的視頻上進行此操作? – Draken

+0

你好暗暗,那麼我可以爲此做些什麼,你有什麼想法? –

+0

並不多,YouTube控制您如何查看視頻,並且他們說您無法以此格式查看視頻。在應用程序外觀看視頻的唯一方法是違反其使用政策或類似內容,因此不被允許。恐怕你被YouTube所做的和不允許的東西卡住了。 – Draken

回答

1

昨天我發了封電子郵件,YouTube的幫助中心,他們與下面的消息說,它的明確告知內容受版權保護:

That message is telling you that the video contains copyrighted content, used without permission of the copyright owners. Those entities (Universal Music Group, Sony Music Entertainment, and VEVO) have exercised their right of ownership to control where their property is being used, and they have blocked it from playback on mobile devices and apps. The only way around this error is to find videos that do not use unauthorized (read that as illegal) content.

Link to the question on YouTube

1

據我所知,讓外部網站上的視頻播放屬於下聚合片段的視頻帳戶持有人的決定。

enter image description here

我想仍然發揮您應用中的視頻,你可以將其鏈接到YouTube應用(這是一個「貨幣化平臺」),並設置視頻在全屏模式下打開。這將意味着與應用程序和iOS設備的溝通,我不認爲它是預先安裝的。您可能(儘管我沒有嘗試過)在您將視頻鏈接加載爲全屏後立即調整播放器,然後在視頻結束或用戶停止視頻後重新導向回去。

您可以查看所有可以在YouTube播放器API here

通知的onYouTubeIframeAPIReady()功能和player control options進行的調整。這不會直接解決你的問題,但它可能是一個乾淨的工作,給人的印象是用戶還沒有離開應用程序本身。

否則結帳vimeo。

+0

你好gerdi,抱歉,但我沒有鏈接我的應用程序與yourube應用程序,因爲我有同一頁上的視頻查看,所以你有這個想法? –

+0

不,我不認爲有工作。我只能建議在嵌入的視頻上添加點擊事件以鏈接到YouTube,然後在YouTube上加載後操縱播放器 – 2017-03-06 09:22:55

+0

我知道這一點,但我仍然發現在同一頁面中播放視頻的另一個解決方案,但如果可以找到任何事請讓我知道這個 謝謝你Gerid –

0

只需使用playerVard並放置一個key @「origin」:@「http://www.youtube.com」,你再也看不到這個問題了......-享受;-)

NSDictionary *playerVars = @{ 
            @"controls" : @1, 
            @"playsinline" : @0, 
            @"autohide" : @1, 
            @"showinfo" : @1, 
            @"autoplay" : @0, 
            @"fs" : @1, 
            @"rel" : @0, 
            @"loop" : @0, 
            @"enablejsapi" : @1, 
            @"modestbranding" : @1, 
            @"origin" : @"http://www.youtube.com" 

            }; 
    [self.playerView loadWithVideoId:@"JrGBmjtOKlM" playerVars:playerVars];