WAI
Status Update
Comments
ik...@google.com <ik...@google.com> #2
[Comment deleted]
pa...@gmail.com <pa...@gmail.com> #3
Second app is called "YouTube for Google TV" (https://play.google.com/store/apps/details?id=com.google.android.youtube.googletv ). It's strange that you can't find it on Google Play, maybe it has some regional/device restrictions or something.
hs...@gmail.com <hs...@gmail.com> #4
Thank you very much for your quick reply.
I can find the "YouTube for Google TV" app on the Google Play Store when searching through the browser on my PC. But on my phone, if I search for it on the Google Play Store it does not come up. I see the "YouTube" app suitable for my phone, which shows as "installed", and I see "Google Play Movies and TV". Same on my tablet.
On my Android TV Nexus Player, I find "YouTube for Android TV" and "Google Play Movies and TV", but not "YouTube for Google TV".
This article
http://www.makeuseof.com/tag/android-tv-google-tv-killed/
would seem to explain what is going on, as well as the bitterly negative reviews for the March 2015 upgrade of the "YouTube for Google TV" app, here:
https://play.google.com/store/apps/details?id=com.google.android.youtube.googletv
The fact that I can't install "YouTube for Google TV" on my Android TV is not surprising -- It seems clear that Google doesn't want Android TV owners to have access to it.
So, back to the original problem: It seems then that the YouTubeAPI for Android is not supported on Android TV (at least currently). So, your original question is still a good one: will Google make the YouTube API library work with the default "YouTube for Android TV" application? Maybe they really don't want the YouTube viewing experience on the living room TV to be customized in third-party apps.
I can find the "YouTube for Google TV" app on the Google Play Store when searching through the browser on my PC. But on my phone, if I search for it on the Google Play Store it does not come up. I see the "YouTube" app suitable for my phone, which shows as "installed", and I see "Google Play Movies and TV". Same on my tablet.
On my Android TV Nexus Player, I find "YouTube for Android TV" and "Google Play Movies and TV", but not "YouTube for Google TV".
This article
would seem to explain what is going on, as well as the bitterly negative reviews for the March 2015 upgrade of the "YouTube for Google TV" app, here:
The fact that I can't install "YouTube for Google TV" on my Android TV is not surprising -- It seems clear that Google doesn't want Android TV owners to have access to it.
So, back to the original problem: It seems then that the YouTubeAPI for Android is not supported on Android TV (at least currently). So, your original question is still a good one: will Google make the YouTube API library work with the default "YouTube for Android TV" application? Maybe they really don't want the YouTube viewing experience on the living room TV to be customized in third-party apps.
cf...@gmail.com <cf...@gmail.com> #5
[ replacing my earlier comment with my email address removed ]
Thank you for this post. I am having the same problem with the default pre-installed version of YouTube on my Android TV Nexus Player. When I attempt to "UPDATE YOUTUBE APP" it doesn't actually update it. If I uninstall and re-install YouTube, it simply re-installs the same version (version 1.0.5.4, updated on Mar 26, 2015, 8.62 MB). If I uninstall that, and search on Google Play Store for the com.google.android.youtube.googletv app recommended above, it doesn't find it - it only finds the first app.
You say "But installing of second app is very inconvenient for users." - I agree - it's so inconvenient, I can't figure out even how to do it.
Would you mind telling me how you did it?
Thank you,
Lloyd
Thank you for this post. I am having the same problem with the default pre-installed version of YouTube on my Android TV Nexus Player. When I attempt to "UPDATE YOUTUBE APP" it doesn't actually update it. If I uninstall and re-install YouTube, it simply re-installs the same version (version 1.0.5.4, updated on Mar 26, 2015, 8.62 MB). If I uninstall that, and search on Google Play Store for the com.google.android.youtube.googletv app recommended above, it doesn't find it - it only finds the first app.
You say "But installing of second app is very inconvenient for users." - I agree - it's so inconvenient, I can't figure out even how to do it.
Would you mind telling me how you did it?
Thank you,
Lloyd
su...@choco.media <su...@choco.media> #6
Any recommendations on how to implement youtube player on Android TV? I tried with a WebView and I got a white screen and my application just crashed after focusing the WebView
jn...@gmail.com <jn...@gmail.com> #7
No one have any information about this ? At least, know if is an error or other ?
se...@gmail.com <se...@gmail.com> #8
I have the same issue;
Nexus Player with android 5.1.1;
com.google.android.youtube.googletv is not installed (and can't be installed) and the youtube player api gives an error and suggests to update the youtube app.
Waiting for updates...
Nexus Player with android 5.1.1;
com.google.android.youtube.googletv is not installed (and can't be installed) and the youtube player api gives an error and suggests to update the youtube app.
Waiting for updates...
bo...@gmail.com <bo...@gmail.com> #9
Same problem here... Would be great to have a response from Google.
go...@gmail.com <go...@gmail.com> #11
Thanks shawns. But does it mean it's a bug and it will be fixed (The init error with Update Youtube App make me think that) or google don't want to allow Youtube Player API on Android TV ?
bh...@gmail.com <bh...@gmail.com> #12
any more word from y/t on the fix for this or timelines?
ad...@gmail.com <ad...@gmail.com> #13
Additionally, this problem is affecting end-users as well as developers.
I'm using the API for YouTube thumbnails, and am using the onInitializationFailure callback to detect failure. When a user recoverable error happens, the YouTube app linked to from the Dialog is "not available on this device". Very confusing for users, as they can clearly see that it is there.
@Override
public void onInitializationFailure(YouTubeThumbnailView view, YouTubeInitializationResult loader) {
if (loader.isUserRecoverableError()) {
loader.getErrorDialog(activity, code).show();
}
}
I'm using the API for YouTube thumbnails, and am using the onInitializationFailure callback to detect failure. When a user recoverable error happens, the YouTube app linked to from the Dialog is "not available on this device". Very confusing for users, as they can clearly see that it is there.
@Override
public void onInitializationFailure(YouTubeThumbnailView view, YouTubeInitializationResult loader) {
if (loader.isUserRecoverableError()) {
loader.getErrorDialog(activity, code).show();
}
}
tn...@gmail.com <tn...@gmail.com> #14
Youtube for google tv was replaced by youtube for android tv. so, I try to use YouTube Player API Reference for iframe Embeds and achieved most of all functions basically. But it seems working with a long delay and the style of the layer is not good.
So, do you have the new api for android tv?
and there the address for iframe api:
https://developers.google.com/youtube/iframe_api_reference
So, do you have the new api for android tv?
and there the address for iframe api:
sz...@gmail.com <sz...@gmail.com> #15
Hi everyone, thanks for the reports on this. The YouTubeAPI class is not supported on the Android TV platform, and there are no plans to add support for it at this time.
sz...@gmail.com <sz...@gmail.com> #16
For your information, I've created YoutubeTV library (https://github.com/bertrandmartel/youtubetv ), a wrapper library for YouTube Player API Reference for iframe Embeds
It provides a YoutubeTvView that embeds a Webview with Youtube iframe with all Javascript API available from this view.
Also, YoutubeTvFragment holds a YoutubeTvView with a media control bar (PlaybackOverlayFragment)
It provides a YoutubeTvView that embeds a Webview with Youtube iframe with all Javascript API available from this view.
Also, YoutubeTvFragment holds a YoutubeTvView with a media control bar (PlaybackOverlayFragment)
si...@gmail.com <si...@gmail.com> #17
So ma....@google, tell me please. I'm an end user, and I want to utilize My Amazon Echo thusly: "Alexa, turn on fireplace" and have it launch a YouTube fireplace video. You seem to be saying this cannot be done and will not be accommodated.
Are you folks aware of what's actually occurring out here in the world? This is the future, and can't be difficult to do. Please enable it.
Are you folks aware of what's actually occurring out here in the world? This is the future, and can't be difficult to do. Please enable it.
yo...@gmail.com <yo...@gmail.com> #18
gr...@gmail.com <gr...@gmail.com> #19
Hi, ma...@gmail.com - are there any revised plans to support YouTubeAPI class on the Android TV platform?
ch...@charliestigler.com <ch...@charliestigler.com> #20
Duration, publisher name, and view count are all necessary.
As a general rule, I'd say if we can't reproduce the YouTube search page using its API, something is wrong.
As a general rule, I'd say if we can't reproduce the YouTube search page using its API, something is wrong.
an...@gmail.com <an...@gmail.com> #21
Any progress on this? I'm still forced to keep my apps on v2 api because of this...
sh...@gmail.com <sh...@gmail.com> #22
Yes we need duration and view count as part of search response ASAP. It's a over head to create a separate request to fetch those with extra quota cost.
sh...@sasson.me <sh...@sasson.me> #23
I need it too. YT api 2.0 not working properly (not response data for some songs without any reason) when it'll be ready?
vi...@gmail.com <vi...@gmail.com> #24
Any update on this issue?
ka...@gmail.com <ka...@gmail.com> #25
please reply for the issues raised.
[Deleted User] <[Deleted User]> #26
Bump
tj...@gmail.com <tj...@gmail.com> #27
Seems like this is still not added... This seems like a glaring issue to me when building any application that uses Youtube search.
ni...@codevader.com <ni...@codevader.com> #28
This is a blocker for us with switching to v3. Performance is not good enough with having to do multiple requests.
ki...@gmail.com <ki...@gmail.com> #29
hi guys does any one here know how to get all the informations about a video (evrything)
ul...@google.com <ul...@google.com> #30
Bumped the priority of this request.
ul...@google.com <ul...@google.com> #31
With the results from your search request, you can get all video ids and merge them into a comma separated string, and use this string to set id of video.list request.
So with one additional request you will get all the infos of the search resulted videos and more information. It wouldn't affect your quota cost and traffic more than minimally.
So with one additional request you will get all the infos of the search resulted videos and more information. It wouldn't affect your quota cost and traffic more than minimally.
[Deleted User] <[Deleted User]> #32
But it's much slower! I spent the day redoing our app in the V3 API. It works, but our response times went from ~400-500ms to ~700-2000ms. It's probably 2-3x slower on average. And this is requesting only the information we need (using part and fields to eliminate all unnecessary fields).
I really don't think this deserves a WontFix. It's 2-3x slower (and requires twice the complexity of requests, more quota, and more traffic). For now we're sticking to the V2 API until it stops working.
I really don't think this deserves a WontFix. It's 2-3x slower (and requires twice the complexity of requests, more quota, and more traffic). For now we're sticking to the V2 API until it stops working.
[Deleted User] <[Deleted User]> #33
And in case you're wondering why that matters: to users, the difference between 400ms and 1200ms is HUGE. Jakob Nielsen's classic piece on the UX implications of response times (http://www.nngroup.com/articles/response-times-3-important-limits/ ) lists 1.0 second as "about the limit for the user's flow of thought to stay uninterrupted, even though the user will notice the delay.". Switching to the V3 API would break that flow.
hs...@gmail.com <hs...@gmail.com> #34
Won't fix! How did I know that was coming, API v3 is thumbs down from me, it's going backwards not forwards, I whole heartedly agree with char...@zaption.com the users will notice the time difference when your having two seperate calls to the API to get the video duration I had to do this there was a clear and noticable effect. Also for new programmers and people just using the API for fun makes it more work for them. Thanks YouTube API team, way to go! when you get around to API v4 in 2020 please consider sorting this out...
si...@gmail.com <si...@gmail.com> #35
[Comment deleted]
si...@gmail.com <si...@gmail.com> #36
See the problem #30 is, that there is a hard limit of 50 videos per request for information. I work with a system that while that limit may be rare, isn't outside the realm of possibilities.
I had to develop an automatic multi request queue system for a project of mine that may have upward of 65 videos on a page load. That 50 limit really messed me up.
-- for those interested in how I got around this while keeping requests low: I grab every video ID in my database, and make a big ol array of child arrays containing up to 50 video IDs at a time. I then loop through those and use the v3 api to acquire each videos data. I save the data acquires into a new dictionary/hash array, with the ID as a key. Once the loop is done and all requests are stored in my YouTube array, I serialize that array, and stash the information acquired in a cache server. I then setup a cron job to do this request every couple of hours to keep the data current.
Because the data is cached for every video, I no longer need to worry about acquiring YouTube data at run time, which keeps loading times really low and fast. Because the data is mass refreshed via a cron job instead of on request, means cache-slamming isn't going to happen. And because I can control how often the requests are made, I have absolute control over the Google api budgets so they never go overboard.
Of course, application is different for everybody, but this is how I got around all this malarkey.
I had to develop an automatic multi request queue system for a project of mine that may have upward of 65 videos on a page load. That 50 limit really messed me up.
-- for those interested in how I got around this while keeping requests low: I grab every video ID in my database, and make a big ol array of child arrays containing up to 50 video IDs at a time. I then loop through those and use the v3 api to acquire each videos data. I save the data acquires into a new dictionary/hash array, with the ID as a key. Once the loop is done and all requests are stored in my YouTube array, I serialize that array, and stash the information acquired in a cache server. I then setup a cron job to do this request every couple of hours to keep the data current.
Because the data is cached for every video, I no longer need to worry about acquiring YouTube data at run time, which keeps loading times really low and fast. Because the data is mass refreshed via a cron job instead of on request, means cache-slamming isn't going to happen. And because I can control how often the requests are made, I have absolute control over the Google api budgets so they never go overboard.
Of course, application is different for everybody, but this is how I got around all this malarkey.
ni...@codevader.com <ni...@codevader.com> #37
+1 on the above comments. Our response time on searches is now doubled. And just to retrieve two extra pieces of information (duration and view_count). And don't get me started on the loss of simple pagination.
ma...@gmail.com <ma...@gmail.com> #38
+1, it really makes no sense not to include those essential informations
ca...@gmail.com <ca...@gmail.com> #39
This needs to be included
ri...@gmail.com <ri...@gmail.com> #40
>Status: WontFix
I hope you get fired.
I hope you get fired.
sh...@sasson.me <sh...@sasson.me> #41
NEED IT ASAP +100
ca...@alpinedigitalgroup.com <ca...@alpinedigitalgroup.com> #42
...
an...@gmail.com <an...@gmail.com> #43
I can't believe that it's been 2 years since I've reported this and now that I'm forced to upgrade, I still have to modify the entire system just to get those damn durations.
To YouTube engineers, this is just a shame. Whoever took the decision to mark this as WontFix.. this issue should have been escalated to a project manager or something. Too many people depended on this..
I'm really disappointed on you, YouTube devs.
To YouTube engineers, this is just a shame. Whoever took the decision to mark this as WontFix.. this issue should have been escalated to a project manager or something. Too many people depended on this..
I'm really disappointed on you, YouTube devs.
pa...@gmail.com <pa...@gmail.com> #44
I've also held off upgrading to v3 these last 2 years for specifically this reason. The performance penalty of two requests is pretty harsh - it's not as if they can be run concurrently.
The YouTube devs have failed to give a good reason here for why this feature request is not practical to solve. However in one of the many other dups of this ticket, #4332, they say that it's because the response can also include channels & playlists - which wouldn't have a duration. That sounds plausible, except snippet fields specific to videos like "channelTitle" & "liveBroadcastContent" already appear in channel & playlist snippets for a search response.
Anyway, I think the real issue here is communication. This ticket is the highest rated "WontFix" for the project:https://code.google.com/p/gdata-issues/issues/list?can=1&sort=-stars&q=status:WontFix . I don't expect the product features to be run by democratic vote but it would be great to have clear reasoning explained when the developer community have collectively voiced their concerns.
The YouTube devs have failed to give a good reason here for why this feature request is not practical to solve. However in one of the many other dups of this ticket, #4332, they say that it's because the response can also include channels & playlists - which wouldn't have a duration. That sounds plausible, except snippet fields specific to videos like "channelTitle" & "liveBroadcastContent" already appear in channel & playlist snippets for a search response.
Anyway, I think the real issue here is communication. This ticket is the highest rated "WontFix" for the project:
na...@gmail.com <na...@gmail.com> #45
>Status: WontFix
I hope the new hired devs will take this seriously!!! what a shame for the youtube engineers! I'm an engineer and I could fix this if I were you!!! :@
I hope the new hired devs will take this seriously!!! what a shame for the youtube engineers! I'm an engineer and I could fix this if I were you!!! :@
jo...@gmail.com <jo...@gmail.com> #46
This is just idiotic.. I'm in the process of converting my joomla app to Api 3 but am pissed because I'm having a VERY hard time getting the duration... what a joke. WHY bother changing it and making it MORE difficult to use then NOT fix it?
[Deleted User] <[Deleted User]> #47
This is really stupid. I have to migrato v3 but it doesnt contain duration still. Please fix this issue asap
da...@gmail.com <da...@gmail.com> #48
Please correct this, i'm forced to make a synchronous api call for each video displayed only to get duration and my quota go down, and your server get more load, and user get a worst experience because it takes more time to retrieve information
var url1 = "https://www.googleapis.com/youtube/v3/videos?id= " + response.items[i].contentDetails.videoId + "&key=mykey&part=snippet,contentDetails";
$.ajax({
async: false,
type: 'GET',
url: url1,
success: function(data) {
if(data.items.length > 0){ //yes sometimes can return no video found, incredible!!!
setSometing = pttosec(data.items[0].contentDetails.duration)
}
}
});
This post have more then 1 year
var url1 = "
$.ajax({
async: false,
type: 'GET',
url: url1,
success: function(data) {
if(data.items.length > 0){ //yes sometimes can return no video found, incredible!!!
setSometing = pttosec(data.items[0].contentDetails.duration)
}
}
});
This post have more then 1 year
na...@gmail.com <na...@gmail.com> #49
Don't like this API v3.
Another important missing feature is "yt:hd" from v2 API.
Another important missing feature is "yt:hd" from v2 API.
[Deleted User] <[Deleted User]> #50
[Comment deleted]
ym...@gmail.com <ym...@gmail.com> #51
I usually just star feature request like these without voicing an opinion, but this case I believe v3 is a mess for developers. The API feels build up from your data's point of view instead of looking at what developers want in their data requests.
Without making this issue's thread into an overal v3 complains thread I only feel disappointed to what is offered and now forced upon us: its slow (!), its data is inconsistent, lacking crucial fields, lacking basic functionality, and overly complex in its ways.
Seriously, getting a username's own most viewed videos should be an easy task. Good luck making that work (without sorting, a hidden user "uploads channel id", etc.)
Without making this issue's thread into an overal v3 complains thread I only feel disappointed to what is offered and now forced upon us: its slow (!), its data is inconsistent, lacking crucial fields, lacking basic functionality, and overly complex in its ways.
Seriously, getting a username's own most viewed videos should be an easy task. Good luck making that work (without sorting, a hidden user "uploads channel id", etc.)
vi...@gmail.com <vi...@gmail.com> #52
+1
Now, in the API v3, I must execute 3 request (video list + duration + rating), instead of 1 by v2!
I think, it should be fixed, because we need to improve rather than worsen ours (and yours too) products!
Now, in the API v3, I must execute 3 request (video list + duration + rating), instead of 1 by v2!
I think, it should be fixed, because we need to improve rather than worsen ours (and yours too) products!
pa...@gmail.com <pa...@gmail.com> #53
Please change the status of this away from WontFix. Its making the use of the API much more complex, slow, and taxing on the Youtube system. You should be able to specify in fields whether you want to include this information or not in a single request.
ke...@gmail.com <ke...@gmail.com> #54
[Comment deleted]
ke...@gmail.com <ke...@gmail.com> #55
More traffic for google and more work for us #nosense
pa...@gmail.com <pa...@gmail.com> #56
Wish they would change this too
de...@gmail.com <de...@gmail.com> #57
So there wont be more info added into the api?
va...@gmail.com <va...@gmail.com> #58
The guy who decided to not include the duration in the response has no idea what developers need from a youtube api to build a decent piece of software.
io...@gmail.com <io...@gmail.com> #59
Feel forced to chime in on this one. PLEASE ADD DURATION!
in...@gmail.com <in...@gmail.com> #60
2 years and no changes
bu...@gmail.com <bu...@gmail.com> #61
You dont want to add duration, ok we got that, but for god's sake explain WHY??
ma...@googlemail.com <ma...@googlemail.com> #62
No duration... what another big fail of this v3 API! Cant belive, 'cause I'm waiting for this parameter for more than 2 years, too.
ok...@avekon.com <ok...@avekon.com> #63
it's so stupid we can't get duration with videos list from API
ge...@gmail.com <ge...@gmail.com> #64
Still doesn't shows the videoCount, likes, etc. That's a shame.
je...@gmail.com <je...@gmail.com> #65
[Comment deleted]
ms...@gmail.com <ms...@gmail.com> #67
Developers are worried due to lack of duration but no response from Google till now on this fix. Retrieving search results + duration is too slow and extra consume API. Duration format is annoying like PT4M13S. Anyone know how to convert duration to format like 04:13 instead of PT4M13S in PHP efficiently until Google do some updates?
ge...@gmail.com <ge...@gmail.com> #68
You can use regular expression /pt((\d+)h)?((\d+)m)?((\d+)s)?/gi to parse strings like PT4M13S
go...@gmail.com <go...@gmail.com> #69
You can also convert it to seconds:
/**
* @param string $iso8601DurationStr
* @return int
*/
function convertISO8601DurationToSeconds($iso8601DurationStr)
{
$interval = new \DateInterval($iso8601DurationStr);
// @note: the assumption that one year = 365 days and one month = 31 days is not the rightest one
// but I doubt that video duration can be more than some hours.
$seconds = $interval->y * (365 * 24 * 3600)
+ $interval->m * (31 * 24 * 3600)
+ $interval->d * (24 * 3600)
+ $interval->h * 3600
+ $interval->i * 60
+ $interval->s
;
return (int) $seconds;
}
and if you want your format you can use gmdate("H:i:s", $seconds) function
/**
* @param string $iso8601DurationStr
* @return int
*/
function convertISO8601DurationToSeconds($iso8601DurationStr)
{
$interval = new \DateInterval($iso8601DurationStr);
// @note: the assumption that one year = 365 days and one month = 31 days is not the rightest one
// but I doubt that video duration can be more than some hours.
$seconds = $interval->y * (365 * 24 * 3600)
+ $interval->m * (31 * 24 * 3600)
+ $interval->d * (24 * 3600)
+ $interval->h * 3600
+ $interval->i * 60
+ $interval->s
;
return (int) $seconds;
}
and if you want your format you can use gmdate("H:i:s", $seconds) function
je...@gmail.com <je...@gmail.com> #70
msalmanz: take a look on my simple script here https://github.com/JefferyHus/Youtube-API-V3
There is a simple way to convert time and date from youtube v3 Json response. Best luck
There is a simple way to convert time and date from youtube v3 Json response. Best luck
ms...@gmail.com <ms...@gmail.com> #71
Thanks for duration conversion help. Its also annoying point that output results are not what should be. I am looking for relevant results as shown on youtube.com but following URL : https://www.googleapis.com/youtube/v3/search?part=snippet&q=$search&maxResults=$count&key=$api_key output irrelevant results for multi language queries and sometime English results are not satisfied. How to retrieve relevant results? Main target is Music category. I was getting good results from v2 api.
ni...@gmail.com <ni...@gmail.com> #72
@Msalmanz... Try adding &videoCategoryId=10
ms...@gmail.com <ms...@gmail.com> #73
@ nixa... &videoCategoryId=10 not working also gives error invalidSearchFilter on google search list snippet page. Fixed multi language issue it was due to lack of proper keyword encoding fixed by adding .urlencode(str_replace('-', ' ', $_GET['q'])) in search query results are much better now.
ha...@gmail.com <ha...@gmail.com> #74
What pretty much everyone else in here said! :-O
How can this be a WontFix? Put the durations into contentDetails (and please as a number of seconds, while we are at it), it clearly belongs in there! It is flat out stupid (for your serverload, our code complexity and the users patience) to force us to make several API calls just to get a basic information like video duration! :-6
Don't call this a feature request, when it is obviously a bug! :(
How can this be a WontFix? Put the durations into contentDetails (and please as a number of seconds, while we are at it), it clearly belongs in there! It is flat out stupid (for your serverload, our code complexity and the users patience) to force us to make several API calls just to get a basic information like video duration! :-6
Don't call this a feature request, when it is obviously a bug! :(
[Deleted User] <[Deleted User]> #75
"Focus on the user and all else will follow"
"when we build new tools and applications, we believe they should work so well you don’t have to consider how they might have been designed differently"
Taken from:http://www.google.com/about/company/philosophy/
"when we build new tools and applications, we believe they should work so well you don’t have to consider how they might have been designed differently"
Taken from:
je...@gmail.com <je...@gmail.com> #76
msalmanz: would you like to put your v2 url callback so I can adapt it for you on the new API
er...@gmail.com <er...@gmail.com> #77
i make this code
//use api here
var published_date = data.items[0].snippet.publishedAt;
//convert Published time and date
var timeStr = published_date; var date = new Date(timeStr); var day = date.getDate(); var year = date.getFullYear(); var month = date.getMonth()+1; var C_Date = month+"/"+day+"/"+year;
//document.write(C_Date + "<br>");
function my(i) { if (i < 10) { i = "0" + i; } return i; }
var hour = my(date.getUTCHours()); var minit = my(date.getUTCMinutes()); var C_Time = hour+":"+minit;
//document.write(C_Time + "<br>");
//end convert time and date
thanks
//use api here
var published_date = data.items[0].snippet.publishedAt;
//convert Published time and date
var timeStr = published_date; var date = new Date(timeStr); var day = date.getDate(); var year = date.getFullYear(); var month = date.getMonth()+1; var C_Date = month+"/"+day+"/"+year;
//document.write(C_Date + "<br>");
function my(i) { if (i < 10) { i = "0" + i; } return i; }
var hour = my(date.getUTCHours()); var minit = my(date.getUTCMinutes()); var C_Time = hour+":"+minit;
//document.write(C_Time + "<br>");
//end convert time and date
thanks
me...@gmail.com <me...@gmail.com> #78
[Comment deleted]
ra...@gmail.com <ra...@gmail.com> #79
Not including the duration in search results seems to a hidden business agenda.
lu...@gmail.com <lu...@gmail.com> #80
if 10 result (include duration and view count) = 11 fetch api???????
very very stupid dev, 2 years no changes...
very very stupid dev, 2 years no changes...
ja...@gmail.com <ja...@gmail.com> #81
Well here we are, have been waiting for sanity to return to whomever decided that duration just wasn't that big of issue, and so should be ignored. (don't bother with it wasn't ignored, it was set to "wontfix") The developer community has asked for it, and yet, youtube, has decided in it's infinite wisdom to flip the developers the proverbial bird/middle finger/flying fickle finger of fate...
It's beyond ridiculous that an extra api call has to be made in order to get such a simple piece of data. I mean I hope you don't actually have to do 104 joins against 28 tables in order to extract the video's duration.
I really love the way the developers blog, went on and on, about how V3 was now ready to take over from V2... How ludicrous a blog entry that is.
V2 = ask for video information, and you get it
V3 = ask for video information, and you get "WontFix" (subliminally the good ole middle finger)
Oh well, back to doing this stupid conversion, oh wait, it's not a conversion, it's a downgrade.
Not even going to mention the idiotic Oauth2 (Click here, Go there, hold your breath, pray the user figures it out in a browser, comes back to the application, still has enough interest in the app to click again, to get some ridiculous token, and then if the Gods all smile, and it's Wednesday with a blue moon, to be slammed with a "WontFix"...
It's beyond ridiculous that an extra api call has to be made in order to get such a simple piece of data. I mean I hope you don't actually have to do 104 joins against 28 tables in order to extract the video's duration.
I really love the way the developers blog, went on and on, about how V3 was now ready to take over from V2... How ludicrous a blog entry that is.
V2 = ask for video information, and you get it
V3 = ask for video information, and you get "WontFix" (subliminally the good ole middle finger)
Oh well, back to doing this stupid conversion, oh wait, it's not a conversion, it's a downgrade.
Not even going to mention the idiotic Oauth2 (Click here, Go there, hold your breath, pray the user figures it out in a browser, comes back to the application, still has enough interest in the app to click again, to get some ridiculous token, and then if the Gods all smile, and it's Wednesday with a blue moon, to be slammed with a "WontFix"...
ma...@gmail.com <ma...@gmail.com> #83
+1 on this issue. My program stopped working when V2 was phased out, now v3 is lacking in some important features like duration.
ed...@gmail.com <ed...@gmail.com> #84
I have to get viewCount and duration using stats and contentDetails. I demand this values in search or video API call
ba...@gmail.com <ba...@gmail.com> #85
I want duration in v3 search please add it
jo...@gmail.com <jo...@gmail.com> #86
Well, since Google ain't fixing this, comment #10 is the best option so far.
Get a full list search in one call and then get all those ids duration from content details in another call following #10 API call. It's 2 calls only.
I hope this helps somebody.
Get a full list search in one call and then get all those ids duration from content details in another call following #10 API call. It's 2 calls only.
I hope this helps somebody.
de...@gmail.com <de...@gmail.com> #87
PTHMS into Regular Time Format
public static function trunctimes($input) {
preg_match('~T(.*?)H~', $input,$H);
preg_match('~H(.*?)M~', $input,$M);
preg_match('~M(.*?)S~', $input,$S);
preg_match('~T(.*?)M~', $input,$H1);
preg_match('~M(.*?)S~', $input,$H2);
preg_match('~T(.*?)S~', $input,$H3);
if ($H[1]>0)
{
$H[1] = str_pad($H[1], 1, '0', STR_PAD_LEFT);
$M[1] = str_pad($M[1], 2, '0', STR_PAD_LEFT);
$S[1] = str_pad($S[1], 2, '0', STR_PAD_LEFT);
$string = $H[1]. ":" .$M[1]. ":" .$S[1];
}
else if ($H1[1]>0 )
{
$H1[1] = str_pad($H1[1], 1, '0', STR_PAD_LEFT);
$H2[1] = str_pad($H2[1], 2, '0', STR_PAD_LEFT);
$string = $H1[1]. ":" .$H2[1];
}
else if ($H3[1]>0 )
{
$H3[1] = str_pad($H3[1], 2, '0', STR_PAD_LEFT);
$string = "0:".$H3[1];
}
return $string;
}
Example :http://www.youtube1234.com
public static function trunctimes($input) {
preg_match('~T(.*?)H~', $input,$H);
preg_match('~H(.*?)M~', $input,$M);
preg_match('~M(.*?)S~', $input,$S);
preg_match('~T(.*?)M~', $input,$H1);
preg_match('~M(.*?)S~', $input,$H2);
preg_match('~T(.*?)S~', $input,$H3);
if ($H[1]>0)
{
$H[1] = str_pad($H[1], 1, '0', STR_PAD_LEFT);
$M[1] = str_pad($M[1], 2, '0', STR_PAD_LEFT);
$S[1] = str_pad($S[1], 2, '0', STR_PAD_LEFT);
$string = $H[1]. ":" .$M[1]. ":" .$S[1];
}
else if ($H1[1]>0 )
{
$H1[1] = str_pad($H1[1], 1, '0', STR_PAD_LEFT);
$H2[1] = str_pad($H2[1], 2, '0', STR_PAD_LEFT);
$string = $H1[1]. ":" .$H2[1];
}
else if ($H3[1]>0 )
{
$H3[1] = str_pad($H3[1], 2, '0', STR_PAD_LEFT);
$string = "0:".$H3[1];
}
return $string;
}
Example :
Description
NOTE: Use this form ONLY if you are a DEVELOPER requesting enhancements to
the YouTube Data or Player APIs. If you are filing a general feature
request for the YouTube web site or another YouTube playback mechanism,
please use
--------------------------------------------------------------------------
Name of API affected:
YouTube Data API v3
Request summary:
Provide a brief summary of the the feature you'd like to see implemented.
"Duration" of video should be contained in the response when performing a simple search like this
I'm forced to use the v2 version because the lack of duration. I know I could retrieve it later, but I don't want another 30 api calls just to retreive duration of each result..
Notes:
Provide any additional information which might be useful here.