English 中文(简体)
Need help to create playlist from DB for JW Player
原标题:

I m thinking of using JW Player to show some videos.
Currently I m using this test XML file which works great. But now I need to change this with data from a database.

First I thought I could output the HTML playlist directly:

  <div class="clearfix" id="playlist">
    <div class="jw_playlist_playlist">
      <div class="jw_playlist_item even">
        <div class="jw_playlist_title">FLV video</div>
        <div class="jw_playlist_description">Big Buck Bunny.</div>
        <div class="clear"></div>
      </div>
      <div class="jw_playlist_item odd">
        <div class="jw_playlist_image_div"> <img class="jw_playlist_image" src="files/bunny.jpg"> </div>
        <div class="jw_playlist_title">MP3 Audio with image</div>
        <div class="jw_playlist_description">Big Buck Bunny .</div>
        <div class="clear"></div>
      </div>
    </div>
  </div>

But the problem is that there is no link to the file which needs to be played, so I guess this is still in the XML file.

So that leads me to the conclution that I have to make my own XML playlist. No problem, I have done that. But my problem is this:

How do I get the player to play my newly generated playlist? Do I have to generate and save the playlist each time someone opens the page? That sesems like a bit of overkill.

My playlist looks like this now:

<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="480" height="320">
    <!-- IE params -->
    <param name="movie" value="/mediaplayer/player.swf" />
    <param name="allowfullscreen" value="true" />
    <param name="allowscriptaccess" value="always" />
    <param name="playlistsize" value="50" />
    <param name="flashvars" value="file=http://localhost/playlist.xml" />

    <!-- other browser params -->
    <embed
        type="application/x-shockwave-flash"
        id="player2"
        name="player2"
        src="/mediaplayer/player.swf" 
        width="480" 
        height="320"
        allowscriptaccess="always" 
        allowfullscreen="true"
        playlistsize ="50"
        flashvars="playlistfile=http://localhost/playlist.xml"
    />
</object>
<div id="playlist" class="clearfix"></div>

Any help is greatly appreciated.

UPDATE
Further investigation has led me to this forum page. It helps when you discover what keywords to use in search :)

I will post an update if I find the solution.

最佳回答

I found the solution.

What I did is this:

I change the playlist file to the following: flashvars="playlistfile=http://localhost/templatesNew/MultimediaPlayList.aspx?

Then I create a new ASPX file (MultimediaPlayList.aspx) which generates the XML code.

And voila :)

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签