Viewing 1 replies (of 1 total)
  • Thread Starter Dinho78

    (@dinho78)

    Figured it out myself.

    In the easy-video.php file, replace the Get video link section with:

    /**
     * Get video link.
     */
    function ev_video_link($url) {
    	if (strpos($url, 'vimeo.com') !== false) {
    	    $link = '//player.vimeo.com/video/'.substr ( parse_url( $url, PHP_URL_PATH ), 1 ).'?title=0&byline=0&portrait=0&color=f22929';
    
    	} elseif (strpos($url, 'dailymotion.com') !== false) {
    		$id = strtok(basename($url), '_');
    		$link = 'https://www.dailymotion.com/embed/video/' . $id . '' ;
    
    	} else {
    		parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars );
    		$link = '//www.youtube.com/embed/' . $my_array_of_vars['v'] . '?rel=0';
    	}
    
    	return $link;
    }

    And replace the Get video image section with:

    /**
     * Get video image.
     */
    
    function ev_video_image($url) {
    
    	if (strpos($url, 'vimeo.com') !== false) {
    	    $hash = unserialize(file_get_contents('https://vimeo.com/api/v2/video/'.substr ( parse_url( $url, PHP_URL_PATH ), 1 ).'.php'));
    	    $link = $hash[0]['thumbnail_medium'];
    
    	} elseif (strpos($url, 'dailymotion.com') !== false) {
    		$id = strtok(basename($url), '_');
    		$link = 'https://www.dailymotion.com/thumbnail/video/' . $id . '' ;
    
    	} else {
    		parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars );
    		$link = 'https://img.youtube.com/vi/' . $my_array_of_vars['v'] . '/0.jpg';
    	}
    
    	return $link;
    }

    Now you past url’s like https://www.dailymotion.com/video/x1b6fu_mark-morrison-return-of-the-mack_music and it will fetch the screenshot and play the video. ??

Viewing 1 replies (of 1 total)
  • The topic ‘Dailymotion’ is closed to new replies.