Forum Discussion

john john's avatar
john john
Steel Contributor
Feb 25, 2019

Show a live video inside a popup on a modern page

Inside our on-premise classic page, i have added this html/javascript inside a script editor web part:-

 

<script type="text/javascript" unselectable="on">
function showDialogCamera() {
var options = {
url: "http://**.**.**.***",
width: 800,
height: 775,
title: "Live"
};
SP.UI.ModalDialog.showModalDialog(options);
}

</script>
<li class="ms-comm-adminLinksListItem" unselectable="on"><a onclick="showDialogCamera()" href="#" unselectable="on">Live</a></li>

 

the purpose of this code is that when users click on the "Live" link a popup will be shown, showing a live video from a url. now i am planning to migrate the sites to sharepoint online, and to convert the classic page which contain the above script editor web part, into a modern page. but i am not sure what are the appraochies i have to show a popup when users click on a link inside modern page? i am planning to add a "Quick links" web part inside our modern page to define all the useful links for the users,, so i am not sure if i can allow one of the useful links to show a popup ?

2 Replies

  • NotAlex's avatar
    NotAlex
    Iron Contributor

    Yeah that JS wont work on modern pages.

     

    there is no SP.UI.ModalDialog.showModalDialog 

  • There is not a equivalent out of the box webpart in modern SPO that allow to do this...there is SPFx WebPart developed (check GitHub) by Mikael Svenson that could here

Resources