{"_id":"5bec8a15287d1b00426efe15","category":{"_id":"5bec8a15287d1b00426efdcb","version":"5bec8a15287d1b00426efe54","project":"578c4badbd223d2000cc1441","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-08-01T23:04:12.838Z","from_sync":false,"order":8,"slug":"api-reference","title":"API Reference"},"project":"578c4badbd223d2000cc1441","user":"579fce4e1435850e00dfbbbb","parentDoc":null,"version":{"_id":"5bec8a15287d1b00426efe54","project":"578c4badbd223d2000cc1441","__v":0,"forked_from":"5ba2b5747091250003437507","createdAt":"2018-04-23T20:03:35.726Z","releaseDate":"2018-04-23T20:03:35.726Z","categories":["5bec8a15287d1b00426efdc6","5bec8a15287d1b00426efdc7","5bec8a15287d1b00426efdc8","5bec8a15287d1b00426efdc9","5bec8a15287d1b00426efdca","5bec8a15287d1b00426efdcb","5bec8a15287d1b00426efdcc","5bec8a15287d1b00426efdcd","5bec8a15287d1b00426efdce"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.12.0","version":"2.12.0"},"githubsync":"","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-04-04T00:07:09.780Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":26,"body":"A component that provides a control for video materials. This can be used to start, stop, play video textures.\n\n######Example use:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\n<ViroMaterialVideo ref={\\\"video_ref\\\"} material={\\\"test_material\\\"} paused={false}\\n           onBufferStart={this._onBufferStart} onBufferEnd={this._onBufferEnd}\\n          loop={true} muted={false} volume={1.0}\\n          onFinish={this._onVideoFinished} onUpdateTime={this._onUpdateTime} />\\n\\n//Video texture example:\\n \\nViroMaterials.createMaterials({\\n  test_material: {\\n    shininess: 2.0,\\n    lightingModel: \\\"Lambert\\\",\\n    diffuseTexture: require('./res/test_video.mp4'),\\n  },\\n});\\n\\n\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Props\"\n}\n[/block]\n##Optional Props\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"**material**\",\n    \"0-1\": \"**PropTypes.string**\\nA string that each represent a video material that was created via ViroMaterials.createMaterials(). \\n\\nA video material has it's diffuseTexture property set to a video asset.\",\n    \"h-0\": \"PropKey\",\n    \"h-1\": \"PropType\",\n    \"1-0\": \"**paused**\",\n    \"2-0\": \"**loop**\",\n    \"3-0\": \"**muted**\",\n    \"9-0\": \"**volume**\",\n    \"1-1\": \"**PropTypes.bool**\\n\\nSet to true to pause the video. This is set to false by default.\",\n    \"2-1\": \"**PropTypes.bool**\\n\\nSet to true to loop the video. This is set to false by default.\",\n    \"3-1\": \"**PropTypes.bool**\\n\\nSet to true to mute the video. This is set to false by default.\",\n    \"9-1\": \"**PropTypes.number**\\n\\nA number represented volume from 0 to 1. Max volume is equal to 1. Min volume is equal to 0. This is set to 1 by default.\",\n    \"4-0\": \"**onBufferEnd**\",\n    \"6-0\": \"**onBufferStart**\",\n    \"6-1\": \"**PropTypes.func**\\n\\nCallback invoked when video begins buffering. Called at least once at the beginning of playback/video creation.\",\n    \"4-1\": \"**PropTypes.func**\\n\\nCallback invoked when the underlying video component has finished buffering.\",\n    \"7-1\": \"**PropTypes.func**\\n\\nCallback that is called when the video is finished playing. This function isn't called at the end of a video if looping is enabled.\",\n    \"7-0\": \"**onFinish**\",\n    \"5-0\": \"**onError**\",\n    \"5-1\": \"**PropTypes.func**\\n\\nCallback invoked when the Video fails to load. The error message is contained in event.nativeEvent.error\",\n    \"8-0\": \"**onUpdateTime**\",\n    \"8-1\": \"**PropTypes.func**\\n\\nCallback that is called when the current playback position has changed.\\n\\nFor example:\\n```  \\n_onUpdateTime(currentPlaybackTimeInSeconds, totalPlayBackDurationInSeconds) {\\n    // Update Seek Bar or custom UI\\n}\\n```\"\n  },\n  \"cols\": 2,\n  \"rows\": 10\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Methods\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"seekToTime(timeInSeconds: number)\",\n    \"0-0\": \"Sets the video to the specified time in seconds. \\n\\n|Parameters    | Description |        \\n| ------------- |:------------- |\\n|timeInSeconds     | Number of seconds into video to seek to. |\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]","excerpt":"","slug":"viromaterialvideo","type":"basic","title":"ViroMaterialVideo"}
A component that provides a control for video materials. This can be used to start, stop, play video textures. ######Example use: [block:code] { "codes": [ { "code": "\n<ViroMaterialVideo ref={\"video_ref\"} material={\"test_material\"} paused={false}\n onBufferStart={this._onBufferStart} onBufferEnd={this._onBufferEnd}\n loop={true} muted={false} volume={1.0}\n onFinish={this._onVideoFinished} onUpdateTime={this._onUpdateTime} />\n\n//Video texture example:\n \nViroMaterials.createMaterials({\n test_material: {\n shininess: 2.0,\n lightingModel: \"Lambert\",\n diffuseTexture: require('./res/test_video.mp4'),\n },\n});\n\n", "language": "javascript" } ] } [/block] [block:api-header] { "title": "Props" } [/block] ##Optional Props [block:parameters] { "data": { "0-0": "**material**", "0-1": "**PropTypes.string**\nA string that each represent a video material that was created via ViroMaterials.createMaterials(). \n\nA video material has it's diffuseTexture property set to a video asset.", "h-0": "PropKey", "h-1": "PropType", "1-0": "**paused**", "2-0": "**loop**", "3-0": "**muted**", "9-0": "**volume**", "1-1": "**PropTypes.bool**\n\nSet to true to pause the video. This is set to false by default.", "2-1": "**PropTypes.bool**\n\nSet to true to loop the video. This is set to false by default.", "3-1": "**PropTypes.bool**\n\nSet to true to mute the video. This is set to false by default.", "9-1": "**PropTypes.number**\n\nA number represented volume from 0 to 1. Max volume is equal to 1. Min volume is equal to 0. This is set to 1 by default.", "4-0": "**onBufferEnd**", "6-0": "**onBufferStart**", "6-1": "**PropTypes.func**\n\nCallback invoked when video begins buffering. Called at least once at the beginning of playback/video creation.", "4-1": "**PropTypes.func**\n\nCallback invoked when the underlying video component has finished buffering.", "7-1": "**PropTypes.func**\n\nCallback that is called when the video is finished playing. This function isn't called at the end of a video if looping is enabled.", "7-0": "**onFinish**", "5-0": "**onError**", "5-1": "**PropTypes.func**\n\nCallback invoked when the Video fails to load. The error message is contained in event.nativeEvent.error", "8-0": "**onUpdateTime**", "8-1": "**PropTypes.func**\n\nCallback that is called when the current playback position has changed.\n\nFor example:\n``` \n_onUpdateTime(currentPlaybackTimeInSeconds, totalPlayBackDurationInSeconds) {\n // Update Seek Bar or custom UI\n}\n```" }, "cols": 2, "rows": 10 } [/block] [block:api-header] { "title": "Methods" } [/block] [block:parameters] { "data": { "h-0": "seekToTime(timeInSeconds: number)", "0-0": "Sets the video to the specified time in seconds. \n\n|Parameters | Description | \n| ------------- |:------------- |\n|timeInSeconds | Number of seconds into video to seek to. |" }, "cols": 1, "rows": 1 } [/block]