Comments (2)
Are there any known issues around laggy playback? We will need to look at this in more detail, but noticed it when trying out an electron app version of Digital Paper Edit.
from digital-paper-edit-client.
1. total duration
Get the time at which the last node in the current internal timeline finishes playing.
var canvasElement = document.getElementById("canvas");
var ctx = new VideoContext(canvasElement);
console.log(ctx.duration); //prints 0
var videoNode = ctx.video("video.mp4");
videoNode.connect(ctx.destination);
videoNode.start(0);
videoNode.stop(10);
console.log(ctx.duration); //prints 10
ctx.play();
From the docs .duration
2. get current time
Get how far through the internal timeline has been played.
Getting this value will give the current playhead position. Can be used for updating timelines.
var canvasElement = document.getElementById("canvas");
var ctx = new VideoContext(canvasElement);
var videoNode = ctx.video("video.mp4");
videoNode.connect(ctx.destination);
videoNode.start(0);
videoNode.stop(10);
ctx.play();
setTimeout(() => console.log(ctx.currentTime),1000); //should print roughly 1.0
ca probably use registerCallback
to listen for time change? (not sure exactly how)
Register a callback to listen to one of the events defined in VideoContext.EVENTS
3. flatten the progress bar
🤷♂ - see @melnyczuk 's PR #41 & #41 (comment)
4 . set current time
How to make the BBC Video context jump to a specific point, eg equivalent of
.currentTime =
Similarly to .currentTime
in HTML5 media, it can be used both as a get and as a set,
var canvasElement = document.getElementById("canvas");
var ctx = new VideoContext(canvasElement);
var videoNode = ctx.video("video.mp4");
videoNode.connect(ctx.destination);
videoNode.start(0);
videoNode.stop(20);
ctx.currentTime = 10; // seek 10 seconds in
ctx.play();https://github.com/bbc/digital-paper-edit-client/issues/45#
from BBC Video Context .currentTime
docs.
5. update playlist
Maybe is a matter of calling/exposing loadPlaylist
outside of the component
(/bbc/digital-paper-edit-client/src/Components/PaperEdits/PaperEdit/ProgramScript/PreviewCanvas/VideoContextViewer.js#L35
)
However it might be necessary to clear the nodes in the timeline first.
The VideoContext now also has a
reset()
method, which as well as automatically calling destroy on all nodes will also remove all callbacks registered to the VideoContext.
from bbc/VideoContext#37 (comment)
Destroy all nodes in the graph and reset the timeline. After calling this any created nodes will be unusable.
from docs reset()
Other
Other interesting once found in the docs, that can be useful to improve the preview player functionalities
from digital-paper-edit-client.
Related Issues (20)
- Verify transcription performance with UK and non-uk accents
- Add a toggle to remove video player
- Make paper edit more obvious and accessible.
- TEST
- Unable to play audio in Paper Edit view HOT 4
- Original source
- Adding audio for demo and utilise mediaType prop for React-Transcript-Editor HOT 2
- UX investigation: Duplicate for versioning - Programme Script only HOT 2
- Full screen mode for Programme Script Editing
- Text editing: truncate snippets HOT 1
- VideoContext responsiveness 🐛 HOT 3
- Demo page will not work with BrowserRouter HOT 2
- UX: Highlighting and labels HOT 1
- Usability testing
- Build fail on Jenkins due to Javascript out of heap HOT 4
- Implement playback on double-click on text for Programme Script (symmetric to Transcript) HOT 1
- Investigation: Architectural changes in Firebase: setups and integration with Firebase Functions, Analytics, Storage, DB, Mobile. (Timeboxed to 3 days) HOT 2
- Ticket creation task: DPE Text editing (UX ready) HOT 1
- Items don't update on state change (e.g. add, remove, edit) in items. HOT 1
- resizing of preview in paper editing view makes text area smaller
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from digital-paper-edit-client.