Surya D'zerro
Surya D'zerro

Reputation: 11

jwplayer not display in my case

please help me fix this script:

<?php $aaa = "<script>document.writeln(enc)</script>"; 
?>

var playerInstance = jwplayer("myElement");
    playerInstance.setup({
        width: '100%',
        height: '360',
        title: 'aaaaa',
        description: 'dcascd',
        file: window.atob('<?php echo $aaa; ?>'),

});

my ext javascript

var str= "http://example.com/video.mp4";
    enc = window.btoa(str);
enc = String(enc);

player not display. please help me fix this code.

Upvotes: 1

Views: 154

Answers (1)

evolutionxbox
evolutionxbox

Reputation: 4122

In your code, $aaa equals a script tag, so you'd end up with:

    file: window.atob('<script>document.writeln(enc)</script>'),

You must remember, PHP compiles first, then JS runs after it.


The order would be:

1.

$aaa would equal <script>document.writeln(enc)</script>

2.

var playerInstance = jwplayer("myElement");
playerInstance.setup({
    width: '100%',
    height: '360',
    title: 'aaaaa',
    description: 'dcascd',
    file: window.atob('<script>document.writeln(enc)</script>"; ?>'),
});

Upvotes: 1

Related Questions