Author Topic: NOW PLAYING XML TEMPLATE  (Read 9506 times)

Valdis

  • Hero Member

  • Offline
  • *****
  • 562
  • Personal Text
    Radio is a mental condition
    • home
Re: NOW PLAYING XML TEMPLATE
« Reply #15 on: October 27, 2015, 06:49:47 PM »
so i need a webserver installed like apache? to use the generated html?, i am using MariaDB rather MYSQL, and accessing the DB via hedi sql, i would be greatfull if you could step me through the whole process, i looked at the xml for the web export, it looks like a foreign language to me, thanks again

Web server would be needed if you wanted to publish HTML for others to see. You should have started the thread by mentioning that you need HTML for xsplit broadcaster. If xsplit broadcaster reads the file from local disk, you could use relative image path. That would mean if the exported html file is at "F:\RadioDJ\now_playing_for_xsplit.html" and album art images are in "F:\RadioDJ\Album_Art", image src attribute should be "Album_Art/artist-album.jpg".

Example HTML for use as RadioDJ template:
Code: (HTML) [Select]
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Now playing: $artist$ - $title$</title>
    </head>
    <body>
        <div id="$track_id$">
            <h1>$artist$</h1>
            <h2>$title$</h2>
            <p>Album: $album$</p>
            <img src="Album_Art/$album_cover$" />
        </div>
    </body>
</html>

I'm not sure if XSplit needs header tags and wrapping elements in <body>, but you can remove those parts if XSplit doesn't like them. Try searching XSplit forums for HTML samples or start a new thread there if you can't find anything.

Btw, XML and HTML are much easier to read and understand if you have editor with syntax highlighting, like Notepad2 or Notepad++.

It's great when people ask short and to-the-point questions, but it's better if you explain what you want to accomplish, rather than what you think is what you need. If you had started this thread by explaining that you want to pass now playing info from RadioDJ to XSplit, your question may have been answered already.
I am, therefore I think.
I design and develop web apps, and have created few RadioDJ plugins - https://axellence.lv/downloads/

manishboyradio

  • Full Member

  • Offline
  • ***
  • 136
Re: NOW PLAYING XML TEMPLATE
« Reply #16 on: October 27, 2015, 06:59:20 PM »
again i do apologize, so in order for this to work i need to have webserver software running?, where do i place this template file in radio dj, in the file export?, as well how do i properly setup the web export so i can see it locally?

Thanks so much for your help

Valdis

  • Hero Member

  • Offline
  • *****
  • 562
  • Personal Text
    Radio is a mental condition
    • home
Re: NOW PLAYING XML TEMPLATE
« Reply #17 on: October 27, 2015, 07:26:51 PM »
No, web server is not needed IF XSplit reads the .hml file from local disk. I don't know how XSplit works and don't have time to research it for you. You'll have to figure out that part yourself.

Save the template file somewhere on you computer and select that file in now playing info plugin options (file export tab) and set target file path to a folder one level above your album art location.

screenshot:


And this is how generated file looks in browser:


Web export sends requests to a web server. For that you do need a web server but the server can be located anywhere and doesn't have to be installed on your PC.
Sorry, but I have to ask this: What do you want to accomplish by setting up web export?
I am, therefore I think.
I design and develop web apps, and have created few RadioDJ plugins - https://axellence.lv/downloads/

manishboyradio

  • Full Member

  • Offline
  • ***
  • 136
Re: NOW PLAYING XML TEMPLATE
« Reply #18 on: October 27, 2015, 08:21:14 PM »
Again thank you, it worked as i wanted, how do adjust the code so the picture is off to the side left or right of the text, as well the size of the text, thanks for your patience

Valdis

  • Hero Member

  • Offline
  • *****
  • 562
  • Personal Text
    Radio is a mental condition
    • home
Re: NOW PLAYING XML TEMPLATE
« Reply #19 on: October 27, 2015, 09:30:04 PM »
Again thank you, it worked as i wanted, how do adjust the code so the picture is off to the side left or right of the text, as well the size of the text, thanks for your patience

If XSplit supports CSS, you can change the look in any way you want, but if it doesn't, you'll have to rely on old-school HTML tables.

Here is a proper HTML5 with CSS:
Code: [Select]
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Now playing: $artist$ - $title$</title>
        <style>
body {
font-family: 'Open Sans', Helvetica, Arial, sans-serif;
font-size: 12px;
margin: 0; padding: 0;
}
h1, h2, h3 {
margin: 0;
padding: 0;
font-weight: lighter;
}
#main {
width: 410px;
margin: 1.44em auto;
}
header {
float: left;
width: 200px;
}
h1 {
font-size: 1.44em;
}
h2 {
font-size: 1.2em;
}
figure {
position: relative;
padding: 0;
margin: 0;
float: left;
width: 200px;
}
figure img {
width: 100%;
margin: 0;
padding: 0;
border: 0 none;
}
figcaption {
font-size: 1em;
position: absolute;
bottom: 0;
left: 0;
background: rgba(0,0,0,0.5);
color: #fff;
padding: 0.5em;
margin-bottom: 0.3em;
}
figcaption small {
display: block;
color: #fff;
text-align: right;
position: absolute;
top: -1em;
right: 0.5em;
}
</style>

    </head>
    <body>
        <section id="main">
            <header>
                        <h1>$artist$</h1>
                        <h2>$title$</h2>
            </header>
            <figure>
                <img src="Album-Art/$album_cover$" width="200" />
                <figcaption>$album$ <small>$year$</small></figcaption>
            </figure>
        </section>
    </body>
</html>

An this is how it looks:


But there is no way to make sure the album art image exists or that the value is not empty. If image doesn't exist or album art field is empty, you may get broken image icon.
I am, therefore I think.
I design and develop web apps, and have created few RadioDJ plugins - https://axellence.lv/downloads/

manishboyradio

  • Full Member

  • Offline
  • ***
  • 136
Re: NOW PLAYING XML TEMPLATE
« Reply #20 on: October 27, 2015, 09:36:49 PM »
Thanks again, i will let you know if this works:)

manishboyradio

  • Full Member

  • Offline
  • ***
  • 136
Re: NOW PLAYING XML TEMPLATE
« Reply #21 on: October 28, 2015, 01:14:13 AM »
The text comes up no problem in the web browser but the picture does not appear, when xsplit reads the css it just displays the entire code and not the result, lol, i will research how to make HTML table, lol, thanks so much for your help

Valdis

  • Hero Member

  • Offline
  • *****
  • 562
  • Personal Text
    Radio is a mental condition
    • home
Re: NOW PLAYING XML TEMPLATE
« Reply #22 on: October 28, 2015, 02:39:46 AM »
Quote
The text comes up no problem in the web browser but the picture does not appear, when xsplit reads the css it just displays the entire code and not the result, lol, i will research how to make HTML table, lol, thanks so much for your help

Well, <table>s were used for HTML layouts in 1990s and some still use them today, but they (tables AND people who use them) should be avoided if possible.

If XSplit doesn't render CSS styling, you'll have to do it the 90s way with tables:
Code: [Select]
<table cellpadding="5" cellspacing="0" border="0" align="center" width="410" valign="top">
<tr>
<td valign="top">
<h1>$artist$</h1>
<h2>$title$</h2>
<!-- this is LOL -->
</td>
<td width="200" valign="top">
<img src="Album_Art/$album_cover$" width="200" border="0" /><br />
<span>$album$</span><br />
<small>released: $year$</small>

</td>
</tr>
</table>

Web developers using tables for layouts and <font> tags for text formatting should be called "develoretards". Jus' sayin'. LOL
I am, therefore I think.
I design and develop web apps, and have created few RadioDJ plugins - https://axellence.lv/downloads/

manishboyradio

  • Full Member

  • Offline
  • ***
  • 136
Re: NOW PLAYING XML TEMPLATE
« Reply #23 on: October 28, 2015, 03:09:26 AM »
gotcha!, i will try this one, thanks again i owe ya:)

Capt_Fuzzy

  • Hero Member

  • Offline
  • *****
  • 1078
  • Personal Text
    "Quiet numbskulls, I'm broadcasting!" ~ Moe Howard
    • WVRR - Ridgerunners Radio
Re: NOW PLAYING XML TEMPLATE
« Reply #24 on: October 28, 2015, 07:04:54 AM »
Well, <table>s were used for HTML layouts in 1990s and some still use them today, but they (tables AND people who use them) should be avoided if possible.

Web developers using tables for layouts and <font> tags for text formatting should be called "develoretards". Jus' sayin'. LOL
Easy now!!  :D

I'm one of "those guys" though I will admit that I am in the process of familiarizing myself better with css, so hopefully not for long...  :hihi:

P.S.: I'm 49, so I've used the '1990s' method for a long time. Hell, my first "program" was written in BASIC back in the 1980s!!  :D
Steve 'Capt Fuzzy' Wade
Proud & Satisfied "Long-term" RadioDJ User
(Currently making the transition to v2)

WVRR - Ridgerunners Radio
The best mix of your favorites!

Valdis

  • Hero Member

  • Offline
  • *****
  • 562
  • Personal Text
    Radio is a mental condition
    • home
Re: NOW PLAYING XML TEMPLATE
« Reply #25 on: October 30, 2015, 10:44:08 PM »
Easy now!!  :D

I'm one of "those guys" though I will admit that I am in the process of familiarizing myself better with css, so hopefully not for long...  :hihi:

P.S.: I'm 49, so I've used the '1990s' method for a long time. Hell, my first "program" was written in BASIC back in the 1980s!!  :D

Sorry, I didn't mean to offend you, Cat'n. That's the thing with old habits. Hard to teach new tricks to old dog.
I'm a bit younger but also wrote my first lines of code in BACIS and it was in early 1990s. But I'm trying to keep myself up to date with latest and greatest web standards. That's why I'm dismissive of people using the HTML features.

Okay. Enough off topic.
I am, therefore I think.
I design and develop web apps, and have created few RadioDJ plugins - https://axellence.lv/downloads/

Capt_Fuzzy

  • Hero Member

  • Offline
  • *****
  • 1078
  • Personal Text
    "Quiet numbskulls, I'm broadcasting!" ~ Moe Howard
    • WVRR - Ridgerunners Radio
Re: NOW PLAYING XML TEMPLATE
« Reply #26 on: October 31, 2015, 12:21:08 AM »
I wasn't offended, just 'jerking your chain' so to speak...  :D

I too am trying to keep up with the 'new' stuff, it's nearly a full-time job in and of itself.  ;D
Steve 'Capt Fuzzy' Wade
Proud & Satisfied "Long-term" RadioDJ User
(Currently making the transition to v2)

WVRR - Ridgerunners Radio
The best mix of your favorites!

wtmuradio

  • New User

  • Offline
  • *
  • 24
    • Wtmuradiotv.com
Re: NOW PLAYING XML TEMPLATE
« Reply #27 on: October 31, 2015, 03:17:06 PM »
Sorry, I didn't mean to offend you, Cat'n. That's the thing with old habits. Hard to teach new tricks to old dog.
I'm a bit younger but also wrote my first lines of code in BACIS and it was in early 1990s. But I'm trying to keep myself up to date with latest and greatest web standards. That's why I'm dismissive of people using the HTML features.


i use a program for live video streaming also im just wondering if it will work with it since the program does use xaml
Darrin K
Wtmuradiotv.com