语言

Menu
Sites
Language
Player - progressive download

Hello!

I'm using Player to play video from external URI. I need to store a video cache if the user went offline. I've tried to find out how the progressive downloading works. I've created the sample project called "Media Sample Application" and made some changes in  _create_player() function of src/player/src/camera-player-view.c file:

static player_h _create_player(camera_player_view *this)
{
    player_h player = NULL;

    if(player_create(&player) == PLAYER_ERROR_NONE)
    {
        player_set_sound_type(player, SOUND_TYPE_MEDIA);
        player_set_volume(player, 1.0, 1.0);
        player_set_looping(player, true);

        player_set_uri(player, "http:*Some external link. Forum don't allow to put it here*.mp4");
        player_set_display(player, PLAYER_DISPLAY_TYPE_EVAS, GET_DISPLAY(this->video_rect));
        player_set_display_mode(player, PLAYER_DISPLAY_MODE_FULL_SCREEN);
        player_set_display_visible(player, true);
        player_set_progressive_download_path(player, "/opt/usr/apps/org.tizen.media/shared/trusted");
        player_prepare(player);
    }

    return player;
}

For testing I'm using emulator. Without player_set_progressive_download_path() function everything works fine. Video loaded from the server. But when I set the progressive download path, I get an error:

04-17 16:38:29.194 : ERROR / TIZEN_N_PLAYER ( 6663 : 6663 ) : player.c: __convert_error_code(218) > [player_start] PLAYER_ERROR_INVALID_OPERATION(0xffffffda) : core fw error(0x80000409)

I've tried many different paths such as "/opt/usr/apps/org.tizen.media/data" or "/opt/usr/apps/org.tizen.media/cache" but the problem is still present.

In Player API Reference written - "The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare()." So I put this function before calling player_prepare(player);

Unfortunately I didn't found any tutorials about progressive downloading method. So maybe I'm doing something wrong. Can you help me?

 

编辑者为: Yuriy Kurin 17 4月, 2015

响应

8 回复
Jean Yang

Hi,

I have try code as as below, after test, the error_code is 0; BTW, I have set the previliege for internet in manifest

 char *data_path = app_get_data_path();

error_code = player_set_progressive_download_path(player, data_path);

 

 

Yuriy Kurin

I know it. player_set_progressive_download_path returns 0 for me too. I talking about an error which appears when player_start function is calling. This function returns -38. If you look at the log that I have provided above, you will see this.

Repeat the above log:

04-17 16:38:29.194 : ERROR / TIZEN_N_PLAYER ( 6663 : 6663 ) : player.c: __convert_error_code(218) > [player_start] PLAYER_ERROR_INVALID_OPERATION(0xffffffda) : core fw error(0x80000409)

Jean Yang

Hi,

I have tested the above code on the Z1 and found the same issue as you, the return value of player_start is -38(PLAYER_ERROR_INVALID_OPERATION),  I have try to put the player_set_progressive_download_message_cb in different place where the player state is idle, the result is the same, seems there is a bug here.

daniel kim

Hi,

According to below description, moov box should be placed in beginning of file. 

Video in the server is required to be converted for progressive download.  

    https://developer.tizen.org/ko/documentation/guides/native-application/multimedia/player

      : The index table (atoms) must be moved in front of the file for progressive download.

This link akso has useful information.

   http://support.polkast.com/entries/23368567-Converting-MP4-to-support-progressive-streaming

Regards,

 

Jean Yang

Hi Daniel,

Thanks for your info, I have one question, in the above link, it mentioned the below solution in Android, I guess the same to Tizen:

The only solution is to fix those files and reorder the atoms inside. This can be done:

The code moves the "moov" atom at the top of the file and update all the "stco" sub-atoms pointers by adding the proper offset.

But if we don't download the MP4 file, how can we change the interal structure of MP4 file?

daniel kim

Hi,

Like in below link, video file in the server should be encoded again by specific tool(MP4creator or timicParsley in below link).

So normal video file can't be served in the server for progressive download.

http://www.adobe.com/devnet/video/articles/mp4_movie_atom.html

Regards,

Jean Yang

Hi Daniel,

That means if we can process the progressive download not decided by the client(Mobile phone), the key is the codec type in the server side. Is this right?

daniel kim

Yes, it's up to video file in the server.

Regards,