refactoring libraycontroller to support video