1 2 3 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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
| // Action script...
// [Initial MovieClip Action of sprite 20507]
#initclip 28
if (!DM.Widget.Panels.Player)
{
if (!DM)
{
_global.DM = new Object();
} // end if
if (!DM.Widget)
{
_global.DM.Widget = new Object();
} // end if
if (!DM.Widget.Panels)
{
_global.DM.Widget.Panels = new Object();
} // end if
var _loc1 = (_global.DM.Widget.Panels.Player = function (name)
{
super(name);
this.initialized = false;
var videoFrame = this.addChild(DM.BaseWidget.getInstance("VideoFrame", "video_frame").setFlags("ALIGN_ABSOLUTE EXPAND_HORIZONTAL EXPAND_VERTICAL").setBackgroundColor("000000"));
if (DM.Base.getParameter("staticSize"))
{
videoFrame.createMask();
} // end if
this.addChild(DM.BaseWidget.getInstance("Resource", "preview_image", false).setFlags("ALIGN_ABSOLUTE EXPAND_HORIZONTAL EXPAND_VERTICAL").setBackgroundColor("000000").setPath(DM.Base.getParameter("previewPath")).setVisibility(!DM.Base.getParameter("autoPlay")));
this.addChild(DM.BaseWidget.getInstance("OSDButtonContainer", "osd_container").setFlags("ALIGN_ABSOLUTE EXPAND_HORIZONTAL EXPAND_VERTICAL"));
this.addChild(DM.BaseWidget.getInstance("Dialog", "dialog"));
this.addChild(DM.BaseWidget.getInstance("Panels.Midroll", "midroll_panel"));
var _loc4 = this.addChild(DM.BaseWidget.getInstance("Container", "", false).setFlags("ALIGN_ABSOLUTE EXPAND_HORIZONTAL EXPAND_VERTICAL DISTRIBUTE_VERTICAL").setCacheBitmap(true));
if (DM.Base.getParameter("showControls"))
{
_loc4.addChild(DM.BaseWidget.getInstance("ControlBar", "control_bar"));
} // end if
if (DM.Base.getParameter("showSeek"))
{
_loc4.addChild(DM.BaseWidget.getInstance("Seeker", "seeker"));
} // end if
if (DM.Base.getParameter("captionFileURL"))
{
_loc4.addChild(DM.BaseWidget.getInstance("Caption", "captions").setCaptionURL(DM.Base.getParameter("captionFileURL")).setVideoFrame(videoFrame));
} // end if
this.addChild(DM.BaseWidget.getInstance("OSDPanels.Link", "link_panel"));
this.addChild(DM.BaseWidget.getInstance("OSDPanels.Info", "info_panel"));
this.addChild(DM.BaseWidget.getInstance("OSDPanels.Related", "related_panel"));
this.addChild(DM.BaseWidget.getInstance("OSDPanels.Error", "error_panel"));
this.addChild(DM.BaseWidget.getInstance("OSDPanels.Debug", "debug_panel"));
this.addChild(DM.BaseWidget.getInstance("OSDPanels.Feedback", "feedback_panel"));
if (DM.Base.getParameter("extractPath") != "")
{
this.addChild(DM.BaseWidget.getInstance("OSDPanels.Extract", "extract_panel"));
_loc4.addChild(DM.BaseWidget.getInstance("PreviewButton", "osd_preview").setFlags("ALIGN_ABSOLUTE ALIGN_TOP ALIGN_RIGHT").setMargin("top", 10).setMargin("right", 10).setVisibility(false));
} // end if
if (DM.BaseWidget.getReference("control_menu"))
{
var _loc5 = (DM.Widget.Button)(DM.BaseWidget.getReference("control_menu"));
if (DM.Base.getParameter("skypeMode"))
{
_loc5.onUp = function ()
{
this.dispatchEvent("menu_clicked");
};
return;
} // end if
var _loc6 = this.addChild(DM.BaseWidget.getInstance("Container", "", false).setFlags("ALIGN_ABSOLUTE EXPAND_HORIZONTAL EXPAND_VERTICAL").setMargin("bottom", 16));
var _loc7 = (DM.Widget.Menu)(_loc6.addChild(DM.BaseWidget.getInstance("Menu", "menu").setFlags("ALIGN_ABSOLUTE ALIGN_BOTTOM ALIGN_RIGHT").setMenuButton(_loc5)));
_loc7.addMenuItem("smoothing").setLabel(DM.Base.getString("menuItemSmooth")).setAction(DM.Widget.Menu.getEventDispatcherAction("display_smoothing_toggle")).setCheckedCallback(function ()
{
return (videoFrame.getSmoothing());
});
var _loc8 = (videoFrame.hasVideoType("ld") ? (1) : (0)) + (videoFrame.hasVideoType("sd") ? (1) : (0)) + (videoFrame.hasVideoType("hq") ? (1) : (0)) + (videoFrame.hasVideoType("hd") ? (1) : (0));
if (_loc8 > 1)
{
if (videoFrame.hasVideoType("ld"))
{
_loc7.addMenuItem("ld").setLabel(DM.Base.getString("menuItemLowDef")).setAction(DM.Widget.Menu.getEventDispatcherAction("display_quality_ld")).setCheckedCallback(function ()
{
return (videoFrame.isVideoType("ld"));
});
} // end if
if (videoFrame.hasVideoType("sd"))
{
_loc7.addMenuItem("sd").setLabel(DM.Base.getString("menuItemStandardDef")).setAction(DM.Widget.Menu.getEventDispatcherAction("display_quality_sd")).setCheckedCallback(function ()
{
return (videoFrame.isVideoType("sd"));
});
} // end if
if (videoFrame.hasVideoType("hq"))
{
_loc7.addMenuItem("hq").setLabel(DM.Base.getString("menuItemHighQuality")).setAction(DM.Widget.Menu.getEventDispatcherAction("display_quality_hq")).setCheckedCallback(function ()
{
return (videoFrame.isVideoType("hq"));
});
} // end if
if (videoFrame.hasVideoType("hd"))
{
_loc7.addMenuItem("hd").setLabel(DM.Base.getString("menuItemHighDef")).setAction(DM.Widget.Menu.getEventDispatcherAction("display_quality_hd")).setCheckedCallback(function ()
{
return (videoFrame.isVideoType("hd"));
});
} // end if
} // end if
_loc7.addSeparator();
_loc7.addMenuItem("original_size").setLabel(DM.Base.getString("menuItemOrignalSize")).setAction(DM.Widget.Menu.getEventDispatcherAction("display_mode_original")).setEnabledCallback(function ()
{
return (videoFrame.hasOriginalSizeMode());
}).setCheckedCallback(function ()
{
return (videoFrame.isOriginalSizeMode());
});
_loc7.addMenuItem("full_size").setLabel(DM.Base.getString("menuItemFullSize")).setAction(DM.Widget.Menu.getEventDispatcherAction("display_mode_full")).setCheckedCallback(function ()
{
return (videoFrame.isFullSizeMode());
});
_loc7.addMenuItem("zoom_size").setLabel(DM.Base.getString("menuItemZoomSize")).setAction(DM.Widget.Menu.getEventDispatcherAction("display_mode_overscan")).setEnabledCallback(function ()
{
return (videoFrame.hasOverscanSizeMode());
}).setCheckedCallback(function ()
{
return (videoFrame.isOverscanSizeMode());
});
if (DM.Base.getParameter("showFullscreen"))
{
_loc7.addMenuItem("fullscreen").setLabel(DM.Base.getString("menuItemFullscreen")).setAction(DM.Widget.Menu.getEventDispatcherAction("toggle_fullscreen")).setCheckedCallback(function ()
{
return (videoFrame.isFullscreen());
});
} // end if
if (DM.BaseWidget.getReference("captions"))
{
var captions = DM.BaseWidget.getReference("captions");
_loc7.addMenuItem("caption").setLabel(DM.Base.getString("menuItemShowCaption")).setAction(DM.Widget.Menu.getEventDispatcherAction("toggle_captions")).setCheckedCallback(function ()
{
return (captions.getEnabled());
});
} // end if
if (DM.Base.getParameter("extractPath") != "")
{
_loc7.addSeparator();
_loc7.addMenuItem("extract").setLabel(DM.Base.getString("menuItemExtractPreview")).setAction(DM.Widget.Menu.getEventDispatcherAction("show_extract"));
} // end if
_loc7.addSeparator();
if (DM.Base.getParameter("showRelated"))
{
_loc7.addMenuItem("related").setLabel(DM.Base.getString("menuItemRelated")).setAction(DM.Widget.Menu.getEventDispatcherAction("show_related")).setIcon("menu_icon_related");
} // end if
if (DM.Base.getParameter("showLink"))
{
_loc7.addMenuItem("link").setLabel(DM.Base.getString("menuItemLink")).setAction(DM.Widget.Menu.getEventDispatcherAction("show_link")).setIcon("menu_icon_link");
} // end if
if (DM.Base.getParameter("showShare"))
{
_loc7.addMenuItem("share").setLabel(DM.Base.getString("menuItemShare")).setAction(DM.Widget.Menu.getEventDispatcherAction("show_share")).setIcon("menu_icon_share");
} // end if
if (DM.Base.getParameter("showInfo"))
{
_loc7.addMenuItem("info").setLabel(DM.Base.getString("menuItemInfo")).setAction(DM.Widget.Menu.getEventDispatcherAction("show_info")).setIcon("menu_icon_info");
} // end if
} // end if
}).prototype;
_loc1.render = function ()
{
super.render();
if (!this.initialized)
{
this.initialized = true;
DM.Base.log("preview");
} // end if
DM.BaseWidget.getReference("dialog").render();
};
_loc1.receiveEvent = function (source, subject, data)
{
super.receiveEvent(source, subject, data);
if (subject == "bottom_margin_changed")
{
var _loc6 = DM.Base.getParameter("bottomMargin");
if (!DM.BaseWidget.getReference("video_frame").isFullscreen())
{
DM.BaseWidget.getReference("video_frame").setMargin("bottom", _loc6);
} // end if
DM.BaseWidget.getReference("preview_image").setMargin("bottom", _loc6);
DM.BaseWidget.getReference("OSDButtonContainer").setMargin("bottom", _loc6);
this.render();
} // end if
if (subject == "enabled_fullscreen")
{
DM.BaseWidget.getReference("video_frame").setMargin("bottom", 0);
this.render();
}
else if (subject == "disabled_fullscreen")
{
DM.BaseWidget.getReference("video_frame").setMargin("bottom", DM.Base.getParameter("bottomMargin"));
this.render();
} // end else if
if (subject == "upgrade_player")
{
if (_root.selfURL)
{
_root.MMplayerType = System.capabilities.playerType;
_root.MMredirectURL = _root.selfURL;
_root.MMdoctitle = "Dailymotion Player";
_root.MMdoctitle = _root.MMdoctitle.slice(0, 47) + " - Flash Player Installation";
getURL("javascript:setPageTitle(\"" + _root.MMdoctitle + "\");", "_self");
DM.Base.debug(_global.ExpressInstall.loadUpdater);
_global.ExpressInstall.loadUpdater();
}
else
{
getURL("http://www.adobe.com/go/getflash/", "_blank");
} // end if
} // end else if
if (subject == "click" && source == "control_logo")
{
getURL("http://www.dailymotion.com", "_blank");
} // end if
if (subject == "click" && source == "control_bug")
{
DM.BaseWidget.getReference("feedback_panel").toggleVisibility().getParent().render();
} // end if
if (subject == "click" && source == "tool_share" || subject == "show_share")
{
this.dispatchEvent("pause");
this.dispatchEvent("disable_fullscreen");
getURL("javascript:void(open(\'" + DM.Base.getParameter("sharePath") + "\', \'_share\', \'width=550,height=350,resizable=yes,scrollbars=yes\'));", "_self");
} // end if
if (subject == "stream")
{
if (data.subject == "play" || (data.subject == "pause" || data.subject == "stop"))
{
DM.BaseWidget.getReference("control_rewind").setEnabled(data.stream.getDuration() > 0);
} // end if
if (data.subject == "play")
{
DM.Base.callback("stream", "play");
DM.BaseWidget.getReference("preview_image").setVisibility(false).getParent().render();
DM.BaseWidget.getReference("control_pause").setVisibility(true).getParent().render();
}
else if (data.subject == "pause" || data.subject == "stop")
{
DM.BaseWidget.getReference("control_play").setVisibility(true).getParent().render();
if (data.subject == "stop")
{
DM.Base.callback("stream", "stop");
if (DM.Base.getParameter("chainPath") != "")
{
getURL(DM.Base.getParameter("chainPath"), DM.Base.getParameter("chainTarget"));
return;
} // end if
this.dispatchEvent("video_end", null);
DM.BaseWidget.getReference("preview_image").setVisibility(true).getParent().render();
}
else
{
DM.Base.callback("stream", "pause");
DM.Base.callback("position", data.stream.getCurrentPlayerTime());
} // end else if
}
else if (data.subject == "notfound")
{
DM.BaseWidget.getReference("error_panel").setTitle(DM.Base.getString("streamNotFoundTitle")).setDescription(DM.Base.getString("streamNotFoundTxt")).setVisibility(true).getParent().render();
} // end else if
} // end else if
};
ASSetPropFlags(_loc1, null, 1);
} // end if
#endinitclip |
Partager