
function SavoryVideoConnection() {
    this.playerID = null;
}

SavoryVideoConnection.prototype.getMediaById = function(id) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[id];
    } else {
        return document[id];
    }
}

SavoryVideoConnection.prototype.startPlay = function(id) {
    if (this.playerID != null && this.playerID != id) {
        var player = this.getMediaById(this.playerID);
        if (player.TCurrentLabel("_level0/")=="play") {
            player.TCallLabel("_level0/", "pause");
        }        
    }
    this.playerID = id;
}

var _svc = new SavoryVideoConnection();