Hi,
I am working on a video site and need to calculate few things;
1. how to check , if the video has been played or not (after loading the page)?
2. How to calculate bandwidth used by user?
I hope to get your help.
Thanks !
Hi,
I am working on a video site and need to calculate few things;
1. how to check , if the video has been played or not (after loading the page)?
2. How to calculate bandwidth used by user?
I hope to get your help.
Thanks !
What method of deployument are you using to play the video's? if it is flash then you could always send a response to a backend file when the play button is clicked that will just increase a counter
as for bandwidth can you explain more in depth what you are trying to achieve
I am retrieving the video file (flv) from the db and passing to the player. then player runs the video. I am using embed code to run the video and site is in php, so I need php script to calculate the bandwidth.
Also, when the script generates a dynamic embed script, for the certain flv,file, counter is also modified in db.
i hope this is what you asked.
I look forward to get your help.
well kind of lolso you are using either php or javascript to output the dynamic video, does the video play from the start, is it a standard flash player or a custom one.
As for bandwidth you meantioned user you can easily get the bandwidth usage for a site from cpanel if you have it, if not then whatever alternative your hosting service uses should tell you
I am using both php and javascript. I know about cpanel. But I need to calculate used bandwidth by my self.
let me know, if you know, how to calculate it?
If the operating system is linux then you would use iptables i beleive, but it depends on who is hosting you as to if you have access or not
Is there any way, I can write my own script to calculate the band width, only used for video playing???????
hmmmm well I cant think of a way to have it 100% acurate however if you are fetching the video's dynamicly and your increasing the counter then there is no reason why in that same file you couldn't manaually update a field somewhere that will add the size of the video to a value.
so you would have your videos stored in a database i presume just add a filesize field and add that onto the current video bandwidth usage stored in another table.
thats the only way I can see you doign it
I already know this. This is not 100% accurate. what if you just open the page, it give you one hit to your counter, but you run only 50% of the file and close the page.
In this case you have 100% bandwidth. However you used only 50%. I want this accurate. not a wild guess.
sadly there wont be an accurate figure, the reason for that is the only way to calculate it would be in the flash player and sending the filesize downloaded.
But you also need to take into account that the file is streamed meaning the person could only have watched 20% of the video but have the entire video downloaded.
So again the only way really is to do an educated guess the flash player could send the number of bytes downloaded to a backend php file but thats a lot of cummunication for the server to handle.
Raw log files?
I thought about that but figured he would have the same problem as again the file is streamed
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks