Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28217] iOS: Ti.Media.VideoPlayer is crashing when setting showsControls earlier than url property

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2021-04-08T15:21:44.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.0.0
ComponentsiOS
Labelsvideoplayer
ReporterVijay Singh
AssigneeVijay Singh
Created2020-11-02T22:48:13.000+0000
Updated2021-07-23T17:34:11.000+0000

Description

When setting property 'showControl' at creation time of Ti.Media.VideoPlayer and 'url' property later is crashing the app. Test Case -
var basewin = Ti.UI.createWindow({
	backgroundColor : 'white',
	layout : 'vertical'
});

var videoPlayer = Titanium.Media.createVideoPlayer({
    top : 120,
    autoplay : false,
    backgroundColor : 'blue',
    height : 300,
    width : 300,
    mediaControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT,
    scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FIT,
    showsControls: true,
  //  url: 'https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4' // Setting url at creation time will not crash
});

videoPlayer.url = 'https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4';
basewin.add(videoPlayer);
basewin.open();
Work around - Set url property at Ti.Media.VideoPlayer creation time.

Comments

  1. Vijay Singh 2021-03-01

    PR - https://github.com/appcelerator/titanium_mobile/pull/12508
  2. Samir Mohammed 2021-04-07

    FR Passed, waiting on Jenkins build.
  3. Christopher Williams 2021-04-08

    merged to master and 10_0_X branches
  4. Francisco Antonio Duran Ramirez 2021-07-23

    Hello. Good afternoon. I am still getting the crash even adding the workaround suggested. This is a critical issue. When I try to set the url property on the controller of the video component, the app is crashing. With {color:#14892c}9.3.2.GA it is working pretty good{color}, but with TiSDK {color:#d04437}10.0.0.GA it is still crashing.{color} *I am using the following specs:*
       Appcelerator Command-Line Interface, version 9.0.1
       Node.js
         Node.js Version             = 14.17.3
         npm Version                 = 6.14.13
       
       Appcelerator CLI
         Installer                   = 6.0.0
         Core Package                = 9.0.1
       
       Titanium CLI
         CLI Version                 = 5.3.2
         node-appc Version           = 1.1.2
       
    *Log:*
       [DEBUG] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<AVPlayerViewController: 0x7fd6ae0aa000> should have parent view controller:<TiViewController: 0x7fd6adc5c6c0> but actual parent is:<TiRootViewController: 0x7fd6ae81d000>'
       [DEBUG] *** First throw call stack:
       [DEBUG] ( 
       [DEBUG]         0   CoreFoundation                      0x00007fff20422fba __exceptionPreprocess + 242
       [DEBUG]         1   libobjc.A.dylib                     0x00007fff20193ff5 objc_exception_throw + 48
       [DEBUG]         2   CoreFoundation                      0x00007fff20422e98 -[NSException initWithCoder:] + 0
       [DEBUG]         3   UIKitCore                           0x00007fff24c01690 -[UIView(Hierarchy) _associatedViewControllerForwardsAppearanceCallbacks:performHierarchyCheck:isRoot:] + 225
       [DEBUG]         4   UIKitCore                           0x00007fff24c01dfc -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 334
       [DEBUG]         5   UIKitCore                           0x00007fff24c02c97 _makeSubTreePerformSelector + 631
       [DEBUG]         6   UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         7   UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         8   UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         9   UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         10  UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         11  UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         12  UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         13  UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         14  UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         15  UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         16  UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         17  UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         18  UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         19  UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         20  UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         21  UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         22  UIKitCore                           0x00007fff24c02cb4 _makeSubTreePerformSelector + 660
       [DEBUG]         23  UIKitCore                           0x00007fff24c11fb5 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 484
       [DEBUG]         24  demo                                0x0000000102177247 -[DkNappDrawerDrawer controller] + 3338
       [DEBUG]         25  demo                                0x00000001021777de -[DkNappDrawerDrawer frameSizeChanged:bounds:] + 35
       [DEBUG]         26  TitaniumKit                         0x00000001026bfe43 -[TiUIView checkBounds] + 517
       [DEBUG]         27  TitaniumKit                         0x00000001026c00be -[TiUIView setBounds:] + 83
       [DEBUG]         28  TitaniumKit                         0x00000001026d4e5b -[TiViewProxy relayout] + 842
       [DEBUG]         29  TitaniumKit                         0x00000001026d435a -[TiViewProxy refreshView:] + 405
       [DEBUG]         30  TitaniumKit                         0x00000001026d50a0 -[TiViewProxy layoutChildrenIfNeeded] + 141
       [DEBUG]         31  TitaniumKit                         0x00000001026f4b5c performLayoutRefresh + 272
       [DEBUG]         32  CoreFoundation                      0x00007fff2039178a __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
       [DEBUG]         33  CoreFoundation                      0x00007fff2039127c __CFRunLoopDoTimer + 924
       [DEBUG]         34  CoreFoundation                      0x00007fff2039081a __CFRunLoopDoTimers + 265
       [DEBUG]         35  CoreFoundation                      0x00007fff2038ae69 __CFRunLoopRun + 2013
       [DEBUG]         36  CoreFoundation                      0x00007fff2038a1a7 CFRunLoopRunSpecific + 567
       [DEBUG]         37  GraphicsServices                    0x00007fff2b874d85 GSEventRunModal + 139
       [DEBUG]         38  UIKitCore                           0x00007fff246c14df -[UIApplication _run] + 912
       [DEBUG]         39  UIKitCore                           0x00007fff246c639c UIApplicationMain + 101
       [DEBUG]         40  demo                                0x0000000101cc2ba2 main + 1170
       [DEBUG]         41  libdyld.dylib                       0x00007fff2025abbd start + 1
       [DEBUG]         42  ???                                 0x0000000000000001 0x0 + 1
       [DEBUG] ) 
       [DEBUG] libc++abi: terminating with uncaught exception of type NSException
       
    Note: Perhaps this crash is due that I am using the module of :
        <module platform="iphone" version="2.1.1">dk.napp.drawer</module>
       
    Please let me know whether you have any doubt or question. Thanks, and best, Antonio Duran.

JSON Source