Function __global->is_audio

Definitions

sources/images.php

  • Find whether the video specified is actually audio, based on file extension.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$name string No No required parameter N/A N/A A URL or file path to the video
$as_admin boolean No No required parameter N/A N/A Whether there are admin privileges, to render dangerous media types (client-side risk only)
$definitive_over_video boolean No No False N/A N/A Whether to favour "no" if it could also be a format with video in it

Returns

  • Whether the string pointed to a file appeared to be an audio file
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Find whether the video specified is actually audio, based on file extension.
 *
 * @param  string $name A URL or file path to the video
 * @param  boolean $as_admin Whether there are admin privileges, to render dangerous media types (client-side risk only)
 * @param  boolean $definitive_over_video Whether to favour "no" if it could also be a format with video in it
 * @return boolean Whether the string pointed to a file appeared to be an audio file
 */

function is_audio(string $name, bool $as_admin, bool $definitive_over_video = false) : bool