You are here

function media_sharestream_install in Media: ShareStream 7

Implements hook_install().

File

./media_sharestream.install, line 11
Install, update and uninstall functions for the Media: ShareStream module.

Code

function media_sharestream_install() {

  // Create initial display settings.
  module_load_include('inc', 'file_entity', 'file_entity.file_api');
  $existing_display = file_displays_load('video', 'default');
  if (empty($existing_display)) {

    // Video previews should be displayed using a large filetype icon.
    $display = array(
      'api_version' => 1,
      'name' => 'video__default__media_sharestream_video',
      'weight' => 0,
      'status' => 1,
      'settings' => array(
        'width' => '420',
        'height' => '315',
        'autoplay' => 0,
      ),
    );
    file_display_save((object) $display);
    $display = array(
      'api_version' => 1,
      'name' => 'video__preview__media_sharestream_image',
      'weight' => 0,
      'status' => 1,
      'settings' => array(
        'image_style' => 'media_thumbnail',
      ),
    );
    file_display_save((object) $display);
  }

  /**
   * Implements hook_uninstall().
   */
  function media_sharestream_uninstall() {

    // Remove variables.
    variable_del('media_sharestream_server');
  }
}