dojox/embed/Object.js

  • Provides:

    • dojox.embed.Object
  • Requires:

    • dijit._Widget in common in project dijit
    • dojox.embed.Flash in common
    • dojox.embed.Quicktime in common
  • dojox.embed.Object

    • type
      Function
    • chains:
      • dijit._Widget: (prototype)
      • dijit._Widget: (call)
    • summary
      A widget you can use to embed either a Flash or Quicktime
      movie.
    • example
      From markup:
      
      	<div dojoType="dojox.embed.Object" src="path/to/movie.swf"></div>
    • example
      Programmatic:
      
      	var mov=new dojox.embed.Object({
      		src: "path/to/movie.swf"
      	}, node);
  • dojox.embed.Object.width

    • type
      Number
    • summary
      The width of the movie. If not provided, the width of this.domNode is used.
  • dojox.embed.Object.height

    • type
      Number
    • summary
      The height of the movie. If not provided, the height of this.domNode is used.
  • dojox.embed.Object.src

    • type
      String
    • summary
      The URL of the movie to embed.
  • dojox.embed.Object.movie

    • type
      HTMLEmbed
    • summary
      The eventual reference to the movie embedded.  If you are looking to script
      control over the movie, you'd access it this way.
  • dojox.embed.Object.params

    • type
      Object
    • summary
      A property bag that is created postCreate.  Any additional attributes you
      define on your domNode will be collected and placed into this, which will
      then be passed to the movie constructor.
  • dojox.embed.Object.reFlash

    • type
      RegExp
    • summary
      Expression used on the src property to determine if this is Flash or Quicktime.
  • dojox.embed.Object.reQtMovie

    • type
      RegExp
    • summary
      Expression used on the src property to determine if this is Flash or Quicktime.
  • dojox.embed.Object.reQtAudio

    • type
      RegExp
    • summary
      Expression used on the src property to determine if this is Flash or Quicktime.
  • dojox.embed.Object.postCreate

    • type
      Function
    • source: [view]
      dojo.provide("dojox.embed.Object");
      dojo.experimental("dojox.embed.Object");


      dojo.require("dijit._Widget");
      dojo.require("dojox.embed.Flash");
      dojo.require("dojox.embed.Quicktime");


      dojo.declare("dojox.embed.Object", dijit._Widget, {
       // summary:
       //  A widget you can use to embed either a Flash or Quicktime
       //  movie.
       //
       // example:
       // From markup:
       // | 

       //
       // example:
       // Programmatic:
       // | var mov=new dojox.embed.Object({
       // |  src: "path/to/movie.swf"
       // | }, node);
       //
       // width: Number?
       //  The width of the movie. If not provided, the width of this.domNode is used.
       // height: Number?
       //  The height of the movie. If not provided, the height of this.domNode is used.
       // src: String
       //  The URL of the movie to embed.
       // movie: HTMLEmbed
       //  The eventual reference to the movie embedded. If you are looking to script
       //  control over the movie, you'd access it this way.
       // params: Object
       //  A property bag that is created postCreate. Any additional attributes you
       //  define on your domNode will be collected and placed into this, which will
       //  then be passed to the movie constructor.
       // reFlash: RegExp
       //  Expression used on the src property to determine if this is Flash or Quicktime.
       // reQtMovie: RegExp
       //  Expression used on the src property to determine if this is Flash or Quicktime.
       // reQtAudio: RegExp
       //  Expression used on the src property to determine if this is Flash or Quicktime.

       
       width: 0,
       height: 0,
       src: "",
       movie: null,
       params: null,


       reFlash: /\.swf|\.flv/gi,
       reQtMovie: /\.3gp|\.avi|\.m4v|\.mov|\.mp4|\.mpg|\.mpeg|\.qt/gi,
       reQtAudio:/\.aiff|\.aif|\.m4a|\.m4b|\.m4p|\.midi|\.mid|\.mp3|\.mpa|\.wav/gi,

       
       postCreate: function(){
        // summary
        //  Constructs the movie and places it in the document.
        if(!this.width || !this.height){
         // get the width and height from the domNode
         var box=dojo.marginBox(this.domNode);
         this.width=box.w, this.height=box.h;
        }


        // the default embed constructor.
        var em=dojox.embed.Flash;


        // figure out what kind of movie this is.
        if(this.src.match(this.reQtMovie) || this.src.match(this.reQtAudio)){
         em=dojox.embed.Quicktime;
        }


        // loop through any attributes and set up our params object.
        if(!this.params){
         this.params={};
         if(this.domNode.hasAttributes()){
          // ignore list
          var ignore = {
           dojoType: "",
           width: "",
           height: "",
           "class": "",
           style: "",
           id: "",
           src: ""
          };


          var attrs=this.domNode.attributes;
          for(var i=0, l=attrs.length; i     if(!ignore[attrs[i].name]){
            this.params[attrs[i].name]=attrs[i].value;
           }
          }
         }
        }


        // set up our arguments.
        var kwArgs={
         path: this.src,
         width: this.width,
         height: this.height,
         params: this.params
        };


        // set up the movie.
        this.movie=new (em)(kwArgs, this.domNode);
    • summary
  • dojox.embed

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary