GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - shvetsgroup/codeplayer: This library allows you to play a code movies on your website.

BranchesTags
Open more actions menu

Latest commit

 

History

30 Commits
30 Commits

Folders and files

NameName
Last commit message
Last commit date
demo
demo
 
 
dist
dist
 
 
src
src
 
 
.gitignore
.gitignore
 
 
Gruntfile.js
Gruntfile.js
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

CodePlayer is a javascript library which allows playing educational code scenarios in the web browser. Scenarios look and feel like videos except that everything is executed over real web editor with a real code.

A picture is worth a thousand words, so try the demo.

Scenarios

Scenario is a set of actions such as typing, text selection, moving cursor, tooltips and others. Actions are either auto-played or triggered by user.

By the way, scenarios and interface can be translated and played in other languages.

Usage

Requirements

CodePlayer has a decent list of requirements. Here they are:

  • CodeMirror (the backbone of the plugin)
  • jQuery
  • Underscore
  • Twitter Boostrap 3 (CodePlayer relies on its styling by default. The tooltips also won't work without it.)
  • FontAwesome (Used to insert icons into player controls)

Inside HTML code

  1. Download the plugin and include the required css and js files into the html page (see demo page source for example).
  2. Here's the code you need to display a player on a page:
<div id="codeplayer"></div>
<script>
    var div = document.getElementById('codeplayer');
    var scenario = { ... } // Scenario JSON file.
    var options = { ... } // CodePlayer options + all standard CodeMirror options.
    CodeMirror.player.create(div, scenario, options);
</script>

Options

locale : string (default: 'en')

If your scenario is multilingual, this parameter will pick the language. Note that local can not be changed during playback, so you will need to re-render a player instance.

translation : object (default: empty)

Here you can pass a simple JSON object to override standard controls captions and titles. Example:

{
    "Play": "Начать",
    "Replay": "Начать заново",
    "Next": "Вперед",
    "Back": "Назад",
    "Stop": "Стоп",
    "Click on these blue things to continue.": "Кликайте на эти синие штуки для продолжения.",
    "Show difference": "Показать разницу",
    "Compile and test": "Компиляция и тестирование"
}

merge : boolean (default: false)

Whether or not show the diff viewer after scenario is finished. This option requires Merge addon for Codemirror.

Acknowledgment

This library was created for www.refactoring.guru by @neochief.

If you need a similar library, but simpler, take a look at CodeMirror Movie.

About

This library allows you to play a code movies on your website.

Resources

Readme
MIT license
Activity
Custom properties

Stars

18 stars

Watchers

2 watching

Forks

6 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.