Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class videoplayer extends obj

Hide Inherited MembersUser Interface
Description
No description.
 
Constants
No constants.
 
Properties
publicconfig[ videoplayer ]
protected_container_id[ videoplayer ]
protected_dirty[ obj ]
protected_height[ videoplayer ]
protected_id[ videoplayer ]
protected_onBufferFlush[ videoplayer ]
protected_onBufferFull[ videoplayer ]
protected_onClipChanged[ videoplayer ]
protected_onClipDone[ videoplayer ]
protected_onCuePoint[ videoplayer ]
protected_onLoadBegin[ videoplayer ]
protected_onMetaData[ videoplayer ]
protected_onPause[ videoplayer ]
protected_onPlay[ videoplayer ]
protected_onResume[ videoplayer ]
protected_onStartBuffering[ videoplayer ]
protected_onStop[ videoplayer ]
protected_onStreamNotFound[ videoplayer ]
protected_playlist[ videoplayer ]
publicproperty_objects_array[ obj ]
publicstyle[ videoplayer ]
protected_width[ videoplayer ]
 
Methods
public__construct ( width , height , config [Array] , playlist )[ videoplayer ]
Parameters
optionalwidth
optionalheight
optionalconfig [Array]
optionalplaylist
Code
025  public function __construct($__width=null, $__height=null, $__config=array(), $__playlist=null)
026  {
027      $this->container_id = unique();
028      $this->id = unique();
029      $this->style = array();
030      $this->width = $__width;
031      $this->height = $__height;
032      $this->playlist = is_null($__playlist) ? new playlist() : $__playlist;
033      $this->config = array_merge(
034          array(
035          "configFileName"=>null,
036          "rtmpConfigUrl"=>null,
037          "rtmpConfigParam"=>null,
038          "videoFile"=>null,
039          "noVideoClip"=>null,
040          "playList"=>$this->playlist,
041          "showPlayListButtons"=>null,
042          "streamingServerURL"=>null,
043          "liveStream"=>null,
044          "baseURL"=>null,
045          "streamingServer"=>null,
046          "thumbsOnFLV"=>null,
047          "thumbs"=>null,
048          "thumbLocation"=>null,
049          "autoPlay"=>null,
050          "autoBuffering"=>null,
051          "startingBufferLength"=>null,
052          "bufferLength"=>null,
053          "loop"=>null,
054          "autoRewind"=>null,
055          "showLoopButton"=>null,
056          "videoHeight"=>null,
057          "controlsWidth"=>null,
058          "initialScale"=>null,
059          "showMenu"=>false,
060          "hideControls"=>null,
061          "skinImagesBaseURL"=>null,
062          "useEmbeddedButtonImages"=>null,
063          "splashImageFile"=>null,
064          "scaleSplash"=>null,
065          "progressBarColor1"=>null,
066          "progressBarColor2"=>null,
067          "bufferBarColor1"=>null,
068          "bufferBarColor2"=>null,
069          "progressBarBorderColor1"=>null,
070          "progressBarBorderColor2"=>null,
071          "bufferingAnimationColor"=>null,
072          "controlsAreaBorderColor"=>null,
073          "timeDisplayFontColor"=>null,
074          "progressBarHeight"=>null,
075          "progressBarAreaHeight"=>null,
076          "authFileName"=>null,
077          "fullScreenScriptURL"=>null,
078          "menuItems"=>"[false,false,false,false,false,true]",
079          "showFullScreenButton"=>null,
080          "useNativeFullScreen"=>null,
081          "controlBarGloss"=>null,
082          "showVolumeSlider"=>false,
083          "showStopButton"=>true,
084          "showScrubber"=>true
085          ),
086          $__config
087      );
088      $this->onClipDone = null;
089      $this->onClipChanged = null;
090      $this->onLoadBegin = null;
091      $this->onStreamNotFound = null;
092      $this->onPlay = null;
093      $this->onStop = null;
094      $this->onPause = null;
095      $this->onResume = null;
096      $this->onCuePoint = null;
097      $this->onStartBuffering = null;
098      $this->onBufferFull = null;
099      $this->onBufferFlush = null;
100      $this->onMetaData = null;
101  }
public__get ( p )[ obj ]
Parameters
requiredp
Code
007  public function __get($p)
008  {
009      $methods = get_class_methods($this);
010      $properties = get_object_vars($this);
011      if (in_array("get_$p",$methods))
012      {
013          return $this->{"get_$p"}();
014      }
015      else if (array_key_exists("_$p",$properties))
016      {
017          return $this->{"_$p"};
018      }
019      else if (in_array("get_" . substr($p,strpos($p,"_")+1), $methods))
020      {
021          return $this->{"get_" . substr($p,strpos($p,"_")+1)}(substr($p,0,strpos($p,"_")));
022      }
023      else
024      {
025          trigger_error("This object [" . get_class($this) . ":$this->id] has no private property '_$p' for the requested public property '$p'",E_USER_WARNING);
026          return null;
027      }
028  }
publicget_array ( )[ obj ]
Parameters
No parameters for this method
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicget_classname ( )[ obj ]
Parameters
No parameters for this method
Code
086  public function get_classname()
087  {
088      return get_class($this);
089  }
publicget_config_string ( )[ videoplayer ]
Parameters
No parameters for this method
Code
125  public function get_config_string()
126  {
127      if (is_array($this->config))
128      {
129          $props = array();
130          foreach ($this->config as $k=>$v)
131          {
132              if (is_null($v))
133              {
134                  continue;
135              }
136              switch ($k)
137              {
138                  case "configFileName" :
139                  case "rtmpConfigUrl" :
140                  case "rtmpConfigParam" :
141                  case "videoFile" :
142                  case "streamingServerURL" :
143                  case "baseURL" :
144                  case "streamingServer" :
145                  case "initialScale" :
146                  case "skinImagesBaseURL" :
147                  case "splashImageFile" :
148                  case "authFileName" :
149                  case "fullScreenScriptURL" :
150                  case "controlBarGloss" :
151                      $props[] = "$k:'$v'";
152                      break;
153                  case "noVideoClip" :
154                  case "thumbs" :
155                  case "startingBufferLength" :
156                  case "bufferLength" :
157                  case "videoHeight" :
158                  case "controlsWidth" :
159                  case "progressBarColor1" :
160                  case "progressBarColor2" :
161                  case "bufferBarColor1" :
162                  case "bufferBarColor2" :
163                  case "progressBarBorderColor1" :
164                  case "progressBarBorderColor2" :
165                  case "bufferingAnimationColor" :
166                  case "controlsAreaBorderColor" :
167                  case "timeDisplayFontColor" :
168                  case "progressBarHeight" :
169                  case "progressBarAreaHeight" :
170                  case "menuItems" :
171                      $props[] = "$k:$v";
172                      break;
173                  case "showPlayListButtons" :
174                  case "liveStream" :
175                  case "thumbsOnFLV" :
176                  case "autoPlay" :
177                  case "autoBuffering" :
178                  case "loop" :
179                  case "autoRewind" :
180                  case "showLoopButton" :
181                  case "showMenu" :
182                  case "hideControls" :
183                  case "useEmbeddedButtonImages" :
184                  case "scaleSplash" :
185                  case "showFullScreenButton" :
186                  case "useNativeFullScreen" :
187                  case "showVolumeSlider" :
188                  case "showStopButton" :
189                  case "showScrubber" :
190                      $props[] = "$k:" . ($v ? "true" : "false");
191                      break;
192                  case "playList" :
193                      $props[] = "playList:$this->playlist";
194                      break;
195                  default:
196                      $props[] = "$k:" . ($v ? "true" : "false");
197                      break;
198              }
199          }
200          return (count($props)>0 ? "{" . implode(",",$props) . "}" : null);
201      }
202      else
203      {
204          return $this->config;
205      }
206  }
publicget_dirty ( )[ obj ]
Parameters
No parameters for this method
Code
063  public function get_dirty()
064  {
065      if ($this->id === 0)
066      {
067          $this->_dirty = true;
068      }
069      else
070      {
071          foreach (get_object_vars($this) as $k=>$v)
072          {
073              if ($this->_dirty)
074              {
075                  break;
076              }
077              if (preg_match('/_dirty$/',$k))
078              {
079                  $this->_dirty = $this->_dirty || $v;
080              }
081          }
082      }
083      return $this->_dirty;
084  }
publicget_json ( )[ obj ]
Parameters
No parameters for this method
Code
101  public function get_json()
102  {
103      $class = new ReflectionClass($this->classname);
104      $methods = $class->getMethods();
105      usort($methods,"sort_reflection_objects");
106      $accessors = array();
107      foreach ($methods as $index=>$method)
108      {
109          $declarer = $method->getDeclaringClass()->name;
110          if (preg_match('/^(get|set|)_(.+)$/',$method->name,$matches))
111          {
112              $accessor = $matches[2];
113              $getset = $matches[1];
114              eval("\$accessors[\$accessor] = \$this->".$accessor.";");
115          }
116      }
117      //return json_encode($this->get_array());
118      return json_encode($accessors);
119  }
publicget_properties ( )[ obj ]
Parameters
No parameters for this method
Code
121  public function get_properties()
122  {
123      return array_keys($this->array);
124  }
protectedget_string ( )[ obj ]
Parameters
No parameters for this method
Code
091  protected function get_string()
092  {
093      return method_exists($this,"__toString") ? $this->__toString() : null;
094  }
publicget_style_string ( )[ videoplayer ]
Parameters
No parameters for this method
Code
115  public function get_style_string()
116  {
117      $styles = array();
118      foreach ($this->style as $k=>$v)
119      {
120          $styles[] = "$k:$v";
121      }
122      return (count($styles)>0 ? implode(";",$styles) . ";" : null);
123  }
publicrender ( )[ videoplayer ]
Parameters
No parameters for this method
Code
208  public function render()
209  {
210      $s  = "<div id=\"$this->container_id\" style=\"$this->style_string\">&nbsp;</div>";
211      $s .= javascript("var flowplayer = flashembed('$this->container_id', {src:'" . WEBROOT . "images/FlowPlayerDark.swf',height:'$this->height',width:'$this->width'}, {config:$this->config_string});");
212      $s .= javascript("
213          temp = window.onClipDone;
214          window.onClipDone = function(clip) {
215              if (typeof temp == 'function') { temp(); }
216              var p = document.getElementById('$this->container_id').firstChild;
217              $this->onClipDone
218          };
219          temp = window.onClipChanged;
220          window.onClipChanged = function(clip) {
221              if (typeof temp == 'function') { temp(); }
222              var p = document.getElementById('$this->container_id').firstChild;
223              $this->onClipChanged
224          };
225          temp = window.onLoadBegin;
226          window.onLoadBegin = function(clip) {
227              if (typeof temp == 'function') { temp(); }
228              var p = document.getElementById('$this->container_id').firstChild;
229              $this->onLoadBegin
230          };
231          temp = window.onStreamNotFound;
232          window.onStreamNotFound = function(clip) {
233              if (typeof temp == 'function') { temp(); }
234              var p = document.getElementById('$this->container_id').firstChild;
235              $this->onStreamNotFound
236          };
237          temp = window.onPlay;
238          window.onPlay = function(clip) {
239              if (typeof temp == 'function') { temp(); }
240              var p = document.getElementById('$this->container_id').firstChild;
241              $this->onPlay
242          };
243          temp = window.onStop;
244          window.onStop = function(clip) {
245              if (typeof temp == 'function') { temp(); }
246              var p = document.getElementById('$this->container_id').firstChild;
247              $this->onStop
248          };
249          temp = window.onPause;
250          window.onPause = function(clip) {
251              if (typeof temp == 'function') { temp(); }
252              var p = document.getElementById('$this->container_id').firstChild;
253              $this->onPause
254          };
255          temp = window.onResume;
256          window.onResume = function(clip) {
257              if (typeof temp == 'function') { temp(); }
258              var p = document.getElementById('$this->container_id').firstChild;
259              $this->onResume
260          };
261          temp = window.onCuePoint;
262          window.onCuePoint = function(cuePoint) {
263              if (typeof temp == 'function') { temp(); }
264              var p = document.getElementById('$this->container_id').firstChild;
265              $this->onCuePoint
266          };
267          temp = window.onStartBuffering;
268          window.onStartBuffering = function(clip) {
269              if (typeof temp == 'function') { temp(); }
270              var p = document.getElementById('$this->container_id').firstChild;
271              $this->onStartBuffering
272          };
273          temp = window.onBufferFull;
274          window.onBufferFull = function(clip) {
275              if (typeof temp == 'function') { temp(); }
276              var p = document.getElementById('$this->container_id').firstChild;
277              $this->onBufferFull
278          };
279          temp = window.onBufferFlush;
280          window.onBufferFlush = function(clip) {
281              if (typeof temp == 'function') { temp(); }
282              var p = document.getElementById('$this->container_id').firstChild;
283              $this->onBufferFlush
284          };
285          temp = window.onMetaData;
286          window.onMetaData = function(metadata) {
287              if (typeof temp == 'function') { temp(); }
288              var p = document.getElementById('$this->container_id').firstChild;
289              p.metadata = metadata;
290              $this->onMetaData
291          };
292      ");
293      return $s;
294  }
public__set ( p , v )[ obj ]
Parameters
requiredp
requiredv
Code
030  public function __set($p,$v)
031  {
032      $methods = get_class_methods($this);
033      $properties = get_object_vars($this);
034      if (in_array("set_$p",$methods))
035      {
036          $this->{"set_$p"}($v);
037      }
038      else if (array_key_exists("_$p",$properties))
039      {
040          if (!preg_match('/_dirty$/',$p) && property_exists($this,"_{$p}_dirty"))
041          {
042              if (is_object($this->{"_$p"}))
043              {
044                  $this->{"_$p"}->dirty = true;
045              }
046              else
047              {
048                  $this->{"_{$p}_dirty"} = $this->{$p}==$v ? false : true;
049              }
050          }
051          $this->{"_$p"} = $v;
052      }
053      else if (in_array("set_" . substr($p,strpos($p,"_")+1), $methods))
054      {
055          $this->{"set_" . substr($p,strpos($p,"_")+1)}($v,substr($p,0,strpos($p,"_")));
056      }
057      else
058      {
059          trigger_error("This object [" . get_class($this) . ":$this->id] has no private property '_$p' for the requested public property '$p'",E_USER_WARNING);
060      }
061  }
publicset_height ( v )[ videoplayer ]
Parameters
requiredv
Code
109  public function set_height($v)
110  {
111      $this->_height = $v;
112      $this->style["height"] = $this->_height;
113  }
publicset_width ( v )[ videoplayer ]
Parameters
requiredv
Code
103  public function set_width($v)
104  {
105      $this->_width = $v;
106      $this->style["width"] = $this->_width;
107  }
public__toString ( )[ videoplayer ]
Parameters
No parameters for this method
Code
296  public function __toString()
297  {
298      return $this->render();
299  }
 
Accessors
publicarray[ obj ]
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicclassname[ obj ]
Code
086  public function get_classname()
087  {
088      return get_class($this);
089  }
publicconfig_string[ videoplayer ]
Code
125  public function get_config_string()
126  {
127      if (is_array($this->config))
128      {
129          $props = array();
130          foreach ($this->config as $k=>$v)
131          {
132              if (is_null($v))
133              {
134                  continue;
135              }
136              switch ($k)
137              {
138                  case "configFileName" :
139                  case "rtmpConfigUrl" :
140                  case "rtmpConfigParam" :
141                  case "videoFile" :
142                  case "streamingServerURL" :
143                  case "baseURL" :
144                  case "streamingServer" :
145                  case "initialScale" :
146                  case "skinImagesBaseURL" :
147                  case "splashImageFile" :
148                  case "authFileName" :
149                  case "fullScreenScriptURL" :
150                  case "controlBarGloss" :
151                      $props[] = "$k:'$v'";
152                      break;
153                  case "noVideoClip" :
154                  case "thumbs" :
155                  case "startingBufferLength" :
156                  case "bufferLength" :
157                  case "videoHeight" :
158                  case "controlsWidth" :
159                  case "progressBarColor1" :
160                  case "progressBarColor2" :
161                  case "bufferBarColor1" :
162                  case "bufferBarColor2" :
163                  case "progressBarBorderColor1" :
164                  case "progressBarBorderColor2" :
165                  case "bufferingAnimationColor" :
166                  case "controlsAreaBorderColor" :
167                  case "timeDisplayFontColor" :
168                  case "progressBarHeight" :
169                  case "progressBarAreaHeight" :
170                  case "menuItems" :
171                      $props[] = "$k:$v";
172                      break;
173                  case "showPlayListButtons" :
174                  case "liveStream" :
175                  case "thumbsOnFLV" :
176                  case "autoPlay" :
177                  case "autoBuffering" :
178                  case "loop" :
179                  case "autoRewind" :
180                  case "showLoopButton" :
181                  case "showMenu" :
182                  case "hideControls" :
183                  case "useEmbeddedButtonImages" :
184                  case "scaleSplash" :
185                  case "showFullScreenButton" :
186                  case "useNativeFullScreen" :
187                  case "showVolumeSlider" :
188                  case "showStopButton" :
189                  case "showScrubber" :
190                      $props[] = "$k:" . ($v ? "true" : "false");
191                      break;
192                  case "playList" :
193                      $props[] = "playList:$this->playlist";
194                      break;
195                  default:
196                      $props[] = "$k:" . ($v ? "true" : "false");
197                      break;
198              }
199          }
200          return (count($props)>0 ? "{" . implode(",",$props) . "}" : null);
201      }
202      else
203      {
204          return $this->config;
205      }
206  }
publicdirty[ obj ]
Code
063  public function get_dirty()
064  {
065      if ($this->id === 0)
066      {
067          $this->_dirty = true;
068      }
069      else
070      {
071          foreach (get_object_vars($this) as $k=>$v)
072          {
073              if ($this->_dirty)
074              {
075                  break;
076              }
077              if (preg_match('/_dirty$/',$k))
078              {
079                  $this->_dirty = $this->_dirty || $v;
080              }
081          }
082      }
083      return $this->_dirty;
084  }
publicheight[ videoplayer ]
Code
109  public function set_height($v)
110  {
111      $this->_height = $v;
112      $this->style["height"] = $this->_height;
113  }
publicjson[ obj ]
Code
101  public function get_json()
102  {
103      $class = new ReflectionClass($this->classname);
104      $methods = $class->getMethods();
105      usort($methods,"sort_reflection_objects");
106      $accessors = array();
107      foreach ($methods as $index=>$method)
108      {
109          $declarer = $method->getDeclaringClass()->name;
110          if (preg_match('/^(get|set|)_(.+)$/',$method->name,$matches))
111          {
112              $accessor = $matches[2];
113              $getset = $matches[1];
114              eval("\$accessors[\$accessor] = \$this->".$accessor.";");
115          }
116      }
117      //return json_encode($this->get_array());
118      return json_encode($accessors);
119  }
publicproperties[ obj ]
Code
121  public function get_properties()
122  {
123      return array_keys($this->array);
124  }
publicstring[ obj ]
Code
091  protected function get_string()
092  {
093      return method_exists($this,"__toString") ? $this->__toString() : null;
094  }
publicstyle_string[ videoplayer ]
Code
115  public function get_style_string()
116  {
117      $styles = array();
118      foreach ($this->style as $k=>$v)
119      {
120          $styles[] = "$k:$v";
121      }
122      return (count($styles)>0 ? implode(";",$styles) . ";" : null);
123  }
publicwidth[ videoplayer ]
Code
103  public function set_width($v)
104  {
105      $this->_width = $v;
106      $this->style["width"] = $this->_width;
107  }
Get Helix PHP Framework at SourceForge.net. Fast, secure and Free Open Source software downloads