Commit 7b6f83bb authored by Dan Rossi's avatar Dan Rossi
Browse files

- #70 general cleanup of bwcheck code

- Fix for issue caused by #322 with bitrateselect plugin, template should be created at the start like it was, ready function wrapper still requires bitrateselect template to be placed above in the page or else $(document).ready is required.
- #96 possible confusion caused by the naming of the widgets with accessibility options for screen readers. Use the tooltip labels instead of the widget name if set.
- Cleanup of imports on the dock config.
parent a4e7457f
......@@ -29,10 +29,9 @@
$.extend(opts, options);
var wrap = container;
var wrap = $(container);
// use either the element with templateId or the contents of wrap
var template = null;
var template = opts.templateId ? $('<div>').append($(opts.templateId).clone()).remove().html() : wrap.html();
var plugin = self.getPlugin(opts.pluginName) || null;
......@@ -100,11 +99,6 @@
bitrateItems = self.getClip().bitrateItems ? self.getClip().bitrateItems : self.getClip().bitrates;
if (bitrateItems.length > 0) {
wrap = $(wrap);
//fix for #322 containers only obtainable at this point
template = opts.templateId ? $('<div>').append($(opts.templateId).clone()).remove().html() : wrap.html();
wrap.empty();
buildBitrateList();
}
......
......@@ -16,7 +16,7 @@ package org.flowplayer.net {
public class BitrateResource {
protected var log:Log = new Log(this);
protected function sort(bitrates:Vector.<BitrateItem>):Vector.<BitrateItem> {
/*protected function sort(bitrates:Vector.<BitrateItem>):Vector.<BitrateItem> {
var sorter:Function = function (a:BitrateItem, b:BitrateItem):Number {
// increasing bitrate order
if (a.bitrate == b.bitrate) {
......@@ -35,7 +35,7 @@ package org.flowplayer.net {
return -1;
};
return bitrates.concat().sort(sorter);
}
} */
public function addBitratesToClip(clip:Clip):Vector.<BitrateItem> {
log.debug("addBitratesToClip()");
......
......@@ -36,7 +36,8 @@ package org.flowplayer.ui.controllers {
override protected function createWidget():void {
_widget = new GenericTooltipButton(new faceClass(), _config as TooltipButtonConfig, _player.animationEngine);
//#443 set accessibility options for button widget
setAccessible(_widget, name);
setAccessible(_widget, (_config as TooltipButtonConfig).tooltipLabel ? (_config as TooltipButtonConfig).tooltipLabel : name);
}
protected function addWidgetListeners():void {
......
......@@ -9,17 +9,14 @@
* Additional Term, see http://flowplayer.org/license_gpl.html
*/
package org.flowplayer.ui.dock {
import org.flowplayer.ui.*;
import org.flowplayer.ui.AutoHideConfig;
import org.flowplayer.model.DisplayPluginModel;
import org.flowplayer.model.DisplayPluginModelImpl;
import org.flowplayer.model.DisplayProperties;
import org.flowplayer.model.DisplayPropertiesImpl;
import org.flowplayer.ui.buttons.ButtonConfig;
import org.flowplayer.util.PropertyBinder;
import org.flowplayer.view.FlowStyleSheet;
import spark.components.Button;
public class DockConfig {
private var _model:DisplayPluginModel;
private var _autoHide:AutoHideConfig;
......
......@@ -8,28 +8,27 @@
* http://www.opensource.org/licenses/mit-license.php
*/
package org.flowplayer.bwcheck.detect {
import flash.events.EventDispatcher;
import flash.events.NetStatusEvent;
import flash.net.NetConnection;
import flash.utils.setTimeout;
import org.flowplayer.bwcheck.config.Config;
import org.flowplayer.bwcheck.net.NullNetConnectionClient;
import org.flowplayer.cluster.RTMPCluster;
import org.flowplayer.model.ClipEvent;
import org.flowplayer.model.Playlist;
import org.flowplayer.model.PluginEventType;
import org.flowplayer.model.PluginModel;
import org.flowplayer.util.Log;
import org.flowplayer.view.Flowplayer;
/**
* @author danielr
*/
public class BandwidthDetector extends EventDispatcher {
package org.flowplayer.bwcheck.detect {
import flash.events.EventDispatcher;
import flash.events.NetStatusEvent;
import flash.net.NetConnection;
import flash.utils.setTimeout;
import org.flowplayer.bwcheck.config.Config;
import org.flowplayer.bwcheck.net.NullNetConnectionClient;
import org.flowplayer.cluster.RTMPCluster;
import org.flowplayer.model.ClipEvent;
import org.flowplayer.model.Playlist;
import org.flowplayer.model.PluginEventType;
import org.flowplayer.model.PluginModel;
import org.flowplayer.util.Log;
/**
* @author danielr
*/
public class BandwidthDetector extends EventDispatcher {
private var log:Log = new Log(this);
// --------- These references are needed here, so that the classes get compiled in!
......
......@@ -8,15 +8,11 @@
*/
package org.flowplayer.bwcheck.detect {
import org.flowplayer.bwcheck.detect.*;
import org.flowplayer.bwcheck.detect.AbstractDetectionStrategy;
import flash.utils.setTimeout;
/**
* @author danielr
*/
public class BandwidthDetectorFms extends AbstractDetectionStrategy {
/**
* @author danielr
*/
public class BandwidthDetectorFms extends AbstractDetectionStrategy {
private var _host:String;
......
......@@ -13,7 +13,6 @@ package org.flowplayer.bwcheck.detect {
import flash.events.ProgressEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestHeader;
import flash.net.URLRequestMethod;
import flash.utils.getTimer;
......@@ -28,7 +27,6 @@ package org.flowplayer.bwcheck.detect {
private var _bandwidth:Number;
private var _downloadTime:Number;
public var maximumBytes:uint;
private var _nocache:URLRequestHeader;
private var _referenceFileUrl:String;
public function BandwidthDetectorHttp() {
......
......@@ -8,7 +8,6 @@
*/
package org.flowplayer.bwcheck.detect {
import org.flowplayer.bwcheck.detect.AbstractDetectionStrategy;
/**
* @author danielr
......
......@@ -8,9 +8,6 @@
*/
package org.flowplayer.bwcheck.detect {
import flash.net.Responder;
import org.flowplayer.bwcheck.detect.AbstractDetectionStrategy;
/**
* @author danielr
......
......@@ -8,15 +8,11 @@
*/
package org.flowplayer.bwcheck.detect {
import flash.net.Responder;
import org.flowplayer.bwcheck.detect.AbstractDetectionStrategy;
/**
* @author danielr
*/
public class BandwidthDetectorWowza extends AbstractDetectionStrategy {
private var info:Object = new Object();
public function onBwCheck(obj:Object):Boolean {
return onBWCheck(obj);
......
/*
* This file is part of Flowplayer, http://flowplayer.org
*
* By: Daniel Rossi, <electroteque@gmail.com>, Anssi Piirainen Flowplayer Oy
* Copyright (c) 2008-2011 Flowplayer Oy *
* Released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*/
package org.flowplayer.bwcheck.detect {
import flash.events.Event;
public class DynamicStreamEvent extends Event {
public static const SWITCH_STREAM:String = "switch_stream";
private var _info:Object;
public function DynamicStreamEvent(eventName:String) {
super(eventName);
}
public function set info(obj:Object):void {
_info = obj;
}
public function get info():Object {
return _info;
}
}
}
\ No newline at end of file
......@@ -16,9 +16,6 @@ package org.flowplayer.bwcheck.net {
import org.flowplayer.view.Flowplayer;
import org.flowplayer.controller.ClipURLResolver;
import org.flowplayer.util.Log;
//import org.flowplayer.util.PropertyBinder;
import org.flowplayer.model.DisplayProperties;
......@@ -27,20 +24,16 @@ package org.flowplayer.bwcheck.net {
import org.flowplayer.bwcheck.config.Config;
import org.osmf.net.DynamicStreamingItem;
//import org.osmf.net.NetStreamMetricsBase;
import org.osmf.net.NetStreamSwitchManagerBase;
CONFIG::enableRtmpMetrics {
import org.osmf.net.NetStreamSwitchManager;
}
public class BWStreamSelectionManager extends StreamSelectionManager {
public class BWStreamSelectionManager extends StreamSelectionManager {
private var _config:Config;
private static var bwSelectLog:Log = new Log("org.flowplayer.bwcheck.net::BWStreamSelectionManager");
private var dynamicStreamingItems:Vector.<DynamicStreamingItem>;
//private var _netStreamMetrics:NetStreamMetricsBase;
private var _netStreamSwitchManager:NetStreamSwitchManagerBase;
public function BWStreamSelectionManager(bitrateResource:BitrateResource, player:Flowplayer, resolver:ClipURLResolver, config:Config) {
......
......@@ -9,16 +9,13 @@
*/
package org.flowplayer.bwcheck.net {
import org.flowplayer.bwcheck.detect.*;
import org.flowplayer.bwcheck.config.Config;
import org.flowplayer.util.Log;
import org.flowplayer.view.Flowplayer;
import org.flowplayer.net.BitrateItem;
import org.flowplayer.net.IStreamSelectionManager;
import org.osmf.net.DynamicStreamingItem;
import org.osmf.net.SwitchingRuleBase;
import org.osmf.net.rtmpstreaming.RTMPNetStreamMetrics;
import org.osmf.net.NetStreamMetricsBase;
......@@ -37,7 +34,6 @@ package org.flowplayer.bwcheck.net {
}
override public function getNewIndex():int {
var screenWidth:Number = _player.screen.getDisplayObject().width;
for (var i:Number = _bitrates.length - 1; i >= 0; i--) {
var item:BitrateItem = _bitrates[i];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment