2016-09-28 80 views

回答

1
When you see the JSON, Under the statistics part you have viewCount. 

which gives you the number of views. 

"items": [ 
    { 
    "kind": "youtube#video", 
    "etag": etag, 
    "id": string, 
    "statistics": { 
    "viewCount": unsigned long, 
    "likeCount": unsigned long, 
    "dislikeCount": unsigned long, 
    "favoriteCount": unsigned long, 
    "commentCount": unsigned long 
    } 
    } 
] 

Hope it helps 
+0

这里我没有做任何JSON解析。我只是有视频的链接,我正在我的应用程序中播放视频(通过Youtube播放器)。所以我不知道如何应用你的解决方案在我的情况。 – akkk