Welcome to TalkGraphics.com
Page 1 of 2 12 LastLast
Results 1 to 10 of 27

Thread: Media Player

Hybrid View

  1. #1
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,902

    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 - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  2. #2
    Join Date
    Dec 2018
    Location
    Australia
    Posts
    1,787

    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.

  3. #3
    Join Date
    Mar 2009
    Posts
    4,503

    Default Re: Media Player

    Because what you're learning now is immediately applicable?

  4. #4
    Join Date
    Dec 2018
    Location
    Australia
    Posts
    1,787

    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.

  5. #5
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,902

    Default Re: Media Player

    Quote Originally Posted by Chris M View Post
    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.
    Chris, now you have confused me. You provided an image of multiple players and I built as close a facsimile. Earlier, I had suggested the use of a single Player with selectable Tracks.
    The multi-player design I came up with will keep state of where any paused Track has reached and only plays one Track at a time.

    What is missing?

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  6. #6
    Join Date
    Dec 2018
    Location
    Australia
    Posts
    1,787

    Default Re: Media Player

    Maybe nothing is missing. Maybe it's me that is missing something. Let me rephrase the 'it's still a playlist' to it's still a playlist...the way I tried it.

    I'd like to try and work it out for myself as I'm clearly clumping all the tracks into one player (placeholder). I'm still playing and head scratching, like you said I would . I haven't given up yet, I have faith.

  7. #7
    Join Date
    Dec 2018
    Location
    Australia
    Posts
    1,787

    Default Re: Media Player

    I've worked out how to change the path to the audio files, which is quite important in this case.

    Unless I'm still missing something, this is a playlist/jukebox style of player. In other words, one player, multiple tracks. For instance, if you want a block of text separating two genres then this won't do it as the tracks are in an array, you would need a separate page for each genre.

    I've never played with Supersites, but I'm under the impression a Supersite will make separate pages appear to act as one with, for instance, vertical scrolling as an option. If so, this would be an answer presuming the changing of pages would kill off the previous page's player.

    It may also be possible to have several 'named' players, but I'm wandering into the great unknown on my part with that theory.
    Still happily playing and learning.

  8. #8
    Join Date
    Mar 2019
    Posts
    1

    Default Re: Media Player

    Can someone just tell me how I can get a sound file to play when someone clicks on a picture? I know this is the wrong place to pose this question, but I cannot see how to start a thread.

  9. #9
    Join Date
    Dec 2018
    Location
    Australia
    Posts
    1,787

    Default Re: Media Player

    An elegant answer is to have the controls available for the visitor.

    Clone your picture (ctrl+k)
    Right click the clone and choose 'Web Properties'
    Click 'Placeholder' > 'HTML Code (Body)' and paste the following code

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

    The results look like the image below.
    Click image for larger version. 

Name:	Player.png 
Views:	120 
Size:	201.1 KB 
ID:	123622

  10. #10
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,902

    Default Re: Media Player

    Quote Originally Posted by Chris M View Post
    An elegant answer is to have the controls available for the visitor.

    Clone your picture (ctrl+k)
    Right click the clone and choose 'Web Properties'
    Click 'Placeholder' > 'HTML Code (Body)' and paste the following code

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

    The results look like the image below.
    Click image for larger version. 

Name:	Player.png 
Views:	120 
Size:	201.1 KB 
ID:	123622
    Chris, my approach is a complete flip to yours.
    Drag and drop your mp3 onto the design page and accept the Do not Autostart option.
    This creates your audio controls placeholder.
    In the body code of the placeholder include the phrase id="songX"
    <audio id="weapon" class="xar_meplayer" id="songX" src="index_htm_files/chooseyourweapon.mp3" controls width = "100%" height="100%"/>
    On the image, add a Link:
    javascript: document.getElementById("songX").play();
    "songX" can be any phrase, just ensure it is the same in the control and the link.

    Clicking the actual image starts the audio.

    Other shapes can have .pause() or .stop() and the audio control can be then hidden away.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

 

 

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
  •