0
I’m having trouble with this code... is saying " Syntaxerror: Unexpected token < " on the Google Chrome console. But I don’t see any "," or ";" out of place. Anyone has any idea what it might be?
videojs("video", { "controls": true,
"preload": "metadata",
"poster": "<?= $video->getThumbnail($json); ?>",
textTrackSettings: false,
aspectRatio: '16:9',
fluid: true,
html5: { nativeTextTracks: false },
plugins: {
videoJsResolutionSwitcher: {
default: "high",
dynamicLabel: true
}
}
}, function() {
this.updateSrc([<?= $video->printSources($json); ?>]);
this.on('resolutionchange', function(){
console.info('Source changed to %s', this.src());
});
});
And what would that be
$video->printSources($json)
?– Woss
It would be, in php, to print a string. Code: https://hastebin.com/huxowazipu.php
– João Pedro Machado
Yes, but what is the result of this code? By the way, this code is in a PHP file or in a JS file?
– Woss
Result: https://hastebin.com/irekufozen.css Is in a . php file, inside <script>
– João Pedro Machado
And in which line did the error occur?
– Woss
Here’s the problem... no line of error, what the console says is this: http://prntscr.com/fdmeo5
– João Pedro Machado
@Andersoncarloswoss really wanted to know what the function
this.updateSrc()
expects to receive...– Daniel
https://hastebin.com/ecosehunuv.scala
– João Pedro Machado
@Andersoncarloswoss php replaces this by whatever and leaves it between keys?
– Daniel
He already comes between keys, he leaves between brackets
– João Pedro Machado
That’s what I meant - I confuse the two... :( You already "hardcoded" those two parts of php in the code and saw if it runs?
– Daniel
Yes, and there’s that mistake...
– João Pedro Machado
What is the entire JS code (already loaded in the page, without PHP in the middle)?
– Woss
This is printed on page https://hastebin.com/awitalezom.js
– João Pedro Machado
Complete code: https://hastebin.com/wigavikibi.xml
– João Pedro Machado
The JS files in
head
are all being loaded correctly?– Woss