How to do Play/Stop button?

Discussion in 'PHP' started by chaoscript, Nov 8, 2012.

  1. #1
    Hi,
    I want to make play/stop button,
    I mean, when someone click on "play" button it'll start the music, and will be "stop" button,
    Then who will click on "stop" button, the music will stop.
    Also if someone clicks play, then click on another play it's will stop automate and start the new song.

    Regards.
     
    chaoscript, Nov 8, 2012 IP
  2. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #2
    you probably should simply use flowplayer or similar
     
    stephan2307, Nov 8, 2012 IP
  3. chaoscript

    chaoscript Well-Known Member

    Messages:
    3,459
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    150
    #3
    I don't need player,
    Just when someone will click on "play" the music starts (user will not see the player).

    Regards.
     
    chaoscript, Nov 9, 2012 IP
  4. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #4
    flowplayer has an javascript api that you can use. So you can place the player inside a dive and via css move it completely out of the sceen. like position="absolute" left="-1000px"

    Then you can create your play, pause and stop buttons and create some custom js for them to work to your requirements.

    I can do that but it would cost you. send me a pm if you want me to do it.
     
    stephan2307, Nov 9, 2012 IP
  5. Syndication

    Syndication Active Member

    Messages:
    351
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    90
    #5
    Syndication, Nov 10, 2012 IP
  6. linkodev

    linkodev Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Are you looking for a mobile based solution or you want a desktop website.

    function pause(){
          if(this.aud.paused){
            this.setButton('pause');
            this.aud.play();
        }else{
            this.aud.pause();
            this.setButton('play');
        }    
     }
    PHP:
    Here is the anchor link to invoke the function above
    <a onclick="pause()" href="#">Pause</a>
    PHP:
     
    linkodev, Nov 15, 2012 IP