Sha256: d5572311b790edb2daabd1d491a6b99dd7b93d8b2a027ca2226f354fafd29d4e

Contents?: true

Size: 547 Bytes

Versions: 43

Compression:

Stored size: 547 Bytes

Contents

module Ddr
  module Streamable
    extend ActiveSupport::Concern

    included do
      attribute :streamable_media, Ddr::File.optional
    end

    def streamable_media_type
      streamable_media&.media_type
    end

    # This method is used in dul-hydra 'ComponentsController' and ddr-public 'StreamController'
    def streamable_media_extension
      if filename = streamable_media&.original_filename
        ::File.extname(filename)
      end
    end

    def streamable_media_path
      streamable_media&.file&.disk_path
    end

  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
ddr-core-1.17.0 app/models/concerns/ddr/streamable.rb
ddr-core-1.16.0 app/models/concerns/ddr/streamable.rb
ddr-core-1.15.0 app/models/concerns/ddr/streamable.rb
ddr-core-1.14.0 app/models/concerns/ddr/streamable.rb
ddr-core-1.13.2 app/models/concerns/ddr/streamable.rb
ddr-core-1.13.1 app/models/concerns/ddr/streamable.rb
ddr-core-1.13.0 app/models/concerns/ddr/streamable.rb
ddr-core-1.12.2 app/models/concerns/ddr/streamable.rb
ddr-core-1.12.1 app/models/concerns/ddr/streamable.rb
ddr-core-1.12.0 app/models/concerns/ddr/streamable.rb
ddr-core-1.11.0 app/models/concerns/ddr/streamable.rb
ddr-core-1.10.0 app/models/concerns/ddr/streamable.rb
ddr-core-1.9.0 app/models/concerns/ddr/streamable.rb
ddr-core-1.8.0 app/models/concerns/ddr/streamable.rb
ddr-core-1.7.0 app/models/concerns/ddr/streamable.rb
ddr-core-1.6.6 app/models/concerns/ddr/streamable.rb
ddr-core-1.6.5 app/models/concerns/ddr/streamable.rb
ddr-core-1.6.4 app/models/concerns/ddr/streamable.rb
ddr-core-1.6.3 app/models/concerns/ddr/streamable.rb
ddr-core-1.6.2 app/models/concerns/ddr/streamable.rb