473,385 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 changeVisibility(id,action) {
switch (action) {
case "show":
if (layerobject)
document.layers[''+id+''].visibility = "show";
else if (allobject)
document.all[''+id+''].style.visibility = "visible";
else if (dom)
document.getElementById(''+id+'').style.visibility = "visible";
break;
case "hide":
if (layerobject)
document.layers[''+id+''].visibility = "hide";
else if (allobject)
document.all[''+id+''].style.visibility = "hidden";
else if (dom)
document.getElementById(''+id+'').style.visibility = "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(anObj) {
var movieEnd=document.movie1.GetEndTime();
var movieNow=document.movie1.GetTime();

//Start up the other player 500 milliseconds before the end of the
//first movie
timeUntilSwitch=setTimeout("switchMovie()",(movieE nd-movieNow-500));

}
function switchMovie() {
PlayIt(document.movie1);
for (var i = 1; i <= 100000; i++) {} //A small delay for startup.
changeVisibility('movie1','show');
changeVisibility('movie2','hide');
}

Oct 15 '05 #1
1 3287

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
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...
0
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...
10
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...
4
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....
2
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...
0
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,...
29
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...
1
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.