0

Populate a Media List from Data Feed/RSS troubleshooting

I'm trying to get my Brightsign to play whatever is in an RSS feed.

- I created an RSS feed here

- Added my RSS as a data feed in Presentation Properties:

- I set up a video zone in Brightauthor and inserted a playlist including a media list linked to my data feed:

When I hit the PREVIEW (HALF) button in the upper right, nothing plays.

What am I doing wrong?

6 comments

  • 0
    Avatar
    Bright Scripters

    The links in your feed must be accessible publicly, without the need to login.

    https://drive.google.com/file/d/11uEFAHAXibicY_V3JQtVzoqhyyMmPTO0/view?usp=drivesdk
    https://www.googleapis.com/drive/v2/files/11uEFAHAXibicY_V3JQtVzoqhyyMmPTO0?alt=media&source=downloadUrl

     

    Check your links in a different browser from the one you normally use, and do not login to your google account in that other browser.

  • 0
    Avatar
    Nils P

    Hi, did you get this working in the end @Kpekoz? I'm trying to achieve something similar in BA Connected, essentially giving my clients the option to add additional content to an existing Media List using nothing but Dropbox (they are not computer savvy at all, think retirement village). I'm assuming:

    • Zapier can generate a compliant RSS feed my HD224 can interpret
    • BS will cache all new media files locally
    • media can only be added but not removed or replaced through RSS

    I wish there was a simple 'hotfolder' functionality built in to allow them to just stick in a USB. Seems so obvious.

    Many thanks!

     

     

  • 0
    Avatar
    Kpekoz

    @Nils P I'm right there with you.  I can't understand why they haven't created a 'hotfolder' feature.  Yes, seems very obvious.  I scrapped the above idea because I could not get it to work.  Instead, I wrote an HTML5 page that pulls it's links and data from a google sheet.  The media can be stored anywhere online.  The user places a link on the google sheet and the media plays on the brightsign player.  The user has to be skilled enough to store files online and copy and paste a link, but its better than having to use BrightAuthor. I'm happy to share more if this would be useful to you 

  • 0
    Avatar
    Nils P

    that sounds like a good workaround... would love to see the solution!

    Does BS download and store the media or is this a streaming scenario? Are you displaying through the HTML or a different widget? 

  • 0
    Avatar
    Kpekoz

    This is the gist of it.  Unfortunately I can't show you the functioning page because it includes my apikey but here's the code.  You could sub in your info, or if you'd like help, feel free to contact me. The media lives online and BS just streams it.  Keeping the media online instead of downloaded to the BS boxes makes it easier to change the media.  Displaying the page through the HTML5 widget.  Using a google sheet to change the media makes it accessible anywhere and easily changeable.  You can even use google drive to host the images (the BS device can access google drive images without being logged in to google drive if you change the sharing url a little: https://drive.google.com/uc?id=****ITEM ID HERE****  It just can't access video without being logged in otherwise I would have hosted the video on google drive as well.)

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    /* Add some style to center the video and title. */
    body {
    background-color: #090527;
    color: white;
    }
    .content-container {
    display: flex;
    justify-content: space-between;
    height: 1080px;
    width: 1920px;
    font-family: "Manrope", sans-serif;
    }
    .video-container {
    width: 60%;
    display: block;
    flex-direction: column;
    justify-content: flex-start; /* Align to the top. */
    align-items: flex-start;
    }
    .video-player {
    width: 1152px;
    height: 648px;
    object-fit: fill;
    }
    .video-title {
    font-size: 48px; /* Doubled the font size. */
    margin-top: 20px;
    text-transform: uppercase; /* Make the text uppercase. */
    font-weight: 900; /* Make the text bold. */
    color: white; /* color the active item */
    }
    .playlist-container {
    width: 40%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align to the top. */
    align-items: flex-start;
    padding: 20px;
    overflow-y: auto;
    }
    .playlist-item {
    font-size: 28px;
    margin-bottom: 0px;
    text-transform: uppercase; /* Make the text uppercase. */
    font-weight: 500;
    border-bottom: 1px solid white; /* Add a border to the bottom. */
    padding-bottom: 10px; /* Add some padding to space out the text and border. */
    padding-top: 10px; /* Add some padding to space out the text and border. */
    padding-left: 20px; /* Add padding on the left. */
    padding-right: 20px; /* Add padding on the right. */
    }
    .playlist-item.active {
    color: white; /* color the active item */
    background-color: #FF6600;
    }
    .bottom-left {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 1152px;
    height: 100px;
    background-image: url('*****URL OF LOGO*****');
    background-size: cover;
    background-repeat: no-repeat;
    }
    .playlist-header {
    font-size: 54px;
    padding-left: 20px; /* Add padding on the left. */
    margin-bottom: 20px;
    font-weight: 900;
    color: white;
    }
    .video-title-box {
    background-color: #FF6600;
    width: 1132px;
    height: 172px;
    display: flex;
    padding-left: 20px; /* Add padding on the left. */
    justify-content: left;
    align-items: center;
    }
    </style>
    </head>
    <body>
    <div class="bottom-left"></div>
    <div class="content-container">
    <div class="video-container">
    <video id="videoPlayer" class="video-player" muted autoplay></video>
    <div class="video-title-box">
    <div id="videoTitle" class="video-title"></div>
    </div>
    </div>
    <div id="playlist" class="playlist-container">
    <div class="playlist-header">WHAT'S NEW!</div>
    <div id="video-list"></div>
    </div>
    </div>
    <script>
    var videos = [];
    var defaultVideo = { url: '*****URL OF DEFAULT VIDEO THAT PLAYS IF NOTHING IS SCHEDULED*****', title: 'Default Video' };
    var player = document.getElementById('videoPlayer');
    var title = document.getElementById('videoTitle');
    var playlist = document.getElementById('video-list');
    var currentVideo = -1;
    var fetchVideosInterval;
    var retryCount = 0;
    var maxRetries = 5;
    function updatePlaylist() {
    playlist.innerHTML = '';
    videos.forEach(function(video, index) {
    var currentDate = new Date();
    if (currentDate >= new Date(video.startDate) && currentDate <= new Date(video.endDate)) {
    var item = document.createElement('div');
    item.textContent = video.title;
    item.classList.add('playlist-item');
    if (index === currentVideo) {
    item.classList.add('active');
    }
    playlist.appendChild(item);
    }
    });
    }
    function playNextVideo() {
    currentVideo++;
    if (currentVideo >= videos.length) {
    // If we've reached the end of the playlist, loop back to the start.
    currentVideo = 0;
    }
    var video = videos[currentVideo];
    var currentDate = new Date();
    if (currentDate >= new Date(video.startDate) && currentDate <= new Date(video.endDate)) {
    player.src = video.url;
    title.textContent = video.title;
    updatePlaylist();
    player.play();
    } else if (currentVideo + 1 < videos.length) {
    // If not, skip to the next video.
    playNextVideo();
    } else {
    // If no videos match, play the default video.
    player.src = defaultVideo.url;
    title.textContent = defaultVideo.title;
    updatePlaylist();
    player.play();
    }
    }
    player.addEventListener('ended', playNextVideo);
    function fetchVideos() {
    $.ajax({
    url: 'https://sheets.googleapis.com/v4/spreadsheets/*****SHEED ID*****/values/Sheet1!A1:D?alt=json&key=*****APIKEY*****',
    type: 'GET',
    success: function (data) {
    // Reset retry count upon successful call
    retryCount = 0;
    videos = []; // clear the old list of videos
    data.values.slice(1).forEach(row => {
    videos.push({ url: row[0], title: row[1], startDate: row[2], endDate: row[3] });
    });
    // Start playing the first valid video.
    currentVideo = -1; // reset the current video index
    playNextVideo();
    },
    error: function (request, status, error) {
    console.error('Error occurred:', error);
    if (retryCount < maxRetries) {
    // Calculate wait time: 2 ^ retryCount * 1000 ms (or whatever base you prefer)
    var waitTime = Math.pow(2, retryCount) * 1000;
    console.log('Retrying in', waitTime, 'ms');
    // Retry after calculated delay
    setTimeout(fetchVideos, waitTime);
    // Increase retry count
    retryCount++;
    } else {
    console.error('Max retries exceeded.');
    }
    }
    });
    }
    fetchVideos();
    fetchVideosInterval = setInterval(fetchVideos, 1800000);
    // Add this event listener
    player.onerror = function() {
    console.error('Error occurred while loading video:', player.error);
    // Retry after a delay or fallback to a default video
    setTimeout(function() {
    console.log('Retrying video...');
    player.src = player.src; // retry the same video
    // player.src = defaultVideo.url; // or fallback to a default video
    player.play();
    }, 2000); // delay in milliseconds
    };
    </script>
    </body>
    </html>
  • 0
    Avatar
    Kpekoz


Please sign in to leave a comment.