This attempt to rebuild oTranscribe from the ground up ultimately failed. But oTranscribe itself was renovated and is looking better than ever! The moral of the story is: try, try and try again. —Elliot
This is an attempt to rebuild oTranscribe from the ground up. It's not quite ready to use yet, though.
Read more about oTranscribe2 and how you can get involved.
To compile the source files in the src
folder, you will need to do the following:
Install Node and npm if you don't have it already, and then run:
npm install
Then start the Webpack build system by running:
npm start
oTranscribe should then be accessible at localhost:8080.
To build a distributable dist
folder, run:
npm run build
Assuming you have already installed dependencies, run:
npm test
These are functions which use Ractive to control the HTML on the page. They live in the controllers directory, and their corresponding HTML templates are in the templates directory.
Contructor opts:
- element
- setTime (callback that takes time in seconds as argument)
- getTime (callback that returns time in seconds)
Methods:
- getFile
- setFile
- onSave
- setFileLoaded
- setLastMedia
- find
- lock
- unlock
Constructor opts:
- element
Methods:
- onReset
- setFile
- getTime
- setTime
oTranscribe's storage system is a custom wrapper around localforage. When initialised, it returns an object with the following methods:
list
: Returns promise which resolves to list of saved filessave
: Takes an object withid
property. Returns promise which resolves to that id.load
: Takes an id (eg.32
). Returns promise which resolves to a saved file.
Takes the following arguments:
driver
: A valid Player driver (see below)source
: Source file URLonReady
: Callback function called when player is ready for playback
Returns an object of playback controls:
play
pause
getTime
: returns time in secondssetTime
: seeks to time in secondsskip
:'forwards'
or'backwards'
getLength
: returns time in secondsgetStatus
: 'loading', 'playing' or 'paused'getSpeed
: returns speed as numbersetSpeed
: changes speed (1
is normal speed)speed
:'up'
or'down'
destroy
: player becomes inactive and removes all markup from page
Player drivers should be objects initialise with a single source
argument. They live in the player-drivers directory. An instance of a player driver should have the following methods:
play
pause
getTime
setTime
: argument is time in secondsisReady
: true if source is loaded and ready for playbackgetLength
: time in secondsgetStatus
: 'paused' or 'playing'getSpeed
: returns speed as numbersetSpeed
: changes speed (1
is normal speed)destroy
: driver becomes inactive and removes all markup from page
Available player drivers:
Player.drivers.HTML5_AUDIO
- (More to come!)