Class: StreamAPI::Embed

Inherits:
Object
  • Object
show all
Defined in:
lib/streamapi/embed.rb

Class Method Summary collapse

Class Method Details

.to_html(private_host_id, public_host_id, site_id, theme) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/streamapi/embed.rb', line 4

def self.to_html(private_host_id, public_host_id, site_id, theme)
  embed_code = <<-EOF
  <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" 
  width="#{theme['width']}" height="#{theme['height']}" id="liveStream" align="">
  <PARAM name="movie" value="http://static.streamapi.com/flash/loader.swf?app=custom.swf&1247246891974">
  <PARAM name="FlashVars" value="siteID=#{site_id}&publicHostID=#{public_host_id}
  &layoutPath=#{theme['layout_path']}
  &skinPath=#{theme['skin_path']}
  &privateHostID=#{theme['private_host_id']}&userType=host&">
  <PARAM name="allowScriptAccess" value="always">
  <PARAM name="allowFullScreen" value="true">
  <PARAM name="quality" value="high">
  <PARAM name="bgcolor" value="#000000">
  <PARAM name="scale" value="noscale">
  <PARAM name="wmode" value="transparent">
  <embed src="http://static.streamapi.com/flash/loader.swf?app=custom.swf&1247246891974" 
  FlashVars="siteID=#{site_id}&publicHostID=#{public_host_id}
  &layoutPath=#{theme['layout_path']}
  &skinPath=#{theme['skin_path']}
  &privateHostID=#{theme['private_host_id']}&userType=host&" 
  allowScriptAccess="always" allowFullScreen="true" width="#{theme['width']}" height="#{theme['height']}" scale="noscale" 
  wmode="transparent" quality="high" bgcolor="#000000" type="application/x-shockwave-flash" >
  </embed>
  </OBJECT>
      <div id="player_container"></div>

      <script type="text/javascript" 
      	src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>

      <script type="text/javascript">
         swfobject.embedSWF("http://static.streamapi.com/flash/loader.swf", "player_container", 
         						"#{theme['width']}", "#{theme['height']}", "9", "", {
              'app' : 'custom.swf',
              'siteID' : '#{site_id}',
              'publicHostID' : '#{public_host_id}',
              'layoutPath' : '#{theme['layout_path']}',
              'skinPath' : '#{theme['skin_path']}',
              'privateHostID' : '#{theme['private_host_id']}',
              'userType' : 'host'
          }, {
              allowfullscreen: "true",
              allowscriptaccess: "true"
          });
      </script type="text/javascript">
  EOF
  
  embed_code
end