SOLVED

Modern SharePoint File Viewer URL

Regular Contributor

 

Is there a way to open a file in the modern library File Viewers from a html link on a page?

 

Or will these file viewers only ever work from a link in a modern document library? they seems to just overlay the view in the current page. There must be a handler on the page to call the file viewer, as the url doesn't seem special.

 

image.png

1 Reply
best response confirmed by Warwick Ward (Regular Contributor)
Solution
Looks like I answered my own question, you can just build the link using

https://tenant/sites/sitename/assets/Forms/AllItems.aspx?id=/sites/sitename/assets/filename.wmv&parent=/sites/sitename/SiteAssets/pagename.aspx

The X button on screen will redirect to the parent in a new window, not the nice UX but at least it doesn't redirect the user back to the raw list view from a custom page.