Welcome to TalkGraphics.com
Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Media Player

  1. #1
    Join Date
    Dec 2018
    Location
    Australia
    Posts
    436

    Default Media Player

    With multiple players on the same page, audio in this case, but presumably the same for video, how do I make one player stop/pause when another is started manually?

    This is what I'm using to create the players.

    <audio style="width:500px;height:60px" controls>
    * * <source src="https://PATH.mp3" type="audio/mpeg">
    Your browser does not support the audio element.
    </audio>

    Also, is there a use for the 'Your browser does not...' other than info for the visitor?

  2. #2
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    9,636

    Default Re: Media Player

    Quote Originally Posted by Chris M View Post
    With multiple players on the same page, audio in this case, but presumably the same for video, how do I make one player stop/pause when another is started manually?

    This is what I'm using to create the players.

    <audio style="width:500px;height:60px" controls>
    * * <source src="https://PATH.mp3" type="audio/mpeg">
    Your browser does not support the audio element.
    </audio>

    Also, is there a use for the 'Your browser does not...' other than info for the visitor?
    I can imagine an approach similar to https://www.talkgraphics.com/showthr...399#post376399 (for videos) should work.
    It should stop the current one replace with the new and if you add autostart, or equivalent, then you have a Stop-Play setup. I cannot visualise a Pause-Play-Revert approach at present, other then going back in the browser history.

    The prose is a courtesy to those will old browsers so they know why they are missing out. Typically, you could then forward them to a browser download or alternative mechanism for accessing the sound file.

    Acorn
    Acorn - My currently active Xara software: occasionally serviced XDPX, purposely unserviced XDPX12 & XDPX11 (32/64-bit), unserviced XWD Premium 15 & 12, XPGD10, X3D7 and lots of 'permanently-owned' licences back through time (to CC's Artworks)

  3. #3
    Join Date
    Dec 2018
    Location
    Australia
    Posts
    436

    Default Re: Media Player

    Thanks for the link, but I never thought of the one player, multi content approach. I have multiple players and wondered if there was something that would run along the lines of 'pause all others when play is clicked'. I'll have a longer cruise through W3schools. My problem there is I don't really know what I'm looking for.

    Click image for larger version. 

Name:	Mix.jpg 
Views:	27 
Size:	47.4 KB 
ID:	123518

  4. #4
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    9,636

    Default Re: Media Player

    Quote Originally Posted by Chris M View Post
    Thanks for the link, but I never thought of the one player, multi content approach. I have multiple players and wondered if there was something that would run along the lines of 'pause all others when play is clicked'. I'll have a longer cruise through W3schools. My problem there is I don't really know what I'm looking for.

    Click image for larger version. 

Name:	Mix.jpg 
Views:	27 
Size:	47.4 KB 
ID:	123518
    Taking your image as an example, you might be able to code what a Play click does; pausing any current. If you can find a working example, I might be able to Xara-reverse engineer it else, like you, "I don't really know what I'm looking for."

    Acorn
    Acorn - My currently active Xara software: occasionally serviced XDPX, purposely unserviced XDPX12 & XDPX11 (32/64-bit), unserviced XWD Premium 15 & 12, XPGD10, X3D7 and lots of 'permanently-owned' licences back through time (to CC's Artworks)

  5. #5
    Join Date
    Sep 2013
    Location
    Montreal, Canada
    Posts
    444

    Default Re: Media Player

    I went through the same problem. I think that you need a jukebox. There are probably many out there if you search for them. Cincopa has one that I used:
    https://www.cincopa.com/music-player-podcast

    The only problem that I found was having to upload the songs to the Cincopa site.

    Here is a link to a site that I did a few years ago, still under construction:
    http://nathalieasselin.com/musique.htm
    I just noticed that the player buttons at the top don't work right, but when you click on another song, the first one stops and the selected one plays. I'll have to investigate this.

    CoffeCup had one that I used but it has disappeared.

    I would like another solution, a jukebox widget with the mp3 files uploaded to the site, not with a third party, so if you figure it out, I would like to know how.
    John
    Xara DPX(16.2.0.56957)

  6. #6
    Join Date
    Dec 2018
    Location
    Australia
    Posts
    436

    Default Re: Media Player

    I've searched, scratched my head, randomly pasted sample code in various places, and come to the conclusion that I really need to try and learn the basics of js.

    In the mean time I have attached an example of how I have the players set up on the page. I don't think it makes any difference, but there are 12 of them in all, and split up into different sections. Unfortunately browj12, a one player, multi content solution (jukebox) wouldn't work well in this situation. I'd also like to add that this is just something I am curious about. Nobody has ever mentioned it, and the site has been running for over 3 years. I think I've reached that stage where I want to know how things work as well as just accepting that they do.

    Audio Players.web

  7. #7
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    9,636

    Info Re: Media Player

    Chris, this will be a headscratcher but it can be developed to a greater or lesser extent: JSCSS - Multiple HTML5 Audio Players.xar; filesize is 5.71MB as 3 x MP3s are included.

    It is a series of building blocks so feel free to move bits and check what changes.

    Acorn
    Acorn - My currently active Xara software: occasionally serviced XDPX, purposely unserviced XDPX12 & XDPX11 (32/64-bit), unserviced XWD Premium 15 & 12, XPGD10, X3D7 and lots of 'permanently-owned' licences back through time (to CC's Artworks)

  8. #8
    Join Date
    Dec 2018
    Location
    Australia
    Posts
    436

    Default Re: Media Player

    Thank you Acorn, I'll have a good look at this today.

    I enjoy learning these days, can't understand why it seemed so horrendous when I was at school.

  9. #9
    Join Date
    Mar 2009
    Posts
    3,350

    Default Re: Media Player

    Because what you're learning now is immediately applicable?

  10. #10
    Join Date
    Dec 2018
    Location
    Australia
    Posts
    436

    Default Re: Media Player

    Although this one of the better looking ones, it's still of a jukebox/playlist style.

    However, and more importantly, I actually (nearly) understood how it all works. True, I have no clue as to the codelandic language in the page header, but I did understand why the different elements were needed and what role they played.

    If it were a maths test, I would have a B+ in add ups.

 

 

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •