Results 1 to 5 of 5

Thread: flash web video-to play videos by html links

  1. #1
    Join Date
    Oct 2006
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default flash web video-to play videos by html links

    I have embedded a flash web video on my page. How can I play a video by html link? I would like to make a list of video files and by clicking the name of the video, I want the embedded player play it.

    Thank you in advance.

    Here is the code:

    Code:
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="320" height="240" id="FLVPlayer">
      <param name="movie" value="FLVPlayer_Progressive.swf" />
      <param name="salign" value="lt" />
      <param name="quality" value="high" />
      <param name="scale" value="noscale" />
      <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_3&streamName=myvideoplayer_files/pallethi&autoPlay=false&autoRewind=false" />
      <embed src="FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=Clear_Skin_3&streamName=myvideoplayer_files/pallethi&autoPlay=false&autoRewind=false" quality="high" scale="noscale" width="320" height="240" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    Last edited by jscheuer1; 04-16-2012 at 09:12 AM. Reason: Format

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Use the External API.

    LiveDocs: Controlling Flash Video with the External API

  3. The Following User Says Thank You to Medyman For This Useful Post:

    eth (07-28-2008)

  4. #3
    Join Date
    Oct 2006
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    I am new to javascrips that can you please help me in defining the var mentioned on the first line of the js? How can I define that flashVideoPlayer variable depending upon my embedded swf code given above?

    Thank you very much for your help Medyman

  5. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Just give your SWF an id of "videoPlayer"
    Then, you don't have to change any of the variables.

  6. The Following User Says Thank You to Medyman For This Useful Post:

    eth (07-28-2008)

  7. #5
    Join Date
    Oct 2006
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Hi again medyman,
    I have tried giving an id of videoplayer and i have copied the same codes on the page you have submitt the link. But both did not function properly. My codes on my page was:

    JAVASCRIPT:

    Code:
    <script language="JavaScript">
        // Use a variable to reference the embedded SWF file.
        var flashVideoPlayer;
        
        /* When the HTML page loads (through the onLoad event of the <body> tag), it calls the initialize() function. */
        function initialize() {
            /* Check whether the browser is IE. If so, flashVideoPlayer is
    window.videoPlayer. Otherwise, it's document.videoPlayer. The
    videoPlayer is the ID assigned to the <object> and <embed> tags. */
            var isIE = navigator.appName.indexOf("Microsoft") != -1;
            flashVideoPlayer = (isIE) ? window['videoPlayer'] : document['videoPlayer'];
        }
    
        /* When the user clicks the play button in the form, update the videoStatus text area, and call the playVideo() function within the SWF file, passing it the URL of the FLV file. */
        function callFlashPlayVideo() {
            var comboBox = document.forms['videoForm'].videos;
            var video = comboBox.options[comboBox.selectedIndex].value;
            updateStatus("____" + video + "____");
            flashVideoPlayer.playVideo("http://www.hskhidrolik.com/hizmetler/" + video);
        }
    
        // Call the pauseResume() function within the SWF file.
        function callFlashPlayPauseVideo() {
            flashVideoPlayer.pauseResume();
        }
    
        /* The updateStatus() function is called from the SWF file from the onStatus() method of the NetStream object. */
        function updateStatus(message) {
            document.forms['videoForm'].videoStatus.value += message + "\n";
        }
    </script>
    
    
    
    HTML:
    
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="320" height="240" id="VideoPlayer">
      <param name="movie" value="FLVPlayer_Progressive.swf" />
      <param name="salign" value="lt" />
      <param name="quality" value="high" />
      <param name="scale" value="noscale" />
      <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_3&streamName=myvideoplayer_files/pallethi&autoPlay=false&autoRewind=false" />
      <embed src="FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=Clear_Skin_3&streamName=myvideoplayer_files/pallethi&autoPlay=false&autoRewind=false" quality="high" scale="noscale" width="320" height="240" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    
    <form name="videoForm">
        Select a video:<br />
        <select name="videos">
            <option value="myvideoplayer_files/fiberbrdhi.flv">lights1.flv</option>
            <option value="myvideoplayer_files/pallethi.flv">clouds2.flv</option>
        </select>
        <input type="button" name="selectVideo" value="play" onClick="callFlashPlayVideo();" />
        <br /><br />
    
        Playback <input type="button" name="playPause" value="play/pause" onClick="callFlashPlayPauseVideo();" />
    
        <br /><br />
        Video status messages <br />
        <textarea name="videoStatus" cols="50" rows="10"></textarea>
    </form>
    Last edited by jscheuer1; 04-16-2012 at 09:17 AM. Reason: Format

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
  •