Skip to content

Commit

Permalink
Redirect from Iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
manquer committed Jun 6, 2020
1 parent 3f5f56b commit 9c87a56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion frame.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,21 @@ function onProviewStart(err, id) {

function stopProview(url) {
//Post message to application loaded into application on recording stop
if (window.ProviewStatus && window.ProviewStatus == 'start') {
if ( window.ProviewStatus && window.ProviewStatus == 'start') {
ProctorClient3.stop(function() {
window.ProviewStatus = 'stop';
document.getElementById('contentIFrame').contentWindow.postMessage({
type: 'stoppedProview',
url: url
}, childOrigin);
window.location.href = url;
});
} else {
document.getElementById('contentIFrame').contentWindow.postMessage({
type: 'stoppedProview',
url: url
}, childOrigin);
window.location.href = url;
}
}
(function() {
Expand Down
2 changes: 1 addition & 1 deletion templates/tracker.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
console.log('Proview Started: PlayBackID - ' + id );
}
function onProviewStop(url) {
window.location.href = url;
}
let current = window.location.href;
let childOrigin = '*'; // can be location origin, replace with you domain
Expand Down

0 comments on commit 9c87a56

Please sign in to comment.