OlivierCC / sp-client-custom-fields

Web Site: https://oliviercc.github.io/sp-client-custom-fields
MIT License
114 stars 57 forks source link

PropertyFieldOfficeVideoPicker wrong video portal url #11

Open maxmurash opened 7 years ago

maxmurash commented 7 years ago

If webpart with PropertyFieldOfficeVideoPicker is added not at the tenant root site collection, the picker can't open a video dialog.

The problem is here: https://github.com/OlivierCC/sp-client-custom-fields/blob/master/src/PropertyFieldOfficeVideoPickerHost.tsx#L246

var iframeUrl = this.props.context.pageContext.web.absoluteUrl;
iframeUrl += '/portals/hub/_layouts/15/VideoAssetDialog.aspx?list=&IsDlg=1';

Video portal url is: {RootTenantSite}/portals/hub/, not {someWeb}/portals/hub/

I suppose a good option is to use "Video REST API" and the method {RootSite}/_api/VideoService.Discover, it returns "VideoPortalUrl" and "IsVideoPortalEnabled" params.

In addition, it would be great to add a configurable parameter with the video portal url to IPropertyFieldOfficeVideoPickerProps.

Thanks a lot. Max.

OlivierCC commented 7 years ago

You are totally right Max, thanks a lot for this report. I will integrate these modifications in the next release. Thanks Olivier