album_id * * @return bool|object */ public function get_album_info( $album_id ) { $url = 'https://api.vimeo.com/albums/' . $album_id; $data = $this->fetch_remote( $url ); if ( $data && is_object( $data ) ) { return (object) array( 'title' => $data->name, 'description' => $data->description, 'username' => $data->user->name, ); } return false; } /** * Filters attribute * * @param $attrs * * @return mixed */ public function filter_attrs( $attrs ) { if ( ! empty( $attrs['videos'] ) ) { $videos = &$attrs['videos']; $videos = explode( "\n", $videos ); $videos = array_map( array( $this, 'get_video_ID' ), $videos ); } if ( ! empty( $attrs['playlist_url'] ) ) { $attrs['playlist_url'] = $this->get_album_ID( $attrs['playlist_url'] ); } return $attrs; } /** * Returns video id from URL * * @param $vimeo_url * * @return mixed */ protected function get_video_ID( $vimeo_url ) { $vimeo_url = trim( str_replace( '&', '&', $vimeo_url ) ); if ( preg_match( '#^(?: https? \: )? (?: //)? w* \.? vimeo \.com /* ([^\s]+)$#ix', $vimeo_url, $matched ) ) { return $matched[1]; } else { $video_ID = &$vimeo_url; return $video_ID; } } /** * Returns album ID from URL * * @param $vimeo_album_url * * @return mixed */ protected function get_album_ID( $vimeo_album_url ) { if ( preg_match( '#^(?: https? \: )? (?: //)? w* \.? vimeo \.com /*album/* ([^\s]+)$#ix', $vimeo_album_url, $matched ) ) { return $matched[1]; } return $vimeo_album_url; } /** * Returns playlist/album info * * @param $play_list_id * * @param int $limit * * @return array|bool */ public function get_playlist_videos_info( $play_list_id, $limit = 50 ) { return $this->get_album_videos_info( $play_list_id ); } /** * Fetches album info from Vimeo * * @param $album_id * * @return array|bool */ public function get_album_videos_info( $album_id ) { if ( empty( $album_id ) ) { return false; } $url = 'https://api.vimeo.com/albums/' . $album_id . '/videos'; $data = $this->fetch_remote( $url ); if ( $data && isset( $data->data ) && is_array( $data->data ) ) { $videos_info = array(); foreach ( $data->data as $video ) { $video_id = $this->get_video_ID( $video->link ); $videos_info[ $video_id ] = array( 'title' => $video->name, // 'description' => $video->description, 'thumbnails' => $this->prepare_thumbnails( $video->pictures->sizes ), 'duration' => (int) $video->duration, ); } return $videos_info; } return false; } /** * Prepares thumbnails * * @param $sizes * * @return bool|\stdClass */ private function prepare_thumbnails( $sizes ) { if ( empty( $sizes ) || ! is_array( $sizes ) ) { return false; } $sizes_name = array( 0 => 'default', 1 => 'small', 2 => 'medium', 3 => 'high', 4 => 'xhigh', 5 => 'standard', 6 => 'large', 7 => 'xlarge', 8 => 'huge', 9 => 'xhuge', ); $result = new stdClass(); usort( $sizes, array( $this, '_sort_by_width' ) ); $max_resolution = array_pop( $sizes ); $result->maxres = array( 'url' => $max_resolution->link, 'width' => $max_resolution->width, 'height' => $max_resolution->height, ); foreach ( $sizes as $index => $size ) { $sz_index = floor( $size->width / 100 ) - 1; if ( isset( $sizes_name[ $sz_index ] ) ) { $sz_name = &$sizes_name[ $sz_index ]; $result->$sz_name = array( 'url' => $size->link, 'width' => $size->width, 'height' => $size->height, ); } } return $result; } /** * Handy function for usort * * @param $a * @param $b * * @return bool */ private function _sort_by_width( $a, $b ) { return $a->width > $b->width; } /** * Handy function for default frame url * * @param $attrs * * @return string */ public function default_frame_url( $attrs ) { return 'https://player.vimeo.com/video/{video-id}?autoplay=0'; } /** * Handy function for video frame URL * * @param $attrs * * @return string */ public function change_video_frame_url( $attrs ) { return 'https://player.vimeo.com/video/{video-id}?autoplay=1'; } } Health Archives - Page 18 of 75 - PushAsRx Athletic Training Centers El Paso, TX
Mission Spine Injury Clinic
11860 Vista Del Sol, Ste 128
P: 915-412-6677

Health

Taking Naps: The Benefits of Improved Mood and Alertness

Could regular daytime naps help individuals slow the aging process from natural brain shrinkage? Taking Naps Research and experts suggest… Read More

December 11, 2024

MET & Back Pain: A Detailed Overview of Causes and Management

Can individuals experiencing back pain from various factors incorporate MET (muscle energy techniques) to restore mobility? Factors That Causes Back… Read More

December 6, 2024

Waking Up with Heartburn: What You Need to Know

Individuals who wake up with a burning feeling in the chest or throat, along with a bitter taste, more than… Read More

December 5, 2024

The Relationship Between Sleep Disturbances and Muscle Function

Can individuals receive a full night's rest by recognizing sleep disturbances to only get proper muscle function and improve their… Read More

November 22, 2024

Understanding the Importance of Nutrients That the Body Needs

Individuals don't have to memorize or overthink every vitamin, mineral, or macronutrient. Can having a basic understanding of the role… Read More

November 13, 2024

A Comprehensive Guide to Psoriatic Arthritis Causes and Treatment

Can individuals dealing with psoriatic arthritis find non-surgical treatments to reduce joint pain and improve skin health? Introduction The body… Read More

November 8, 2024

The Power of L-Theanine: Reducing Stress and Improving Brain Health

Can individuals incorporate the beneficial properties of l-theanine into their routines to reduce stress and improve brain function? Introduction More… Read More

November 6, 2024

Nerve Injuries: Causes, Symptoms, and Treatment Approaches

Can individuals with nerve injuries incorporate non-surgical treatments to reduce pain sensations and restore motor function to their bodies? Introduction… Read More

November 4, 2024

Turmeric for Joints: Unlocking its Beneficial Properties

Can individuals dealing with joint pain incorporate turmeric as part of their treatment to reduce inflammation and restore joint health?… Read More

October 31, 2024

How to Raise Your Vitamin C Levels Naturally

Can individuals incorporate ways to increase their vitamin C levels to boost their immune system against cold and flu season?… Read More

October 30, 2024

Bioidentical Hormone Replacement Therapy: Part 2

Can hormone replacement therapy provide relief by replenishing lost hormones in menopausal women and in men to restore their body… Read More

October 25, 2024

Bioidentical Hormone Replacement Therapy: Part 1 – A Comprehensive Overview

Can bioidentical hormone replacement therapy can help many individuals dealing with pain and fatigue while regulating hormone function? Introduction Many… Read More

October 23, 2024

Turning Fat into Energy: Understanding its Role in the Body

How is fat turned into energy to be used as fuel for individuals working to improve their health and physical… Read More

October 17, 2024

Achieve Your Fitness Goals with Beginner Workouts

Can beginner workouts help individuals who want to improve their health by helping them lose weight and improve their quality… Read More

October 11, 2024

Why Staying Hydrated is Essential for Your Well-Being

Can individuals maintain proper hydration levels in their bodies to prevent spinal pain and other musculoskeletal conditions? Introduction When making… Read More

October 10, 2024

Personal Injury, Trauma & Spine Rehab Specialists

Online History & Registration 🔘
Call Us Today 🔘