mirror of
https://github.com/photonstorm/phaser
synced 2024-11-29 16:10:56 +00:00
Merge branch 'master' of https://github.com/photonstorm/phaser
This commit is contained in:
commit
36b91a2546
2 changed files with 8 additions and 3 deletions
|
@ -811,10 +811,11 @@ var Video = new Class({
|
|||
* @param {string} url - The URL of the video to load or be streamed.
|
||||
* @param {string} [loadEvent='loadeddata'] - The load event to listen for. Either `loadeddata`, `canplay` or `canplaythrough`.
|
||||
* @param {boolean} [noAudio=false] - Does the video have an audio track? If not you can enable auto-playing on it.
|
||||
* @param {string} [crossOrigin] - The value to use for the `crossOrigin` property in the video load request. Either undefined, `anonymous` or `use-credentials`
|
||||
*
|
||||
* @return {this} This Video Game Object for method chaining.
|
||||
*/
|
||||
loadURL: function (url, loadEvent, noAudio)
|
||||
loadURL: function (url, loadEvent, noAudio, crossOrigin)
|
||||
{
|
||||
if (loadEvent === undefined) { loadEvent = 'loadeddata'; }
|
||||
if (noAudio === undefined) { noAudio = false; }
|
||||
|
@ -844,6 +845,10 @@ var Video = new Class({
|
|||
video.setAttribute('playsinline', 'playsinline');
|
||||
video.setAttribute('preload', 'auto');
|
||||
|
||||
if(crossOrigin !== undefined) {
|
||||
video.setAttribute('crossorigin', crossOrigin);
|
||||
}
|
||||
|
||||
video.addEventListener('error', this._callbacks.error, true);
|
||||
|
||||
video.src = url;
|
||||
|
|
|
@ -802,11 +802,11 @@ var Tilemap = new Class({
|
|||
sprite.displayHeight = obj.height;
|
||||
}
|
||||
|
||||
// Origin is (0, 1) in Tiled, so find the offset that matches the Sprites origin.
|
||||
// Origin is (0, 1) for tile objects or (0, 0) for other objects in Tiled, so find the offset that matches the Sprites origin.
|
||||
// Do not offset objects with zero dimensions (e.g. points).
|
||||
var offset = {
|
||||
x: sprite.originX * obj.width,
|
||||
y: (sprite.originY - 1) * obj.height
|
||||
y: (sprite.originY - (obj.gid ? 1 : 0)) * obj.height
|
||||
};
|
||||
|
||||
// If the object is rotated, then the origin offset also needs to be rotated.
|
||||
|
|
Loading…
Reference in a new issue