youtube zend api: เพียงผลลัพธ์สั้นกว่า n นาที

ฉันต้องการให้ข้อความค้นหาของฉันแสดงเฉพาะในวิดีโอที่สั้นกว่าตัวอย่าง 7 นาที เป็นไปได้ไหม?

ขณะนี้ฉันใช้สิ่งนี้:

$yt = new Zend_Gdata_YouTube();
$yt->setMajorProtocolVersion(2);
$query = $yt->newVideoQuery();
$query->setOrderBy('relevance');
$query->setSafeSearch('none');
$query->setVideoQuery($searchTerms);

// Note that we need to pass the version number to the query URL function
// to ensure backward compatibility with version 1 of the API.
$videoFeed = $yt->getVideoFeed($query->getQueryUrl(2));

เอกสารบอกว่ามีพารามิเตอร์ "duration": https://developers.google.com/youtube/2.0/reference?hl=de#durationsp

แต่น่าเสียดายที่ฉันไม่มีโชคด้วย

$query->setDuration('short');

แต่นั่นก็คงไม่เป็นเช่นนั้นอยู่ดี ในขณะที่มันค้นหาวิดีโอที่สั้นกว่าสี่นาที

มีความคิดอะไรบ้าง?

คริส


person Chris Pillen    schedule 10.08.2012    source แหล่งที่มา


คำตอบ (1)


ฉันคิดว่าคุณอาจต้องการลอง $query->setSeconds(240);

ฉันพบข้อมูล : Zend_Gdata_YouTube_Extension_Duration และ การโต้ตอบกับ จีดาต้า

ขอให้โชคดี.

person RockyFord    schedule 11.08.2012
comment
ขอโทษ. ไม่ทำงาน, ไม่เป็นผล. ฉันช่วยตัวเองโดยใช้ javascript api และข้ามวิดีโอไปเลยหากวิดีโอมีความยาวมากกว่า x วินาที - person Chris Pillen; 20.08.2012