LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-08-2007, 12:30 AM
Agent-VIP Agent-VIP is offline
Registered User
 
Join Date: May 2007
Posts: 1
Rep Power: 0
Agent-VIP is on a distinguished road
Slight actionscript forum

Hello,

After having a video player made for my website, I quickly realised that the video was playing a little jaggery. I found out that this was because anti-aliasing was turned off, and the was to enable it was through video smoothing.

The videos played through my website are .flv.. and so the regular "video.smoothing = true | false" was said not to work for these type of files.

I found a code that should appear to work "By converting the component video player’s data type to a MovieClip, you get around the video player’s access control and can directly access its video object. This way you can then change its smoothing parameter."

Code:
MovieClip(FLVPlayer.getVideoPlayer(FLVPlayer.activeVideoPlayerIndex))._video.smoothing = true;
The actionscript I am trying to implement it into is in the following code. I've tried myself multiple times, but since i'm not a flash actionscripter I can't really say I know how to approach this anymore, other than my already-fairling trial and error. Any help would be appreciated

Code:
class VidiPlayer extends MovieClip
{
    var vid_obj, vid_file, vid_playing, vid_paused, vid_conn, vid_stream, getURL;
    function VidiPlayer(new_vid, file)
    {
        super();
        vid_obj = new_vid;
        vid_file = file;
        vid_playing = false;
        vid_paused = false;
        vid_conn = new NetConnection();
        vid_conn.connect(null);
        vid_stream = new NetStream(vid_conn);
        vid_stream.setBufferTime(2);
        vid_obj.attachVideo(vid_stream);
        vid_stream.onStatus = videoEvents;
        vid_stream.onMetaData = getDuration;
    } // End of the function
    function getVidFile()
    {
        return (vid_file);
    } // End of the function
    function getLoadedBytes()
    {
        return (vid_stream.bytesLoaded);
    } // End of the function
    function getTotalBytes()
    {
        return (vid_stream.bytesTotal);
    } // End of the function
    function getTime()
    {
        return (vid_stream.time);
    } // End of the function
    function getBufferLength()
    {
        return (vid_stream.bufferLength);
    } // End of the function
    function getBufferTime()
    {
        return (vid_stream.bufferTime);
    } // End of the function
    function getDuration(info_obj)
    {
        _root.vid_duration = info_obj.duration;
    } // End of the function
    function setVideoEvents(which_event, functions)
    {
        if (which_event == "start")
        {
            eventStart = functions;
        }
        else if (which_event == "stop")
        {
            eventStop = functions;
        }
        else if (which_event == "empty")
        {
            eventEmpty = functions;
        } // end else if
    } // End of the function
    function setSeek(new_time)
    {
        vid_stream.seek(new_time);
    } // End of the function
    function videoEvents(info_obj)
    {
        switch (info_obj.code)
        {
            case "NetStream.Play.Start":
            {
                break;
            } 
            case "NetStream.Play.Stop":
            {
                if (_root.video_vd != undefined)
                {
                    if (vid_stream.time >= _root.vid_duration)
                    {
                        _root.gotoAndPlay("endvideo");
                    } // end if
                } // end if
                break;
            } 
            case "NetStream.Buffer.Empty":
            {
                break;
            } 
            case "NetStream.Buffer.Full":
            {
                break;
            } 
            case "NetStream.Play.StreamNotFound":
            {
                _root.showThumb();
                break;
            } 
        } // End of switch
    } // End of the function
    function streamVid()
    {
        vid_stream.play(vid_file);
        vid_stream.pause();
        vid_playing = true;
        vid_paused = true;
    } // End of the function
    function playVid()
    {
        if (!vid_playing)
        {
            vid_stream.play(vid_file);
            vid_playing = true;
        }
        else if (vid_paused)
        {
            vid_stream.pause();
            vid_paused = false;
        } // end else if
    } // End of the function
    function pauseVid()
    {
        if (vid_playing && !vid_paused)
        {
            vid_stream.pause();
            vid_paused = true;
        } // end if
    } // End of the function
    function rewindVid()
    {
        if (_root.vid_duration != undefined)
        {
            var _loc3 = _root.vid_duration / 5;
            var _loc4;
            if (vid_stream.time - _loc3 < 0)
            {
                _loc4 = 0;
            }
            else
            {
                _loc4 = vid_stream.time - _loc3;
            } // end else if
            vid_stream.seek(_loc4);
        } // end if
    } // End of the function
    function stopVid()
    {
        vid_stream.seek(0);
        this.pauseVid();
    } // End of the function
    function forwardVid()
    {
        if (_root.vid_duration != undefined)
        {
            var _loc4 = _root.vid_duration / 5;
            var _loc3;
            if (vid_stream.time + _loc4 >= _root.vid_duration)
            {
                _loc3 = _root.vid_duration;
            }
            else
            {
                _loc3 = vid_stream.time + _loc4;
            } // end else if
            vid_stream.seek(_loc3);
        } // end if
    } // End of the function
    function endVid()
    {
        vid_stream.close();
        _root.autostart = false;
        _root.gotoAndPlay("endvideo");
    } // End of the function
    function eventStart()
    {
        trace ("start");
    } // End of the function
    function eventStop()
    {
        trace ("stop");
    } // End of the function
    function eventEmpty()
    {
        trace ("empty");
    } // End of the function
} // End of Class
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash ActionScript 2.0 Learning Guide chetan1 Flash 8 0 05-12-2008 06:14 AM
Flash 9 ActionScript 3.0 Preview Forum Scottae ActionScript 3.0 0 07-26-2006 06:22 PM
Advanced ActionScript Forum FlashMove FSUG 10 04-12-2004 05:54 PM
moved this from actionscript forum dazpearce Advanced Flash 5 03-08-2003 11:36 AM
JOB OPENING: Flash ActionScript Programmer barn Work/Job Opportunities 0 09-10-2001 11:41 PM




All times are GMT. The time now is 06:30 AM.