Habe immer noch ein Problem mit den stream_types
Delphi-Quellcode:
const
MAX_STREAM_TYPES = 7;
TStreamTypes : array[0..MAX_STREAM_TYPES] of string =
( 'dash', // 0 1 MPEG VLC !
'dash_playready', // 1 2 MPEG
'dash_widevine', // 2 4 MPEG
'hls', // 3 8 APPLE VLC & LAV !
'hls7', // 4 16 APPLE
'hls7_fairplay', // 5 32 APPLE
'hds', // 6 64 ADOBE none
'smooth_playready' // 7 128 ?
);
type
PQualitiesData = ^TQualitiesData;
TQualitiesData = packed record
logo_black_84: string;
title: string;
stream_types: string;
level: string;
logo_white_42: string;
logo_token: string;
logo_black_42: string;
logo_white_84: string;
availability: string;
end;
Wie übergebe ich jetzt die werte für stream_types aus der Json?
Delphi-Quellcode:
i := 0;
for iRun := 0 to doc.A['channel_groups'].Count - 1 do
begin
docChannelGroup := doc.A['channel_groups']._[iRun];
for nRun := 0 to docChannelGroup.A['channels'].Count - 1 do
begin
// Channels
docChannels := docChannelGroup.A['channels']._[nRun];
setLength(gChannels, i + 1);
gChannels[i].display_alias := docChannels.S['display_alias'];
gChannels[i].sharing := docChannels.B['sharing'];
gChannels[i].is_radio := docChannels.B['is_radio'];
gChannels[i].title := docChannels.S['title'];
gChannels[i].cid := docChannels.S['cid'];
gChannels[i].number := docChannels.I['number'];
gChannels[i].recording := docChannels.B['recording'];
// Qualities
docQualities := docChannels.A['qualities']._[xRun];
SetLength(gQualities, Length(gQualities) + 1);
gChannels[i].qualities.logo_black_84 := docqualities.S['logo_black_84'];
gChannels[i].qualities.title := docqualities.S['title'];
// gChannels[i].qualities.stream_types // Wie auswerten/ übergeben
gChannels[i].qualities.level := docqualities.S['level'];
gChannels[i].qualities.logo_white_42 := docqualities.S['logo_white_42'];
gChannels[i].qualities.logo_token := docqualities.S['logo_token'];
gChannels[i].qualities.logo_black_42 := docqualities.S['logo_black_42'];
gChannels[i].qualities.logo_white_84 := docqualities.S['logo_white_84'];
gChannels[i].qualities.availability := docqualities.S['availability'];
Inc(i);
end;
end;
Das andere geht soweit.
EDIT:
Ich kann jetzt so vorgehen.
gChannels[i].qualities.stream_types := docqualities.S['stream_types'];
Dann bekomme ich aus der Json diese werte zurück.
Code:
"stream_types": [
"dash",
"dash_playready",
"dash_widevine",
"hls7",
"hls7_fairplay"
],
Ist das so gedacht und korrekt?
Das wären dann die Typen die unterstütz werden? Richtig?