Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move index.html to another directory will not work #1

Open
kflee2000 opened this issue Jan 20, 2019 · 6 comments
Open

Move index.html to another directory will not work #1

kflee2000 opened this issue Jan 20, 2019 · 6 comments

Comments

@kflee2000
Copy link

Download and test all just fine but when index.html is copied to another directory, with intention to modify, it will not show play back audio control?

How to overcome this problem?

My application is to use it to record lots of very short Taiwanese dialect on a database as a blob and hopefully can be played back for learner.

@octavn
Copy link
Contributor

octavn commented Jan 20, 2019

If you move index.html you'll have to change the 2 paths to the .js files at the bottom of index.html to reflect the new relative location:

<script src="js/WebAudioRecorder.min.js"></script>
<script src="js/app.js"></script>

@kflee2000
Copy link
Author

yes, I did and the recording / stop seems work ok; but after stop, it does not show the recording list like the other. Test move to a number of different places all show the same result, it seem the only place it work is in the default directory. I insert analert('createDownloadLink'); as first line in createDownloadLink, and it never come here if the index.html has moved. I test it on Firefox as I dont have access to https for test it in Chrome.

@skgone
Copy link

skgone commented Aug 15, 2019

i have the same problem too。
I use the web framework of flask, put index.html under the templates folder, and put the relevant js file under the static folder.
I modified the index.html reference to js,

  

<script src="{{ url_for('static',filename='js/WebAudioRecorder.min.js') }}"></script> <script src="{{ url_for('static',filename='js/app.js') }}"></script>

After starting the flask program app.py, the following error occurred and the recording could not be performed.
Log

getUserMedia() success, stream created, initializing WebAudioRecorder...
Loading mp3 encoder...
Recording started
Recording stopped
getUserMedia() success, stream created, initializing WebAudioRecorder...
Loading mp3 encoder...
Recording started
Recording stopped
getUserMedia() success, stream created, initializing WebAudioRecorder...
Loading mp3 encoder...
Recording started
Recordings
Do I need to modify the WebAudioRecorder.min.js file for this problem ?
Var o={wav:"WebAudioRecorderWav.min.js",ogg:"WebAudioRecorderOgg.min.js",mp3:"WebAudioRecorderMp3.min.js"};var t={workerDir:"/",

@skgone
Copy link

skgone commented Aug 15, 2019

I solved this problem. Just need to change the path in the app.js file, "/js"⇒"/static/js"

@Sandip2k
Copy link

I solved this problem. Just need to change the path in the app.js file, "/js"⇒"/static/js"

Yeah he is right! I also changed the workerDir in app.js from "js/" to "static/main/js/"
Change the workerDir according to your needs.

@damienwolf07
Copy link

This can be closed. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants