Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get playback status when using integrated player in Jellyfin android #189

Open
tatamiboy opened this issue Sep 26, 2024 · 6 comments
Assignees
Labels
issue A minor issue

Comments

@tatamiboy
Copy link

Describe the issue
When using the integrated player in Jellyfin android I can't get the playback status and no scripts are loaded.
When I sent a request to the jellyfin api using the curl command
curl [ServerIp]/Sessions -H "Authorization: MediaBrowser Token=[ApiKey]" | jq | grep Id,
the response contained two DeviceIds, and the order was different between the web player and the integrated player.

When making a request in the format [ServerIp]/Sessions?ApiKey=[key]&DeviceId=[id], it seems necessary to specify the first DeviceId.

For the web player:

"Id": "****",
"UserId": "****",
  "ServerId": "****",
  "Id": "****",
  "ChannelId": null,
  "ProviderIds": {},
  "ParentId": "****",
"DeviceId": "28c0b44b74216c7c",
    "Id": "****",
    "PlaylistItemId": "playlistItem1"
    "ServerId": "****",
    "Id": "****",
        "Id": "****",
    "ChannelId": null,
    "ProviderIds": {},
    "ParentId": "****",
    "DisplayPreferencesId": "****",
"PlaylistItemId": "playlistItem1",
"ServerId": "****",
  "SupportsPersistentIdentifier": true,
"Id": "****",
"UserId": "****",
"DeviceId": "28c0b44b74216c7c1306d0f125d84c849df7c75aa97deafb",
"ServerId": "****",

[ServerIp]/Sessions?ApiKey=[key]&DeviceId=28c0b44b74216c7c→ Playback status can be obtained.
[ServerIp]/Sessions?ApiKey=[key]&DeviceId=28c0b44b74216c7c1306d0f125d84c849df7c75aa97deafb → Unable to obtain playback status

For the integrated player:

"Id": "****",
"UserId": "****",
  "ServerId": "****",
  "Id": "****",
  "ChannelId": null,
  "ProviderIds": {},
  "ParentId": "****",
"DeviceId": "28c0b44b74216c7c1306d0f125d84c849df7c75aa97deafb",
"ServerId": "****",
  "SupportsPersistentIdentifier": false,
"Id": "****",
"UserId": "****",
"DeviceId": "28c0b44b74216c7c",
    "Id": "****",
    "PlaylistItemId": "playlistItem1"
    "ServerId": "****",
    "Id": "****",
        "Id": "****",
    "ChannelId": null,
    "ProviderIds": {},
    "ParentId": "****",
    "DisplayPreferencesId": "****",
"PlaylistItemId": "playlistItem1",
"ServerId": "****",

[ServerIp]/Sessions?ApiKey=[key]&DeviceId=28c0b44b74216c7c1306d0f125d84c849df7c75aa97deafb→ Playback status can be obtained.
[ServerIp]/Sessions?ApiKey=[key]&DeviceId=28c0b44b74216c7c → Unable to obtain playback status


Expected behavior
Get the correct device ID and get the playback status in the integrated player.

@tatamiboy tatamiboy added the issue A minor issue label Sep 26, 2024
@Yoooi0
Copy link
Owner

Yoooi0 commented Sep 26, 2024

I don't know how to read your output, can you post full json response when calling /Devices and /Sessions?

@tatamiboy
Copy link
Author

The output of the first post is the response of
curl [ServerIp]/Sessions -H "Authorization: MediaBrowser Token=[ApiKey]" | jq | grep Id.
Only the parts related to Id are extracted using grep. Due to my lack of understanding, I posted a confusing and incorrect explanation. I'm sorry.

The full json response is as follows (The device in issue is the A202ZT) :
/Sessions (Playing in integrated player):

[
  {
    "PlayState": {
      "PositionTicks": 20000000,
      "CanSeek": true,
      "IsPaused": false,
      "IsMuted": false,
      "VolumeLevel": 20,
      "AudioStreamIndex": 1,
      "MediaSourceId": "13d952a74d3a55e52171bdf3dc8da5c2",
      "PlayMethod": "DirectPlay",
      "RepeatMode": "RepeatNone",
      "PlaybackOrder": "Default"
    },
    "AdditionalUsers": [],
    "Capabilities": {
      "PlayableMediaTypes": [],
      "SupportedCommands": [],
      "SupportsMediaControl": false,
      "SupportsPersistentIdentifier": true,
      "SupportsContentUploading": false,
      "SupportsSync": false
    },
    "RemoteEndPoint": "192.168.10.118",
    "PlayableMediaTypes": [],
    "Id": "8550ad0b28139796d78ca60c20196467",
    "UserId": "e9f1a08cb2fb472da76f5dcaebef09ff",
    "UserName": "test",
    "Client": "Jellyfin Android",
    "LastActivityDate": "2024-09-27T00:40:29.8948561Z",
    "LastPlaybackCheckIn": "2024-09-27T00:40:27.8935249Z",
    "DeviceName": "A202ZT",
    "NowPlayingItem": {
      "Name": "sa",
      "ServerId": "58b17900344641259945392e5d1ef13c",
      "Id": "13d952a74d3a55e52171bdf3dc8da5c2",
      "DateCreated": "2024-09-26T23:50:13.6982364Z",
      "Container": "mov,mp4,m4a,3gp,3g2,mj2",
      "PremiereDate": "1970-01-01T00:00:00.0000000Z",
      "ExternalUrls": [],
      "Path": "/Media/Sync/Video/sa.mp4",
      "EnableMediaSourceDisplay": true,
      "ChannelId": null,
      "Taglines": [],
      "Genres": [],
      "RunTimeTicks": 623146670,
      "ProductionYear": 1970,
      "ProviderIds": {},
      "IsHD": true,
      "IsFolder": false,
      "ParentId": "190f045f474c3bf3d14a176bf7876ec1",
      "Type": "Video",
      "Studios": [],
      "GenreItems": [],
      "LocalTrailerCount": 0,
      "SpecialFeatureCount": 0,
      "PrimaryImageAspectRatio": 1.7777777777777777,
      "MediaStreams": [
        {
          "Codec": "h264",
          "CodecTag": "avc1",
          "Language": "und",
          "TimeBase": "1/12800",
          "VideoRange": "SDR",
          "VideoRangeType": "SDR",
          "AudioSpatialFormat": "None",
          "DisplayTitle": "720p H264 SDR",
          "NalLengthSize": "4",
          "IsInterlaced": false,
          "IsAVC": true,
          "BitRate": 959963,
          "BitDepth": 8,
          "RefFrames": 1,
          "IsDefault": true,
          "IsForced": false,
          "IsHearingImpaired": false,
          "Height": 720,
          "Width": 1280,
          "AverageFrameRate": 25,
          "RealFrameRate": 25,
          "Profile": "Main",
          "Type": "Video",
          "AspectRatio": "16:9",
          "Index": 0,
          "IsExternal": false,
          "IsTextSubtitleStream": false,
          "SupportsExternalStream": false,
          "PixelFormat": "yuv420p",
          "Level": 31,
          "IsAnamorphic": false
        },
        {
          "Codec": "aac",
          "CodecTag": "mp4a",
          "Language": "und",
          "TimeBase": "1/48000",
          "VideoRange": "Unknown",
          "VideoRangeType": "Unknown",
          "AudioSpatialFormat": "None",
          "LocalizedDefault": "デフォルト",
          "LocalizedExternal": "外部",
          "DisplayTitle": "AAC - 5.1 - デフォルト",
          "IsInterlaced": false,
          "IsAVC": false,
          "ChannelLayout": "5.1",
          "BitRate": 383727,
          "Channels": 6,
          "SampleRate": 48000,
          "IsDefault": true,
          "IsForced": false,
          "IsHearingImpaired": false,
          "Profile": "LC",
          "Type": "Audio",
          "Index": 1,
          "IsExternal": false,
          "IsTextSubtitleStream": false,
          "SupportsExternalStream": false,
          "Level": 0
        }
      ],
      "VideoType": "VideoFile",
      "ImageTags": {
        "Primary": "7157d0674d46d90e17a4af3513d298e8"
      },
      "BackdropImageTags": [],
      "ImageBlurHashes": {
        "Primary": {
          "7157d0674d46d90e17a4af3513d298e8": "WRE:SF4T-;RzWY-=xNIR%4M{tMxukooG%LV_niW;x?R9tPxsafkC"
        }
      },
      "Chapters": [],
      "Trickplay": {},
      "LocationType": "FileSystem",
      "MediaType": "Video",
      "Width": 1280,
      "Height": 720
    },
    "DeviceId": "28c0b44b74216c7ce9f1a08cb2fb472da76f5dcaebef09ff",
    "ApplicationVersion": "2.6.2",
    "IsActive": true,
    "SupportsMediaControl": false,
    "SupportsRemoteControl": false,
    "NowPlayingQueue": [],
    "NowPlayingQueueFullItems": [],
    "HasCustomDeviceName": false,
    "ServerId": "58b17900344641259945392e5d1ef13c",
    "SupportedCommands": []
  },
  {
    "PlayState": {
      "CanSeek": false,
      "IsPaused": false,
      "IsMuted": false,
      "RepeatMode": "RepeatNone",
      "PlaybackOrder": "Default"
    },
    "AdditionalUsers": [],
    "Capabilities": {
      "PlayableMediaTypes": [
        "Audio",
        "Video"
      ],
      "SupportedCommands": [
        "MoveUp",
        "MoveDown",
        "MoveLeft",
        "MoveRight",
        "PageUp",
        "PageDown",
        "PreviousLetter",
        "NextLetter",
        "ToggleOsd",
        "ToggleContextMenu",
        "Select",
        "Back",
        "SendKey",
        "SendString",
        "GoHome",
        "GoToSettings",
        "VolumeUp",
        "VolumeDown",
        "Mute",
        "Unmute",
        "ToggleMute",
        "SetVolume",
        "SetAudioStreamIndex",
        "SetSubtitleStreamIndex",
        "DisplayContent",
        "GoToSearch",
        "DisplayMessage",
        "SetRepeatMode",
        "SetShuffleQueue",
        "ChannelUp",
        "ChannelDown",
        "PlayMediaSource",
        "PlayTrailers"
      ],
      "SupportsMediaControl": true,
      "SupportsPersistentIdentifier": false,
      "SupportsContentUploading": false,
      "SupportsSync": false
    },
    "RemoteEndPoint": "192.168.10.118",
    "PlayableMediaTypes": [
      "Audio",
      "Video"
    ],
    "Id": "592c21cab9f0ed2025e2165f9e75cdde",
    "UserId": "e9f1a08cb2fb472da76f5dcaebef09ff",
    "UserName": "test",
    "Client": "Jellyfin Android",
    "LastActivityDate": "2024-09-27T00:39:35.0059889Z",
    "LastPlaybackCheckIn": "0001-01-01T00:00:00.0000000Z",
    "DeviceName": "A202ZT",
    "DeviceId": "28c0b44b74216c7c",
    "ApplicationVersion": "2.6.2",
    "IsActive": true,
    "SupportsMediaControl": true,
    "SupportsRemoteControl": true,
    "NowPlayingQueue": [],
    "NowPlayingQueueFullItems": [],
    "HasCustomDeviceName": false,
    "ServerId": "58b17900344641259945392e5d1ef13c",
    "SupportedCommands": [
      "MoveUp",
      "MoveDown",
      "MoveLeft",
      "MoveRight",
      "PageUp",
      "PageDown",
      "PreviousLetter",
      "NextLetter",
      "ToggleOsd",
      "ToggleContextMenu",
      "Select",
      "Back",
      "SendKey",
      "SendString",
      "GoHome",
      "GoToSettings",
      "VolumeUp",
      "VolumeDown",
      "Mute",
      "Unmute",
      "ToggleMute",
      "SetVolume",
      "SetAudioStreamIndex",
      "SetSubtitleStreamIndex",
      "DisplayContent",
      "GoToSearch",
      "DisplayMessage",
      "SetRepeatMode",
      "SetShuffleQueue",
      "ChannelUp",
      "ChannelDown",
      "PlayMediaSource",
      "PlayTrailers"
    ]
  }
]

/Devices:

{
  "Items": [
    {
      "Name": "A202ZT",
      "Id": "28c0b44b74216c7c",
      "LastUserName": "test",
      "AppName": "Jellyfin Android",
      "AppVersion": "2.6.2",
      "LastUserId": "e9f1a08cb2fb472da76f5dcaebef09ff",
      "DateLastActivity": "2024-09-27T00:06:42.708681Z",
      "Capabilities": {
        "PlayableMediaTypes": [],
        "SupportedCommands": [],
        "SupportsMediaControl": false,
        "SupportsPersistentIdentifier": true,
        "SupportsContentUploading": false,
        "SupportsSync": false
      }
    },
    {
      "Name": "Firefox",
      "Id": "****",
      "LastUserName": "****",
      "AppName": "Jellyfin Web",
      "AppVersion": "10.9.11",
      "LastUserId": "****",
      "DateLastActivity": "2024-09-27T00:05:53.1157239Z",
      "Capabilities": {
        "PlayableMediaTypes": [],
        "SupportedCommands": [],
        "SupportsMediaControl": false,
        "SupportsPersistentIdentifier": true,
        "SupportsContentUploading": false,
        "SupportsSync": false
      }
    },
    {
      "Name": "desktop",
      "Id": "****",
      "LastUserName": "****",
      "AppName": "Jellyfin Media Player",
      "AppVersion": "1.11.1",
      "LastUserId": "****",
      "DateLastActivity": "2024-09-26T10:13:31.702947Z",
      "Capabilities": {
        "PlayableMediaTypes": [],
        "SupportedCommands": [],
        "SupportsMediaControl": false,
        "SupportsPersistentIdentifier": true,
        "SupportsContentUploading": false,
        "SupportsSync": false
      }
    },
    {
      "Name": "Chrome Android",
      "Id": "****",
      "LastUserName": "****",
      "AppName": "Jellyfin Web",
      "AppVersion": "10.9.11",
      "LastUserId": "****",
      "DateLastActivity": "2024-09-25T09:52:55.1591842Z",
      "Capabilities": {
        "PlayableMediaTypes": [],
        "SupportedCommands": [],
        "SupportsMediaControl": false,
        "SupportsPersistentIdentifier": true,
        "SupportsContentUploading": false,
        "SupportsSync": false
      }
    },
    {
      "Name": "Firefox",
      "Id": "****",
      "LastUserName": "****",
      "AppName": "Jellyfin Web",
      "AppVersion": "10.9.11",
      "LastUserId": "****",
      "DateLastActivity": "2024-09-19T11:42:13.3567204Z",
      "Capabilities": {
        "PlayableMediaTypes": [],
        "SupportedCommands": [],
        "SupportsMediaControl": false,
        "SupportsPersistentIdentifier": true,
        "SupportsContentUploading": false,
        "SupportsSync": false
      }
    }
  ],
  "TotalRecordCount": 5,
  "StartIndex": 0
}

The web player and the integrated player are in separate sessions, and the integrated player's DeviceId is in the form of [Id, which can be obtained from /Devices] + some string.

@Yoooi0
Copy link
Owner

Yoooi0 commented Sep 27, 2024

What is the difference between integrated and web players?

Having two sessions on one device does not make sense so I dont know how to handle this.

DeviceId is in the form of [Id, which can be obtained from /Devices] + some string

Its Id + LastUserId

@tatamiboy
Copy link
Author

What is the difference between integrated and web players?

This is the player that can be selected from the Jellyfin Android client settings. The app description says the following:

Web player:
The default HTML video player from the Web UI.

Integrated player:
Based on ExoPlayer, supports more video formats and codecs, and is more integrated into the OS.

I would like to use the integrated player because it has more features and supports more codecs.

@Yoooi0
Copy link
Owner

Yoooi0 commented Sep 27, 2024

For now my only idea is to rewrite the whole Jellyfin source to enable users to select sessions instead of devices.
This probably warrants a question on jellyfin forums/github how this is supposed to be handled.
If you can filter sessions by DeviceId but there is a session with DeviceId not present in /Devices, then imo its a bug.

@tatamiboy
Copy link
Author

I see, so it is not a problem that should be handled on the MFP. I understand.
Thank you for your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue A minor issue
Projects
None yet
Development

No branches or pull requests

2 participants