About the Fast forward/rewind button for the Mediaplayback component

Source: Internet
Author: User
Button

Because there are some bugs in the fast forward/rewind button of the Mediaplayback component, so the function is not able to be reflected, I here through these two buttons to achieve the first song of the next selection function. Implemented as follows:
Drag the Mediaplayback component to the scene with the instance named: Mymedia, and then write the code on the first true.

var list:array = ["Cookies-Party animals. mp3", "mina-answer the phone. mp3", "tank-thousand Years of Tears. mp3"];
MP3 List
var i:number = 0;
Pointer
Mymedia.contentpath = List[i];
var controllisten:object = {};
Controllisten.playheadchange = function (eventobj:object) {
var len = list.length;
Eventobj.detail? (I=++i%len): (I=int (--i+len)%len));
EventObj.target.contentPath = "";//set to NULL here is the key, remove the words on the problem ....
EventObj.target.contentPath = List[i];
};
Mymedia.addeventlistener ("Playheadchange", Controllisten);
Registering an Back/next event
Place under the same directory "cookies-party animals. mp3", "mina-answer the phone." MP3 "," tank-thousand Years of Tears. mp3 "MP3 file (name change, and the corresponding in the array)
Run the listening effect bar.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.