File size: 26,609 Bytes
d7bb13e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 | 1.88 System .745
1.88.1 System.AddChatLogMessage .745
1.88.2 System.CommercePointlsClosed .746
1.88.3 System.CommercePointOpen .746
1.88.4 System.DrawText2dlnScene .748
1.88.5 System.EnableldleDisconnect .748
1.88.6 System.ExecTitle .749
1.88.7 System.GetChatLogMode .750
1.88.8 System.GetConsoleTestValue .750
1.88.9 System.GetExecTitleErrorCode .751
1.88.10 System.GetNatType .751
1.88.11 System.GetRegionsTerritory .752
1.88.12 System.GetScreenBottomRight.753
1.88.13 System.GetScreenTopLeft .753
1.88.14 System.GetUserValue .754
1.88.15 System.GetVideollploadResult .754
1.88.16 System.GetVideollploadStatus .755
1.88.17 System.GetVideollploadllrl .756
1.88.18 System.IsGameLaunchSessionActive.756
1.88.19 System.IsLookXInverted .757
1.88.20 System.IsLookYInverted .757
1.88.21 System. IsVideoSystemLocked .758
1.88.22 System.IsWideScreen .759
1.88.23 System.PostScore .759
1.88.24 System.ProfanityFilterText .760
1.88.25 System.SendNpMessage .760
1.88.26 System.SetChatLogMode .761
1.88.27 System.UploadVideo .761
1.88.28 System.VideoSystemLock.762
1.88.29 System.VideoSystemllnlock .763
1.88.30 System.WebBrowserlsClosed .764
1.88.31 System.WebBrowserOpen .764
1.88.32 System.WriteScriptedGameLaunchXML .765
System
System.AddChatLogMessage
Brief
Adds a lua message in the chat log.
Definition
1 System.AddChatLogMessage( string message, string nameOfSpeaker )
Arguments
message - The message to add to the chat log.nameOfSpeaker - The name of the speaker (optional).
Return Values
None.
Description
Adds a lua message in the chat log. If the chat log is not visible when this function is called, it will activate and display the message. The message
text will appear in a different color to the other messages (r = 0.4, g = 0.7, b = 1.0).
Examples
me = LocalPlayer.GetPerson()
j System.AddChatLogMessage( 'Good morning ' .. Person.GetName( me ) )
See Also
None
System.CommercePointlsClosed
Brief
Returns true if the commerce point is closed and false if it is open (active).
Definition
! boolean System.CommercePointlsClosed()
Arguments
None
Return Values
Returns true if the commerce point is closed and false if it is open (active).
Description
Returns true if the commerce point is closed and false if it is open (active).
Examples
if System.CommercePointlsClosed() == true then
System.CommercePointOpen( myUrl )
| end
See Also
� System.CommercePointOpen
System.CommercePointOpen
Brief
Opens a commerce point with the specified url.
Definition
number System.CommercePointOpen( string url, string rootNodeld = nil, string initNodeld = nil )
Arguments
url - The url of the commerce point.rootNodeld - The "node id" of the commerce point xml element to treat as the "root node" of the commerce
point.initNodeld - The "node id" of the commerce point xml element to treat as the "init node" of the commerce point.
Return Values
The result of the open request. Return values are:
1 - commerce point was opened
-1 - commerce point is already running
Description
Opens a commerce point with the specified url. See the return result to see if it failed or succeeded. The URL for the commerce point requires the
correct path - these are set up using a standard format as follows:
SCENE_NAME/REGION_CODE/CP<REGION_CODExCP_ShortNAMEx2_CHAR_NUM>.xml
where:
SCENE_NAME is the name of the scene including the code on the end
e.g.
E_COMPA_DW1_5C2G_J5V
XFORM_Lounge_2_9KEL_1 N8L
SCEE_PureFire_Lobby_0R2J_766
REGION_CODE is the PSN/PMT region code (SCEE=E, SCEA=A, SCEJ=J, SCEAsia=H)
CP_ShortNAME is a 'shortcode' that should be meaningful to you.
2_CFIAR_NUM is simply a two character number which can mean anything, and again should be meaningful you (e.g. a version number)
When opening a commerce point on demand using the call, simply build the commerce point file path using the known information.
For example:
SCEA user opening a specific commerce point:
XFORM_Lounge_2_9KEL_1N8L/A/CPAXFLOO.xml
where the CP_ShortNAME="XFL" and 2_CHAR_NUM="00"
SCEE user opening the same commerce point for their region:
XFORM_Lounge_2_9KEL_1 N8L/E/CPEXFL00.xml If the rootNodeld parameter is specified, the "root node" will be set. If the root node is a
<node> element, then navigation of the commerce point will be restricted to the browser page corresponding to that element, all child pages, the
item info page and the basket. If the root node is a <object> or <product> element, then navigation of the commerce point will be restricted to the
item info page and basket. If the initNodeld parameter is specified, the "init node" will be set. If the init node is a <node> element, then navigation
of the commerce point will begin at the browser page corresponding to that element, if the init node is a <object> or <product> element, then
navigation of the commerce point will begin at the item info page.
Examples
System.CommercePointOpen( 'XFORM_Lounge_2_9KEL_lN8L/E/CPEXFLOO.xml' )
System.CommercePointOpen( 'XFORM_Lounge_2_9KEL_lN8L/E/CPEXFLOO.xml', 'male headgear' )
System.CommercePointOpen( 'XFORM_Lounge_2_9KEL_lN8L/E/CPEXFLOO.xml', 'male headgear', 'big hat' )
System.CommercePointOpen( 'XFORM_Lounge_2_9KEL_lN8L/E/CPEXFLOO.xml', nil, 'big hat' )
See Also
System. CommercePointlsClosed
System.DrawText2dlnScene
Brief
Allow text to be displayed in 3D space.
Definition
System.DrawText2dInScene(string text, Vector4 position, Vector4 color,
Text3dAlign alignment, number size,
boolean isShadowed, Vector4 shadowColor,
boolean isBold, boolean isAlwaysOnTop, boolean isFixedSize)
Arguments
text - the text to be displayed.position - the 3D position at which the text will appear.color - the color of the text to be displayed.alignment - the
alignment of the text, in relation to the position given.
This will be one of the following:
� Text3dAlignment.TopLeft
� Text3dAlignment.TopMiddle
� Text3dAlignment.TopRight
� Text3dAlignment.Left
� Text3dAlignment. Center
� Text3dAlignment. Right
� Text3dAlignment.BottomLeft
� Text3dAlignment.BottomMiddle
� Text3dAlignment.BottomRight
Default is 'Text3dAlignCenter'.size - the size of the text. Default is '1.O',isShadowed - whether the text should have a drop shadow.
Default is �false'.shadowColor - the colour of the shadow, if 'isShadowed' is set to true. Default is black,
if no color is provided.isBold - whether the text is in bold font. Default is 'false'.isAlwaysOnTop - whether the text should adhere to 3D
geometry obscuring it. Default is 'false'.isFixedSize - whether the text should resize depending on distance away from camera. Default is
'false'.
Return Values
Description
Displays 2D text in 3D space, much like the avatar label user name.
Examples
System.DrawText2dInScene(text, position, color)
See Also
None
System. EnableldleDisconnect
Brief
Sets whether the idle disconnect is allowed.
Definition
System.EnableldleDisconnect(boolean enable)
Arguments
enable - True to enable or false to disable.
Return Values
None.
Description
If set to false, the user will not be disconnected if idle for too long. This can be useful for disabling the auto-disconnect while the user is watching a
full-length video for example. The idle disconnect defaults to enabled.
Examples
! System.EnableldleDisconnect(false)
See Also
None
System. ExecTitle
Brief
Launches an installed title.
Definition
number System.ExecTitle( string titleld, number param, string errorCallback )
Arguments
titleld - The title ID of the title to launch.param - Integer value that will be passed through to the launched title.errorCallback - Callback function
which will be invoked if the title fails to execute.
Return Values
0 if title not available, 1 otherwise.
Description
Launches an installed title. The integer value that is passed through to the game can be queried using the execData parameter of
cellGameGetBootGamelnfo. In the case where user confirmation is required before proceeding with ExecTitle, for example confirmation to leave a
Game Launching session, 1 will be returned to indicate no errors so far and ExecTitle will only proceed if user confirms. If user cancels then the
error callback will be invoked and this particular case should be handled. If the title fails to execute the callback will be invoked, within this callback
use System.GetExecTitleErrorCode() to retreive the error code. Scripts that make use of this function must also include a
game_launch_properties component in the object to allow PS Home to manage any potential system conflicts. Failure to comply will result in a
Lua error being generated.
Examples
gameOptions = 10
if Gamelnfo.IsGamesListBusy() == false then
System.ExecTitle( "XXXX12345", gameOptions, "MyLaunchErrorCB()" )
end
See Also
� Gamelnfo. IsGamesListBusy
� Gamelnfo.SearchByTitleld
� Gamelnfo.lsSearchFinished
� Gamelnfo.GetSearchResults
System.GetChatLogMode
Brief
Gets the current display mode of the Chat Log.
Definition
: ChatLogMode System.GetChatLogMode()
Arguments
None
Return Values
The current mode of the Chat Log. This will be one of the following:
� ChatLogMode.Minimized
� ChatLogMode.Maximized
� ChatLogMode.Closed
Description
Returns whether the mode of the Chat Log is minimized (visible but not interactive), maximized (visible and interactive), or closed.
Examples
j if (System.GetChatLogMode() ~= ChatLogMode.Closed) then
HideHud()
j end
See Also
� System.SetChatLogMode
System.GetConsoleTestValue
Brief
Gets the value of the specified test key
Definition
! string System.GetConsoleTestValue()
Arguments
None
Return Values
Description
Returns the value for a specified test key, which can be set (in the HDK and QA/test builds) by using the command 'SetConsoleTest' either
manually through the debug console or through a hubstartup.txt file
Examples
[With 'SetConsoleTest MyKey,MyValue' included in hubstartup.txt]
value = System.GetConsoleTestValue( 'MyKey' )
See Also
None
System.GetExecTitleErrorCode
Brief
Retrieves the error code set upon ExecTitle failure.
Definition
number System.GetExecTitleErrorCode()
Arguments
Return Values
error code
Description
Retrieves the error code set upon ExecTitle failure. This function is only valid within the error callback specified as part of the System.ExecTitle()
call. Error codes: 1 - unknown error 2 - parental level restricted 3 - exec title cancelled The script should use this opportunity to gracefully recover
from the failure.
Examples
function LaunchTitle()
System.ExecTitle( "XXXX12345", gameOptions, "MyLaunchErrorCB()" )
end
function MyLaunchErrorCB()
local errorCode = System.GetExecTitleErrorCode()
� Insert script here to handle the error
end
See Also
System.GetNatType
Brief
Gets the NAT type of the user.
Definition
int System.GetNatType()
Arguments
None
Return Values
The NAT type for the user, which will be either 1,2 or 3.
Description
The user's NAT type will depend on their network configuration. Users with NAT type 1 and 2 should not have any issues with PS Home
functionality. Users on NAT type 3 may not be able to fully join RtGame sessions.
Examples
allowUserToHostRtGame = true
if (System.GetNatType() == 3) then
allowUserToHostRtGame = false
� display OSD informing user of the issue
end
See Also
None
System.GetRegionsTerritory
Brief
Returns the territory of the specified region.
Definition
string System.GetRegionsTerritory( string region )
Arguments
region - The region to get the territory for, e.g. �en-GB".
Return Values
The territory of the specified region.
Description
Returns the territory of the specified region. Can be one of the following:
"SCEE" (Europe)
"SCEA" (North America)
"SCEJ" (Japan)
"SCEAsia" (Rest of Asia)
Note: the default territory is set to SCEE - this means that if the region submitted is invalid then SCEE is returned.
Examples
currentRegion = LocalPlayer.GetCurrentRegion()
print( 'My territory is ' .. System.GetRegionsTerritory( currentRegion ) )
See Also
Local Player.GetCurrentRegion
� LocalPlayer.GetHomeRegion
� LocalPlayer.GetAccountRegion
System.GetScreenBottomRight
Brief
Returns the x and y pixel values of the bottom right of the screen.
Definition
! Vector4 System.GetScreenBottomRight()
Arguments
None
Return Values
A Vector4 containing the x and y pixel values of the bottom right of the screen.
Description
Returns a Vector4 containing the x and y pixel values of the bottom right of the screen. The value differs between widescreen and 4/3 mode.
Examples
1 Renderer.DrawText2d( renderer, System.GetScreenBottomRight(), "Bottom right" )
See Also
� System.IsWideScreen
� System.GetScreenTopLeft
System.GetScreenTopLeft
Brief
Returns the x and y pixel values of the top left of the screen.
Definition
! Vector4 System.GetScreenTopLeft()
Arguments
None
Return Values
A Vector4 containing the x and y pixel values of the top left of the screen.
Description
Returns a Vector4 containing the x and y pixel values of the top left of the screen. The value differs between widescreen and 4/3 mode.
Examples
! Renderer.DrawText2d( renderer, System.GetScreenTopLeft(), "Top left" )
See Also
� System.IsWideScreen
� System.GetScreenBottomRight
System.GetUserValue
Brief
Gets a value for a specified system key
Definition
! string System.GetUserValue(string key)
Arguments
key - Key to get
Return Values
Returns the key's value or NIL if none is set
Description
Gets a system option value. System keys are controlled by HPG, and relate to future systems.
Examples
See Also
None
System.GetVideollploadResult
Brief
Retrieve the result of the last video upload request.
Definition
! Result System.GetVideoUploadResult()
Arguments
None
Return Values
One of the following result codes:
VidUploadResult.Success - success
VidllploadResult.ErrBusy - the upload utility was busy
VidUploadResult.ErrNetwork - a network error occurred
VidUploadResult.Errllnavailable - the upload service is currently unavailable
VidUploadResult.ErrQuote - service limit on upload size was exceeded
VidUploadResult.ErrMemory - out of memory
VidUploadResult.ErrFile - unable to open specified file
VidUploadResult.Errllnknown - other unspecified error
Description
Reports the current status of the video upload utility.
Examples
if ( System.GetVideoUploadResult() ~= VidUploadResult.Success ) then
print('Upload failed')
end
See Also
� System.UploadVideo
� System.GetVideoUploadStatus
� System.GetVideoUploadllrl
System.GetVideoUploadStatus
Brief
Retrieve the status of the current video upload request, if any.
Definition
! Status System.GetVideoUploadStatus()
Arguments
None
Return Values
One of the following status codes:
VidUploadStatus.ldle - no current upload
VidUploadStatus.Busy - upload utility is currently busy with another task and is unavailable
VidUploadStatus.Uploading - currently uploading
VidUploadStatus.Error - an error occurred during upload
Description
Reports the current status of the video upload utility.
Examples
while ( System.GetVideoUploadStatus() == VidUploadStatus.Uploading ) do
coroutine.yield()
end
See Also
System. UploadVideo
� System.GetVideoUploadResult
� System. GetVideollploadUrl
System.GetVideollploadUrl
Brief
Retrieve the resulting URL of the last successfully uploaded video.
Definition
! string System.GetVideoUploadUrl()
Arguments
None
Return Values
The URL as a string.
Description
Returns the URL of the uploaded video if upload succeeded, or an empty string if the upload failed.
Examples
; print( 'Your video has been uploaded to ' .. System.GetVideoUploadUrl() )
See Also
� System.UploadVideo
� System.GetVideoUploadStatus
� System.GetVideoUploadResult
System.IsGameLaunchSessionActive
Brief
Query whether the local user is part of a game launch session.
Definition
! boolean System.IsGameLaunchSessionActive()
Arguments
None
Return Values
True if the local user is part of a game launch session, or false otherwise.
Description
If the local user is part of a game launch session, a script may wish to prevent access to certain functionality. This function will indicate whether
the user is joined to a game launch session.
Examples
! if (not System.IsGameLaunchSessionActive()) then
StartVideoRecording()
| end
See Also
None
System. IsLookXInverted
Brief
Returns the user setting for X axis look invert option.
Definition
! boolean System.IsLookXInverted()
Arguments
None
Return Values
true if the user's settings in PS Home has the X axis look inverted and false otherwise.
Description
Returns true if the user's settings in PS Home has the X axis look inverted and false otherwise.
Examples
! if ( System.IsLookXInverted() ) then
angle = -angle
| end
See Also
None
System. IsLookYInverted
Brief
Returns the user setting for Y axis look invert option.
Definition
! boolean System.IsLookYInverted()
Arguments
None
Return Values
true if the user's settings in PS Home has the Y axis look inverted and false otherwise.
Description
Returns true if the user's settings in PS Home has the Y axis look inverted and false otherwise.
Examples
if ( System.IsLookYInverted() ) then
angle = -angle
end
See Also
None
System. IsVideoSystem Locked
Brief
Returns the status of the video system lock.
Definition
! boolean System.IsVideoSystemLocked()
Arguments
None
Return Values
True if the lock is being used.
Description
This will check to see if any object currently has the video system locked. This function will not return true if the scene is using the video system -
this is not considered a lock, only objects will lock the video system.
Examples
! if ( not System.IsVideoSystemLocked() ) then
if ( System.VideoSystemLock() ) then
print("Video system locked!")
else
print("Oops, the scene is using the video system. Lock will never succeed.")
end
! else
print("Oops, another object holds the lock! Can try again later.")
| end
L_
See Also
� System.VideoSystemLock
� System.VideoSystemllnlock
� Screen.Create
System.IsWideScreen
Brief
Queries whether PS Home is running in widescreen mode or not.
Definition
! boolean System.IsWideScreen()
Arguments
None
Return Values
true if PS Home is running in widescreen mode and false otherwise.
Description
Returns true if PS Home is running in widescreen mode and false otherwise.
Examples
1 if System.IsWideScreen() then
print( "You are in widescreen" )
| end
See Also
� System. GetScreenBottomRight
� System.GetScreenTopLeft
System.PostScore
Brief
Posts a score to the score service
Definition
! System.PostScore( string guid, number score, table metadata = nil )
Arguments
guid - A unique developer guid for external trackingscore - The users scoremetadata - An optional lua table containing metadata for this score
Return Values
Description
This function will upload a users score value to the score service with optional metadata, ill be encoded in Json and if any errors occur parsing the
data the score will be uploaded without it.
Examples
LoadLibrary( "System" )
local score = 100
local data = { track ="Track9", car="Car4", time="1:23:57" }
System.PostScore( "8dd2eea4-fd37-48cl-9f90-d0cbl6ca307f", score, data )
See Also
� Json. Decode
System. ProfanityFilterText
Brief
Filters a string through the profanity filter.
Definition
string System.ProfanityFilterText( string unfilteredText )
Arguments
unfilteredText - The string to be filtered for profanity.
Return Values
The string as filtered by the profanity filter.
Description
Filters a string through the profanity filter. To test if filtering happened, perform string equality test on original and returned text. Note that profanity
filtering should be applied by the receiver of text (for display purposes) and not the sender.
Examples
! displayText = System.ProfanityFilterText( receivedText )
See Also
None
System.SendNpMessage
Brief
Sends an NP message to the specified users.
Definition
System.SendNpMessage( User[] users, string subject, string body )
Arguments
users - An array of User objects.subject - The subject of the message.body - The body/main text of the message.
Return Values
None.
Description
Sends an NP message to the specified users. A popup appears requiring user interaction to send the message. Users are grouped in batches of
12. The maximum subject length is 18 bytes including 1 byte for null termination. The maximum text body is 512 bytes including 1 byte for null
termination.
Examples
friends = LocalPlayer.GetFriends()
subject = "Game Launching"
body = "Hi! We're about to game launch. Come join us!
System.SendNpMessage( friends, subject, body )
See Also
� LocalPlayer.GetFriends
System.SetChatLogMode
Brief
Sets the display mode of the Chat Log.
Definition
System.SetChatLogMode(ChatLogMode mode)
Arguments
mode - the desired mode of the Chat Log. This will be one of the following:
� ChatLogMode.Minimized
� ChatLogMode.Maximized
� ChatLogMode.Closed
Return Values
Description
Sets whether the mode of the Chat Log is minimized (visible but not interactive), maximized (visible and interactive), or closed.
Examples
System.SetChatLogMode(ChatLogMode.Maximized)
See Also
� System.GetChatLogMode
System.UploadVideo
Brief
Upload a specified video to a supported video sharing site.
Definition
boolean System.UploadVideo( FileHandle file, siteCode, ... )
Arguments
file - a handle to a video file obtained from VideoRecorder.GetOutputFilesiteCode - video sharing site ID code (see details)... - further parameters,
depending on the site code (see details)
Return Values
true if upload was successfully initiated, false otherwise.
Description
Initiates an upload of the specified video to a supported video sharing site. A variety of extra metadata may be supplied depending on the site,
see the list below:
YouTube (R) - [ string clientld ] [ string developerKey ] [ string title ]. [ string description ], [ string keywordl ], <boolean isPrivate = true> <number
rating = 0> <string keyword2 = <string keyword3 = "">
clientld - Client ID chosen by developer, max 63 bytes ASCII alphanumeric characters only.
developerKey - Developer key on YouTube. A developer should obtain this from YouTube directly (see below).
title - Video title, max 60 bytes in UTF-8.
description - Video description, max 1023 bytes in UTF-8.
keywordl, keyword2, keyword3 - Video keywords, each max 24 bytes in UTF-8.
isPrivate - Private video (only visible to uploading user).
rating - Viewer age restriction, 0 indicates no restrictions.
The client ID can be chosen by the developer and represent the object using the upload API. The developer key must
be obtained from YouTube (http://code.google.com/apis/youtube/dashboard/) and is separate from the user's username
and password. The user will be prompted for their own username and password automatically as part of the upload. Also
note that it is forbidden to charge a fee either directly or indirectly to upload videos to YouTube, this is against
the YouTube Terms of Use.
[] = compulsory
<> = optional
The siteCodes available are:
VideoSite.YouTube
Note that a successful result from this function only indicates that the upload process has started successfully, you must check the progress using
the GetVideoUploadStatus() function. The upload is not complete until the utility status is VidUploadStatus.ldle or VidUploadStatus.Error. If this
function returns false, this will indicate the uploader is busy, the script may try again a fixed number of times but it should not assume that the
upload will always succeed.
Examples
local video = VideoRecorder.GetOutputFile()
if ( System.UploadVideo( video, VideoSite.YouTube, myClientld, myDevKey, 'My Video', 'My PS Home
video', 'Home' ) ) then
print('Video uploading...')
end
See Also
� System.GetVideoUploadStatus
� System.GetVideoUploadResult
� System.GetVideoUploadUrl
� VideoRecorder.GetOutputFile
System. VideoSystem Lock
Brief
Allows a non scene object to attempt to gain access to the video system.
Definition
boolean System.VideoSysteraLock()
Arguments
None
Return Values
True if the object successfully locked the video system or false otherwise.
Description
The VideoSystem is primarily used for scenes and scene objects. Other types of object may attempt to lock the video system for use if it is not
already in use by the scene. If the lock returns true, this instance of the object may freely create and play videos. Once playback has finished, the
object must unlock the video system for use by other objects. If the lock fails, no videos can be created by non scene objects. A script can
distinguish between the two lock failure cases (another object having the lock, and the scene using the video system) by checking the
IsVideoSystemLocked function; this will only return true in the former case.
Examples
local screen = Screen.Create()
if ( not System.IsVideoSystemLocked() ) then
if ( System.VideoSystemLock() ) then
print("Video system locked!")
Screen.SetContent( screen, "http://www.mycontentserver.com/video.mp4" )
else
print("Oops, the scene is using the video system. Lock will never succeed.")
end
else
print("Oops, another object holds the lock! Can try again later.")
end
See Also
� System.VideoSystemllnlock
� System.IsVideoSystemLocked
� Screen.Create
System.VideoSystemllnlock
Brief
Unlocks the video system assuming the object currently has the lock.
Definition
! System.VideoSystemUnlock()
Arguments
None
Return Values
None.
Description
Assuming a non scene object successfully acquired the lock for the video system, this function will release the lock once the object has finished
using it. This must be called before termination of the object. The unlock call will only succeed once the video has been deleted so it may not be
possible to immediately reacquire the lock after this call.
Examples
! if ( not Screen.IsContentPlaying( myScreen ) ) then
System.VideoSystemUnlock()
j end
See Also
� System.VideoSystemLock
� System. IsVideoSystemLocked
� Screen.Create
System.WebBrowserlsClosed
Brief
Checks if the user has closed the browser.
Definition
! boolean System.WebBrowserlsClosed()
Arguments
None
Return Values
true if the user has closed the browser, false otherwise.
Description
Checks if the user has closed the browser.
Examples
local hasFinished = System.WebBrowserlsClosed()
See Also
� System.WebBrowserOpen
SystemWeb B rowserOpe n
Brief
Requests opening of the web browser.
Definition
number System.WebBrowserOpen( string url )
Arguments
url - The HTTP-based URL to open in the web browser.
Return Values
The result of the open request. Return values are:
1 - Browser was opened
0 - Browser is not available yet
-1 - Browser is already running
-2 - Browser is not permitted to run
Description
Checks for the availability of the web browser and opens it at the specified URL if available. The web browser that is opened supports Adobe
Flash Player 7.
Examples
local browserWasOpened = System.WebBrowserOpen( "http://www.example.com/" )
See Also
� System.WebBrowserlsClosed
System.WriteScriptedGameLaunchXML
|