var VideoManager = function() {

    var _self = this;
    var _data = null;
    var _vPlayer = null;

    var _options = {
        controls: false,
        autoplay: true,
        preload: 'auto',
        controlBar: {
            fullscreenToggle: false
        }
    };

    this.init = function(data) {
        Utils.clear();
      //  console.log('VideoManager: init:    ', window.player);
        _data = data;
        if (_vPlayer) {
            _vPlayer.dispose()
        }        
        _vPlayer = videojs('simple_video_1', _options);
        MediaManager.init(_vPlayer)
        updateMedia(_data)
    }

    var updateMedia = function(data) {
    //    console.log('VideoManager: updateMedia:    ' + _vPlayer);
        
        $('#simple_video_holder').addClass('disabled')

        try {
            if (_vPlayer) {
                var _src = data['url'];
                var _title = data['title'] || 'Video';                
                $('#simple_video_holder').attr('data-before', _title);
                _vPlayer.src(_src);
                //anything is the 'content' value
            }
        } catch (err) {

        }
    }

    /* videojs('simple_video_1', {
        controls: true,
        plugins: {
            videoJsResolutionSwitcher: {
                default: 'low', // Default resolution [{Number}, 'low', 'high'],
                dynamicLabel: true
            }
        }
    }, function() {
        var player = this;
        window.player = player
        player.updateSrc([{
                src: 'https://vjs.zencdn.net/v/oceans.mp4?SD',
                type: 'video/mp4',
                label: 'SD',
                res: 360
            },
            {
                src: 'https://vjs.zencdn.net/v/oceans.mp4?HD',
                type: 'video/mp4',
                label: 'HD',
                res: 720
            }
        ])
        player.on('resolutionchange', function() {
            console.info('Source changed to %s', player.src())
        })
    })
*/
    return this;
}