• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

joshii1

Active Coder
Hello there! in my websites zoom.selync.ga and samia.selync.ga i have added a Winamp mp3/mp4 player and whenever i try to upload a file it wont allow me to do so unless that file is in a folder then it would allow me to upload it. how do i fix the code to where i can just upload a mp4 or a mp3 file into the media player?
 
the javascript file for it is... big to say the least but here is a link to the main .js file and the <script> that is in the HTML file: Main .js file

Code:
<script>
        const Webamp = window.Webamp;
        new Webamp({
            initialTracks: [{
                metaData: {
                    artist: "Kevin MacLeod",
                    title: "Study and Relax"
                },
                url: "assets/Study-and-Relax.mp3",
                duration: 223
            }],
        }).renderWhenReady(document.getElementById('app'));
       
        clippy.load('Clippy', function(agent) {
            // Do anything with the loaded agent
            agent.show();
           
            agent.speak('Welcome to Drazard`s website!');
        });
    </script>
 
the javascript file for it is... big to say the least but here is a link to the main .js file and the <script> that is in the HTML file: Main .js file

Code:
<script>
        const Webamp = window.Webamp;
        new Webamp({
            initialTracks: [{
                metaData: {
                    artist: "Kevin MacLeod",
                    title: "Study and Relax"
                },
                url: "assets/Study-and-Relax.mp3",
                duration: 223
            }],
        }).renderWhenReady(document.getElementById('app'));
      
        clippy.load('Clippy', function(agent) {
            // Do anything with the loaded agent
            agent.show();
          
            agent.speak('Welcome to Drazard`s website!');
        });
    </script>
With line 9: when trying to add a MP3 file how are you writing it under url?
 
what do you mean?
[CODE lang="javascript" highlight="9"]<script>
const Webamp = window.Webamp;
new Webamp({
initialTracks: [{
metaData: {
artist: "Kevin MacLeod",
title: "Study and Relax"
},
url: "assets/Study-and-Relax.mp3",
duration: 223
}],[/CODE]

I have highlighted the line, you have the url for the path to the file as "assets/Study-and-Relax.mp3" if you were to change that to "/Study-and-Relax.mp3" it might work.
 
Top Bottom