Implementing Multiple Video Players Using AVPlay in Tizen

Original Created Nov 11, 2019 | Regeneration Apr 22, 2026

I'm developing a Tizen application that requires displaying two video players simultaneously. I've tried several approaches:

  1. Using AVPlay
  2. Using VideoJS
  3. Using HTML video tags

With VideoJS and HTML video tags, I couldn't get two videos to play simultaneously. I found this reference discussing the limitation: Multiple Video Tags Not Working

For AVPlay, the documentation and samples explain how to use webapis.avplay.* methods directly. My specific questions are:

  1. How can I get an object instance of AVPlay?
  2. How to bind it with an HTML object tag?

Here's my current HTML structure:

<object id="av-player-1" type="application/avplayer"></object>
<object id="av-player-2" type="application/avplayer"></object>

When I use webapis.avplay.* methods, the video appears only in the second object tag.

Problem Understanding

The user wants to implement multiple simultaneous video players in a Tizen application. While standard HTML5 video solutions (VideoJS and video tags) don't support this functionality, the AVPlay API should theoretically allow it, but there are implementation challenges.

Solution Methods

  1. Creating AVPlay Instances:

    • Use webapis.avplay.createAVPlay() to create separate instances for each player
    • Store these instances in different variables to maintain control over each player
  2. Binding to HTML Objects:

    • After creating the AVPlay instance, use setDisplayRect() to specify the display area
    • The display area should correspond to the dimensions of your HTML object elements
  3. Managing Multiple Players:

    • Implement separate control logic for each player instance
    • Ensure proper resource management to handle multiple video streams

Code Examples

// Create first player instance
var player1 = webapis.avplay.createAVPlay();
player1.open("http://example.com/video1.mp4");
player1.setDisplayRect(0, 0, 640, 360); // Coordinates for first player
player1.prepare();

// Create second player instance
var player2 = webapis.avplay.createAVPlay();
player2.open("http://example.com/video2.mp4");
player2.setDisplayRect(640, 0, 640, 360); // Coordinates for second player
player2.prepare();

// Start playback
player1.play();
player2.play();

Additional Tips

  • Make sure to properly handle player states and errors for each instance
  • Consider memory limitations when running multiple video players
  • Test performance on target devices as multiple video playback can be resource-intensive
  • For Tizen TV applications, check the latest documentation as some APIs might have specific requirements or limitations

Customize your cookie preferences

You can enable or disable non-essential cookies. Essential cookies are always on to ensure the site works properly and to keep you signed in.

Necessary

These cookies are necessary for the website to function properly and cannot be switched off. They help with things like logging in and setting your privacy preferences.

Always on

Analytics

These cookies help us improve the site by tracking which pages are most popular and how visitors move around the site.

Enable analytics cookies
Public Forum Public Forum
Employees only. Please sign in with your company account.