Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Windows Media Server / August 2007

Tip: Looking for answers? Try searching our database.

question about playlist

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alberto - 14 Aug 2007 17:22 GMT
Please, I have a question about playlist

I have a dynamic playlist, playlist_1.asx, created by a php script from a
mysql table.
The playlist work for a video streaming website

the mysql table contain information about:

Title_movie = varchar (ex: my first movie)
Name_file = varchar (ex: clip_1.wmv)
Time_start = time (ex: 07:30:00)
Time_length = time (ex: 00:30:00)

In a website page: show_video.php I call the playlist with
<OBJECT id = "player"
CLASSID .........
    <Param Name = "autostart".....
    <Param Name = "URL" value = "playlist_1.asx"...
</OBJECT>

Now I want to show, in the php page show_video.php,  near the player, an
HTML table, like a datagrid, that show the information (Title_movie) about 5
movie near to the playing movie, and when change the movie, contextually
change the information in the table.
I appreciate suggests.
Thanks
Signature

Alberto

Neil Smith [MVP Digital Media] - 14 Aug 2007 22:03 GMT
>Please, I have a question about playlist
>
[quoted text clipped - 20 lines]
>movie near to the playing movie, and when change the movie, contextually
>change the information in the table.

Change the information in the *database* table, or in the HTML table ?

I think you're asking to change the HTML content of the table. In that
case, you can use an HTML IFrame instead, and set its
src="show_video.php"

Or you can use one of the AJAX libraries like `Prototype` or `JQuery`
to query the show_video.php page using XMLHTTP request (so the
complete web page doesn not refresh). Look up any generic examples of
"Web 2.0" for this functionality, it need not apply to video as it's
providing just HTML/XML content.

Also, what event do you want use to trigger the change ? That the user
clicks a link ? The video ends ? We need explicit examples to propose
idea ;-)

Cheers - Neil
------------------------------------------------
Digital Media MVP : 2004-2007
http://mvp.support.microsoft.com/mvpfaqs
Alberto - 15 Aug 2007 09:54 GMT
> >Please, I have a question about playlist
> >
[quoted text clipped - 41 lines]
> Digital Media MVP : 2004-2007
> http://mvp.support.microsoft.com/mvpfaqs

Ok Neil
Tanks for your help

yes a'm asking to change HTML table
You have gived me a little help:
The solution is indipendent from the playlist, because (with your help) now
I create a new XML file,

from a mysql table, and this file give me a data for the HTML table.

Example:
in my mysql table I have 8 records
   Name_file .....Time_start .... Time_length ....Title_movie
1 clip1.wmv ..... 07:00:00 ........ 00:09:59........... title1
2 clip2.wmv...... 07:10:00 ........ 00:49:59........... title2
3 clip3.wmv ..... 08:00:00 ........ 00:59:59........... title3
4 clip4.wmv ..... 09:00:00 ........ 00:59:59........... title4
5 clip5.wmv ..... 10:00:00 ........ 00:59:59........... title5
6 clip6.wmv ..... 11:00:00 ........ 00:59:59........... title6
7 clip7.wmv ..... 12:00:00 ........ 00:59:59........... title7
8 clip8.wmv...... 13:00:00 ........ 00:59:59........... title8

Now I create an XML file (with dynamic data from mysql table)  with php (I
know to

make this)
My XML file have
......
<Time_start>07:00:00</Time_start>
<Time_length>00:09:59<Time_length>
<Title_movie>title1</Title_movie>

<Time_start>07:10:00</Time_start>
<Time_length>00:49:59<Time_length>
<Title_movie>title2</Title_movie>

ecc ...
........
Now in my php page I want to write an HTML tabe that show (at 7.00.00 o'
clock )
row 1 = title1
row 2 = title2
row 3 = title3
row 4 = title4
row 5 = title5

and at 09.00.00 o' clock show (again):
row 1 = title1
row 2 = title2
row 3 = title3
row 4 = title4
row 5 = title5

BUT at 10.00.00 o'clock show
row 1 = title5
row 2 = title6
row 3 = title7
row 4 = title8
row 5 = title1

So the trigger the change to the day time whith the Time_start
I have to show a palimpsest for users to access the page (at any day time)
I know this in php but not in real time (like ajax or javascript)
Also I will like to show the current movie playing must have the title
highlighted in the HTML row table
I searched for prototype and Web 2 but I diden't find for my problem
Regards
Neil Smith [MVP Digital Media] - 15 Aug 2007 22:00 GMT
>> >Please, I have a question about playlist
>> >
[quoted text clipped - 58 lines]
>7 clip7.wmv ..... 12:00:00 ........ 00:59:59........... title7
>8 clip8.wmv...... 13:00:00 ........ 00:59:59........... title8

OK so I think from reading your table, that the data to show depends
on the time at the users computer ?

So that if the local time is (say) 10am in their timezone, you want to
load the list of clips from 10:00:00 up to 13:00:00

That is not specifically media player dependent then, it requires
simple javascript to decide which records to show, using the
javascript Date() object, for example

<script language="javascript1.2" type="text/javascript">
today = new Date()
recordsToShow = today.getUTCHours() + today.getUTCMinutes() +
today.getUTCSeconds();;
</script>

That will actually create a string recordsToShow = '215400'

Now, with reference to your XML, omit the colons ( : ) in the time
values. Those values are now sequential numbers, and are easy to
compare to the date, using  [XMLdatevalue] > recordsToShow, so you can
easily compare 110000 < 215400, but 230000 > 215400

See this page for the available methods (preference : use UTC methods
which aren't local timezone dependent)

http://www.w3schools.com/jsref/jsref_obj_date.asp

>Now I create an XML file (with dynamic data from mysql table)  with php (I
>know to
[quoted text clipped - 10 lines]
>
>ecc ...

I would seriously rewrite that to make data access simpler, either
using jQuery or Prototype, or using XSL. Anyway I'd make the nodes :

<videos>
<video start="070000">
    <length>000959</length>
    <title>title1</title>
</video>
.
.
.
</videos>

Now you can access all video nodes easily which have start >= 070000
It means you don't have to iterate every node, and remember in your
script if you are at or have passed the 070000 time node. In XPath for
example, you would have a query of

/videos/video[@start &gte; 070000]

That would select the video node, then (or instead) you could use

/videos/video[@start &gte; 070000]/length
/videos/video[@start &gte; 070000]/title

to select the actual information you want to display in the table.

This page is excellent for viewing the jQuery methods,
http://visualjquery.com/1.1.2.html and you should check the section
under DOM -> Traversing -> Find() method, which can be used to get all
matching (XPath) elements in the DOM you load into jQuery.

The complete list of jQuery selectors includes CSS3 and XPath :
http://docs.jquery.com/DOM/Traversing/Selectors although CSS3 is not
much use to you with XML content, the basic XPath above is supported
without needing to do client-side XSLT work.

>Now in my php page I want to write an HTML tabe that show (at 7.00.00 o'
>clock )
[quoted text clipped - 25 lines]
>I searched for prototype and Web 2 but I diden't find for my problem
>Regards
------------------------------------------------
Digital Media MVP : 2004-2007
http://mvp.support.microsoft.com/mvpfaqs
Alberto - 17 Aug 2007 02:22 GMT
Thank Neil for your help and your time
I have finded, with your directions, a simple solution whith XMLHttpRequest
and javascript.
Is simple and work well.

Thank again, have good time
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.