Comments (6)
Hi, does this issue still need fixing? If so then I can give it a try.
from botonic.
So currently I still have the previous workaround in place:
i render with
render(){
<div>
<CustomAudio id={this.context.session.messageId} src={"data:audio/mp3;base64," + this.context.session.resp.response} />
{this.context.session.resp.options ? <DisplayClickables audioId={this.context.session.messageId} options={this.context.session.resp.options} /> : null}
</div>
}
with the DisplayClickables class being
class DisplayClickables extends React.Component{
// React component that will display clickables after the audio has stopped playing
constructor(props){
super(props)
if (props.alwaysShow) {
this.state = {showOptions: false}
setTimeout(() => {
this.setState({showOptions: true})
}, 2500);
} else{
this.state = {showOptions: false,
audioId: props.audioId,
audioOptionsId: props.audioId + '_options'
}
let return_el = null
let startTime = new Date()
let timerId = setInterval(() => {
if (document.querySelector('#' + this.state.audioId + ' #myAudio')){
if(Math.floor((Date() - startTime/1000)/60) > 300){ // Stop checking the audio element after 5 minutes.
clearInterval(timerId)
}
let audio_el = document.querySelector('#' + this.state.audioId + ' #myAudio') // get the latest posted audio element
if (audio_el.ended){ // check if it has ended playing, this is a property of the html audio dom element
clearInterval(timerId) // then, stop checking
this.setState({showOptions: true}) // change state to show the clickable options
}
}
}, 800)
}
}
where the messageId is manually defined as
session.messageId = 'a' + uuidv1().split("-").join("") // used to set id, id needs to start with character and can't have '-'
within the botonicInit
.
I'm using
@botonic/cli/0.18.3 darwin-x64 node-v13.2.0
from botonic.
Ok, I will attempt something. I will get back to you if I am able to solve the issue.
from botonic.
Hello, I would like to ask this question, is there a solution in the future?
from botonic.
we'll consider adding this but it is not a priority. feel free to create a PR for this 🤗
from botonic.
Hey ,is it possible for me to work on this?
Or if its closed that means it doesn't need to be done?
from botonic.
Related Issues (20)
- @botonic/react: refactor renderNode/browser; do use SSR (simplify backend)
- @botonic/react: use dayjs for time utils
- Implemented code on a React JS framework HOT 6
- ERROR in ./webpack-entries/dev-entry.js HOT 1
- ERROR in ./node_modules/@botonic/react/src/components/index-types.ts HOT 7
- Botonic Train Error HOT 1
- How do I import as a standalone project using the following structure? HOT 1
- Is this the latest version?
- Botonic Train issues
- Improve overall security of the project
- botonic new - not working on Apple M1 Max HOT 7
- botonic serve on working on my machine HOT 1
- Script error displayed when I type in the input area
- Question
- Stand-alone JS bundle not working
- chat bubble not showing HOT 1
- how to jump from one action to another? HOT 2
- There is a vulnerability in @botonic/core
- input.data have a limit of 1000 characters?
- Please provide option to upload files of pdf or image
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 botonic.