MCPcopy Create free account
hub / github.com/Tencent/libpag / CreateVideoRanges

Function CreateVideoRanges

src/platform/ohos/JsHelper.cpp:480–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478}
479
480napi_value CreateVideoRanges(napi_env env, const std::vector<PAGVideoRange>& videoRanges) {
481 napi_value result;
482 auto status = napi_create_array_with_length(env, videoRanges.size(), &result);
483 if (status != napi_ok) {
484 return nullptr;
485 }
486 for (size_t i = 0; i < videoRanges.size(); i++) {
487 auto jsVideoRange = CreateVideoRange(env, videoRanges[i]);
488 if (jsVideoRange == nullptr) {
489 return nullptr;
490 }
491 napi_set_element(env, result, i, jsVideoRange);
492 }
493 return result;
494}
495
496std::shared_ptr<ByteData> LoadDataFromAsset(NativeResourceManager* mNativeResMgr, char* srcBuf) {
497 RawFile* rawFile = OH_ResourceManager_OpenRawFile(mNativeResMgr, srcBuf);

Callers 1

GetVideoRangesFunction · 0.85

Calls 2

CreateVideoRangeFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected