Sha256: 5f958dd906570ee7cc7f9c20aa32d9690e6b916ceabb0b4345016c7a9d4401a4
Contents?: true
Size: 793 Bytes
Versions: 37
Compression:
Stored size: 793 Bytes
Contents
=begin rdoc A module that provides OEmbed functionality to any Videojuicer::Resource model. =end module Videojuicer module Resource module Embeddable OEMBED_ENDPOINT = "/oembed".freeze def oembed_payload(maxwidth, maxheight) proxy = proxy_for(config) result = proxy.get(OEMBED_ENDPOINT, :format=>"json", :url=>"#{proxy.host_stub}#{resource_path}?seed_name=#{seed_name}", :maxwidth=>maxwidth, :maxheight=>maxheight) JSON.parse(result.body) end def embed_size(maxwidth, maxheight) p = oembed_payload(maxwidth, maxheight) return p["width"], p["height"] end def embed_code(maxwidth, maxheight) oembed_payload(maxwidth, maxheight)["html"] end end end end
Version data entries
37 entries across 37 versions & 2 rubygems