Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Unable to play multiple flv in the swf player

4 replies [Last post]

Hi,
I am unable to get this to work. I am using swfobject 2.1 and swf player 4.6 - below my code.

When I click play for the main video it get an error that says "No suiteable model found for playback of this file"

When I click the links to play the other flv files I can see that the player reloads but when I click play nothing happens.

Below is the code:

<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/swfobject.js"></script>

<script language="JavaScript" type="text/javascript">
var player = null;

function playerReady(obj)
{
player = document.getElementById(obj.id);
};

function loadNplay(file, type, author, title, description)
{
player.sendEvent('LOAD', {file:file, type:type, author:author, title:title, description:description });
player.sendEvent('PLAY', 'true');
};
</script>

<script language="JavaScript" type="text/javascript">
var flashvars =
{
autostart: 'false',
fullscreen: 'true',
controlbar: 'bottom',
file: 'Main_Video.flv',
type: 'flash',
author: 'Feature',
title: 'Feature Video',
description: 'The video that is started when the home page is loded.'
};

var params =
{
allowscriptaccess: 'always',
allowfullscreen: 'true'
};

var attributes =
{
name: 'FeatureVid',
id: 'FeatureVid'
};

swfobject.embedSWF('player.swf', 'player', '480', '360', '9.0.124', false, flashvars, params, attributes);
</script>

<a href="#" onclick="javascript:loadNplay('PlayerA.flv', 'flash', 'PlayerA', 'PlayerA Video', 'Description1'); return false;">Link1</a>

<a href="#" onclick="javascript:loadNplay('PlayerB.flv', 'flash', 'PlayerB', 'PlayerB Video', 'Description2'); return false;">Link2</a>

<a href="#" onclick="javascript:loadNplay('PlayerC.flv', 'flash', 'PlayerC', 'PlayerC Video', 'Description3'); return false;">Link3</a>

Thanks

 
Review the File Properties flashvars here:

    http://developer.longtailvideo.com/trac/wiki/FlashVars#Fileproperties

If your media file URL ends in a recognized media file extension, like mp4, flv, jpg, mp3, etc., you don't need to specify the type. If not, the correct type for a FLV file would be video.

Thanks! It looks like it is working now.

On a side note, is there a way to automatically go back to the main video after I click one of the links?

For example, if I click Link 2 it plays the video and then stops at the end, if I were to click play it would play the same video.

Is there a way to reset back to the main video after this video is done playing?

Thanks

    <script type="text/javascript">
      var player       =  null;
      var playlist     =  null;

      function playerReady(obj)
      {
        player = gid(obj.id);
        addListeners();
      };

      function addListeners()
      {
        playlist = player.getPlaylist();

        if((playlist !== null) && (playlist.length > 0))
        {
          player.addModelListener('STATE', 'stateMonitor');
        }
        else
        {
          setTimeout("addListeners()", 100);
        }
      };

      function stateMonitor(obj)
      {
        if(obj.newstate == 'COMPLETED')
        {
          loadNplay('Main_Video.flv', 'video', 'Feature', 'Feature Video', 'The video that is started when the home page is loaded.');
        }
      };

      function loadNplay(file, type, author, title, description)
      {
        player.sendEvent('LOAD', {file:file, type:type, author:author, title:title, description:description });

        if(file == 'Main_Video.flv')
        {
          setTimeout("player.sendEvent('PLAY', 'false');", 100);
        }
        else
        {
          player.sendEvent('PLAY', 'true');
        }
      };

      function gid(name)
      {
        return document.getElementById(name);
      };
    </script>

Hi,

My problem is with the picture background on Multi FLV with IE.

With Firefox : All background images are displayed and players work fine

With IE6-7-8 : All players work fine but background images display only if you see the player on your navigator window.

To see the background images, you must make visible the player concerned and reload the page. But if you've hidden another player, the background image of it is no longer displayed.

Anyone help me ??