Streaming Video

Discussion in 'HTML & Website Design' started by Matyy_22, Aug 9, 2007.

  1. #1
    Hi all,

    I want to upload videos to my site that stream, but i cant afford a hosting package that allows this. Is it possible to do it in flash? And if so, do you have any tips on creating it?

    Thanks
     
    Matyy_22, Aug 9, 2007 IP
  2. twistedspikes

    twistedspikes Notable Member

    Messages:
    5,694
    Likes Received:
    293
    Best Answers:
    0
    Trophy Points:
    280
    #2
    Yes it is.

    But if you dont have the money for hosting, how do you have the money for flash?
     
    twistedspikes, Aug 9, 2007 IP
  3. Matyy_22

    Matyy_22 Peon

    Messages:
    893
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ..well..for the moment, I am after posible founds..because I can do myself flash!!
     
    Matyy_22, Aug 9, 2007 IP
  4. Mike H.

    Mike H. Peon

    Messages:
    219
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You don't need a special hosting account to stream media files.

    Upload your videos to a folder on your site, then use the following code, modifying it for the path/filenames of your media files.

    You can also create a playlist file, or remove that option.

    This first example is IE only, because it uses an ActiveX object, the Media Player, but will work with all media file types supported by Media player.

    The second example is cross-browser, but works only with Microsoft proprietary media file types: .wmv or .wma.
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Any Title</title>
    <script type="text/javascript">
    
    	function playVideo(URL){
    
    		if (URL != ""){document.Player.filename = URL}
    	}
    	
    </script>
    </head>
    <body>
              <table align='center' cellpadding='5'>
                   <tr>
                        <td align='center'>
                             <select name='videoList' onchange="playVideo(this.value)">
                                  <option selected value="">
                                       Choose One
                                  </option>
                                  <option value="media/PlayList.wvx">
                                       Play All
                                  </option>
                                  <option value="media/video1.mpeg">
                                       First
                                  </option>
                                  <option value="media/video2.mpeg">
                                       Second
                                  </option>
                                  <option value="media/video3.mpeg">
                                       Third
                                  </option>
                                  <option value="media/video4.mpeg">
                                       Fourth
                                  </option>
                             </select>
                        </td>
                        <td align='left'>
                             <object id="Player" width="287" height="225" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
                                  <param name="BufferingTime" value="30">
                                  <param name="AudioStream" value="-1">
                                  <param name="AutoSize" value="-1">
                                  <param name="Volume" value="-400">
                             </object>
                        </td>
                   </tr>
              </table>
         </body>
    </html>
    
    Code (markup):
    Playlist code:
    
    <ASX version ="3.0">
    <Entry>
    	<Ref href="URL/video1.mpeg"/>
    </Entry>
    <Entry>
    	<Ref href="URL/video2.mpeg"/>
    </Entry>
    <Entry>
    	<Ref href="URL/video3.mpeg"/>
    </Entry>
    <Entry>
    	<Ref href="URL/video4.mpeg"/>
    </Entry>
    </ASX>
    
    Code (markup):
    Copy and paste the above code to a blank NotePad document, adjust the number of Entries as necessary, then save the file as PlayList.wvx


    Cross-Browser example:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Any Title</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript">
    
    	// create several embed strings, each with a different src
    	var mpEmbedStr1 = '<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" name="player1" autostart="1" showstatusbar="1" enablecontextmenu="false"  width="320" height="309"  transparentstart="1" loop="0"  src="video.wmv" align="center"></embed>';
    	var mpEmbedStr2 = '<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" name="player1" autostart="1" showstatusbar="1" enablecontextmenu="false"  width="320" height="309"  transparentstart="1" loop="0"  src="video.wmv" align="center"></embed>';
    	
    	function swapMedia(nStr){
    
    		// swap in/out the new embed string with the following line
    		document.getElementById('mediaplayer').innerHTML = nStr;
    	}
    	
    </script>
    <style type="text/css">
    
    	 body {background-color:#eae3c6;margin-top:60px}
    	
    </style>
    </head>
    	<body>
    		<div id="mediaplayer">
    		</div>		
    		<input type='button' value="Play 1" onclick="swapMedia(mpEmbedStr1)">
    		<br>
    		<input type='button' value="Play 2" onclick="swapMedia(mpEmbedStr2)">
    	</body>
    </html>
    
    Code (markup):
     
    Mike H., Aug 9, 2007 IP
  5. Matyy_22

    Matyy_22 Peon

    Messages:
    893
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Many thanks my friend..I will try your Html hints!!!
     
    Matyy_22, Aug 9, 2007 IP
  6. Mike H.

    Mike H. Peon

    Messages:
    219
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You're welcome, but I'm puzzled by your use of the word, "hints." They are complete, working HTML documents.
     
    Mike H., Aug 9, 2007 IP
  7. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You need streaming server to stream files "properly" but the above code will work fine in low volume sites where drm isnt an issue
     
    AstarothSolutions, Aug 9, 2007 IP
  8. Matyy_22

    Matyy_22 Peon

    Messages:
    893
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Mike is just a word, "hiunts"..is a complex and complete doc what you have provided to me..many thanx..
     
    Matyy_22, Aug 9, 2007 IP
  9. Matyy_22

    Matyy_22 Peon

    Messages:
    893
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I know that my friend..!!!
    Thanks anyway.!!;)
     
    Matyy_22, Aug 9, 2007 IP
  10. snareklutz

    snareklutz Peon

    Messages:
    32
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Progressive downloading allows people to start watching the video before it is fully downloaded, without the use of a streaming server. Give "progressive download flash" a search on Google.
     
    snareklutz, Aug 10, 2007 IP