473,897 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem getting the length of a rtsp streamed movie clip

I have a problem when I use javascript to get the length and position
of a movie I recieve from a rtsp stream. The length and position is
extremely high and not the actual length and position of the movie.
When I try Real Player and it's methods I recieve a length and position

of 0.
Can anyone see what I am doing wrong?
I have two players that I give the same absolute position. I hide one
and play the other. When the player have almost reached the end of the
clip, I start the clip in the other player, and hide the first player.
That is the idea, and it works on local movie files on my computer.
code :
function changeVisibilit y(id,action) {
switch (action) {
case "show":
if (layerobject)
document.layers[''+id+''].visibility = "show";
else if (allobject)
document.all[''+id+''].style.visibili ty = "visible";
else if (dom)
document.getEle mentById(''+id+ '').style.visib ility = "visible";
break;
case "hide":
if (layerobject)
document.layers[''+id+''].visibility = "hide";
else if (allobject)
document.all[''+id+''].style.visibili ty = "hidden";
else if (dom)
document.getEle mentById(''+id+ '').style.visib ility = "hidden";
break;
default:return;
}
return;

}
/* define function that calls QuickTime's "Play" method */
function PlayIt(anObj)
{
anObj.Play();
}
/* define function that calls QuickTime's "Stop" method */
function StopIt(anObj)
{
anObj.Stop();
}
function changeIfEnd(anO bj) {
var movieEnd=docume nt.movie1.GetEn dTime();
var movieNow=docume nt.movie1.GetTi me();

//Start up the other player 500 milliseconds before the end of the
//first movie
timeUntilSwitch =setTimeout("sw itchMovie()",(m ovieEnd-movieNow-500));

}
function switchMovie() {
PlayIt(document .movie1);
for (var i = 1; i <= 100000; i++) {} //A small delay for startup.
changeVisibilit y('movie1','sho w');
changeVisibilit y('movie2','hid e');
}

Oct 15 '05 #1
1 3336

torbs wrote:
I have a problem when I use javascript to get the length and position
of a movie I recieve from a rtsp stream. The length and position is
extremely high and not the actual length and position of the movie.
When I try Real Player and it's methods I recieve a length and position

of 0.
Can anyone see what I am doing wrong?
I have two players that I give the same absolute position. I hide one
and play the other. When the player have almost reached the end of the
clip, I start the clip in the other player, and hide the first player.
That is the idea, and it works on local movie files on my computer.


If I understand you correctly, your script works correctly for a movie
stored on the same ordinary html server on which the script works.
Streaming the movie in this way is sometimes called progressive
download. The movie is actually downloaded to the viewing browser, but
starts playing after a brief buffering time to allow the download to
get ahead of the playing of the movie. The download is kept in the
temporary cache of the viewing computer and allows the movie to be
played back again without re-downloading the next time you click on the
URL for the movie, unless the temporary cache is erased.

It sounds as if the rtsp stream you mention is the movie on a special
streaming server remote from the server on which you have your script.
A streaming server has the advantage that it keeps a more steady
download stream than a regular html server and limits the number of
viewers at any one time to keep the download steady. It is also
necessary for a stream without breaks, such as live radio or video.
Thus the video can be played back without downloading the whole movie
in a temporary cache as it plays. For example, for a real meida .rm
video file on a streaming server, you link to it through a redirector
..ram file which just directs to the streaming server using an address
starting with rtsp rather than html. Of course the real player can be
used to play other video formats than the Real .rm ones.

I am guessing that when you link to a streaming server, through a
redirector file, you can not access the properties of the movie. In
fact, with a video file on a streaming server, you can not usually even
download the movie to your computer. There likely is some additional
information about this on the vast Real developer site. Finding the
information in that maze could take quite a bit of time.

Oct 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3859
by: JesusFreak | last post by:
From: us_traveller@yahoo.com (JesusFreak) Newsgroups: microsoft.public.scripting.jscript Subject: toolbar script problem NNTP-Posting-Host: 192.92.126.136 Recently, I downloaded the following beautiful script "http://javascript.internet.com/navigation/toolbar-menu.html". It works like a charm. I made my webpage in frames, where the nav-frame shows the menubar, so whenever I click a link in the menubar, it opens in the frame below. But...
0
2142
by: Dionysusmtl | last post by:
I'm working on a flash portfolio that loads examples of our work (jpgs) into a movie. For example, it started off using an xml list to display certain images but I found it necessary to draw info from the database and pass some variables in the querystring to change the source of the images in the movie depending on which client is clicked. Here is the problem. I have tweaked the code and it should work fine - and sometimes it does. ...
10
4913
elamberdor
by: elamberdor | last post by:
Hello All! Well, I can load in swf's just loverly, but what I have is a sliding menu, with buttons in it, that when pressed, load an image into an empty movieclip. I really just need to know how to target back to the _root of the whole movie. It works great when the buttons and empty movieclip in the same stage or same movie clip, however I need to work out the right script to target right back to the root where i want the image to sit,...
4
3087
by: rajesh619 | last post by:
I'm new to programming. I have created a servlet which retrieves values from the database after a value is put into the HTML page to which it is attached. But during compilation, it shows two errors. Please help me in solving this error. import java.io.*; import java.util.Enumeration; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; import java.net.*;
2
3684
by: robtyketto | last post by:
Greetings, I have workable code to allow movie clips to be dragged around. However I can't find an example of a drag n drop where the movie clip has to be placed with a certain range/xy cordinates on a movie clip. For example I have a .gif of a grid of 2x2 squares how do I setup different instances of movie clips for each square to be able to detect when a object and has been dropped into it (A bit like when you can define hit areas on...
0
1624
by: snibliman | last post by:
Dear readers, I am currently making a flash based role playing game, I use flash 8 basic. I am using very simple code to deal with collisions. while (_root.wall.hitTest(_root.pc._x-pc_radius, pc._y, true)) { now first off pc stands for the player character. Second off when you move him instead of him moving everything else moves to create a scrolling world! Now the source code I used had this exact same code. As you guessed there are...
29
4110
by: Chris Riesbeck | last post by:
I have an image with a class and the class defines a clip rectangle. In Firefox 2 and 3, and Opera 9, I can access the rectangle with document.defaultView.getComputedStyle(). But that doesn't seem to work in Safari for Windows 3, nor when I use image.currentStyle.clip in IE 7. Is there a way to do this in those browsers? Am I doing something stupid?
1
5461
by: gusheneshin | last post by:
hi everyone im Using this code to Creat a Movie Clip and load a movie "SWF" into this Flash ------------ stop(); loady._x = 226.4;this.createEmptyMovieClip("loady",5);
1
3005
by: angelicdevil | last post by:
ok wat i m trying to do it get flash to read a xml file and load the titles in xml as a button into the imagetitles movie clip made on stage in flash . so that when i click on a title it displays the corresponding image, name and description form the xml onto the stage in respective movie clips. but its not loading the xml titles into the imagetitles movie clip i m uploading the zip file of the xml that i have at present ...plz check and...
0
9990
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9837
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10941
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9656
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5873
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4293
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3300
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.