dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: cue points in flv

  1. #1
    Senior Member
    Join Date
    Dec 2010
    Posts
    111

    cue points in flv

    Hi I am trying to display text of a cue point in flv

    cant get it working

    here is my AS3:


    video1.addEventListener("itemInfo", itemInfoHandler2);
    function itemInfoHandler2(e:Event){
    var idx:int = video1.playlist.selectedIndex;
    var lblii:String = video1.playlist.itemInfo.label;
    txt1.text = (lblii);
    }

    video1.addEventListener("mediaInfo", mediaInfoHandler2);
    function mediaInfoHandler2(e:Event){
    var idx:int = video1.playlist.selectedIndex;
    var lblmi:String = video1.playlist.mediaInfo.label;
    txt2.text = (lblmi);
    }


    any help appreciated


  2. #2
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    code:
    function mediaEventHandler(e:NetStatusEvent):void {
    trace (e.type); // trace the type of the event
    if (e.type == 'cuePoint'){
    trace (e.info.time); // show the time of a cue point
    } else if (e.type == 'mediaInfo'){
    trace (e.info.duration); // show the duration of the media file
    }
    }

    mediaplayer1.addEventListener('cuePoint', mediaEventHandler);
    mediaplayer1.addEventListener('mediaInfo', mediaEventHandler);



    For the name of a cuePoint you will need e.info.name
    Last edited by w.brants; 02-21-2011 at 12:09 PM.

  3. #3
    Junior Member
    Join Date
    Feb 2010
    Posts
    26
    great! it worked. finally got around to trying it (needed a break from computer)

    does this also work for mp3s?

  4. #4
    Senior Member
    Join Date
    Dec 2010
    Posts
    111
    yes thanks. I got it working, also ask does it work for mp3s?

  5. #5
    Senior Member
    Join Date
    Dec 2010
    Posts
    111
    ok so did some research and realise there are no cue points in mp3 files withing getting bogged down in more code. So I decided to use an audio only flv file.

    however the skin that I am using 'smalMP3' will allow playing of flvs but the level meters dont work! (which are part of the skin - not the spectrum analyser - based on volume levels not the spectrum). They work on mp3s however. Is there a way I can modify the setup.as for the skin or something similar to get the meters working on flv files?

    cheers

  6. #6
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    @rocker101, unfortunately not. Monitoring the volume of an audio channel doesn't work when playing a video file. Video is played by using a NetStream. MP3 is played in a different way. The spectrum analyzer uses all audio currently playing so works for both.

  7. #7
    Senior Member
    Join Date
    Dec 2010
    Posts
    111
    ah ok. thanks for that info. I will create a new player using spectrum analyser instead.

    also what is the code for going to a next cue point / navigation point?

    thanks

  8. #8
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    You have to get the time of the cue point and use the seek() method from the media player to go there.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center