From a16c5e5ef1c8cca5de59df098b9afec2622c2490 Mon Sep 17 00:00:00 2001 From: sunil-ca <31904334+sunil-ca@users.noreply.github.com> Date: Mon, 18 Sep 2017 22:20:18 -0400 Subject: [PATCH] Update bc-papi.php Search video method has been added. Ref: https://support.brightcove.com/overview-playback-api#Search_videos --- bc-papi.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bc-papi.php b/bc-papi.php index 8840275..5381ccd 100644 --- a/bc-papi.php +++ b/bc-papi.php @@ -129,6 +129,18 @@ public function find($call, $type = 'videos', $id = NULL) return $this->getData($url); } + + /** + * @param string $type + * @param string $terms (e.g. tags:sea,mammal or tags:nature,name:nature) + * @param string $sort (default - "updated_at", OTHER - "name", "reference_id", "created_at", "published_at", "schedule_starts_at", "schedule_ends_at", "state", "plays_total", "plays_trailing_week") + * @return object + */ + public function search($type = 'videos', $terms = '', $sort='updated_at') + { + $url = $this->url_read . $this->bc_account . '/' . $type . '?q='. $terms.'&sort='.$sort; + return $this->getData($url); + } /** @@ -398,4 +410,4 @@ class BCPAPIInvalidProperty extends BCPAPIException{} class BCPAPIInvalidType extends BCPAPIException{} class BCPAPITokenError extends BCPAPIException{} -?> \ No newline at end of file +?>